1



Designing the Circuitry Functions to Light a Digit

Albert Lilly, Ph.D.
Alabama School of Mathematics and Science
1255 Dauphin St.,
Mobile, AL 36604
E-mail: lilly@asms.net
Voice: (334) 441-2168
Fax: (334) 441-3290


2



Objective:

Light a given digit from 0 to 9 using digital logic. A visualization of the problem can be seen below:

Click here to select a digit interactively if you have a Java compatible browser.


3



In the Java program the digit selected is translated to four inputs: A, B, C, and D. The values of A, B, C, and D are either 1 or 0. 'A' is the leftmost or most significant digit and 'D' is the rightmost or least significant digit. A table of values is shown below:

A B C D    
0 0 0 0 - 0    
0 0 0 1 - 1    
0 0 1 0 - 2    
0 0 1 1 - 3    
0 1 0 0 - 4    
0 1 0 1 - 5    
0 1 1 0 - 6    
0 1 1 1 - 7    
1 0 0 0 - 8    
1 0 0 1 - 9       
1 0 1 0 - ?       
1 0 1 1 - ?       
1 1 0 0 - ?       
1 1 0 1 - ?       
1 1 1 0 - ?       
1 1 1 1 - ?       
The combinations with ? to the right are not used.


4



The format of the digit is similar to a digit on a digital watch. Seven lights are used to form the digit. The lights are numbered from 0 to 6 as shown below:


The selection of the number for each light is arbitrary.


5



The circuitry functions for each of the seven lights is designed separately. A Karnaugh map as shown below can be used.


The bottom two rows are known as area A.
The second and fourth rows are known as area B.
The two right columns are known as area C.
The second and fourth columns are known as area D.

Each of the four inputs (A, B, C, and D) are equal to 1 in each one's respective area and equal to 0 outside. Again, 'A' is the leftmost digit and 'D' is the rightmost.


6



Shown below is the Karnaugh map for the top light (light 0):


An 'X' means that the light is lit for that digit. For example, the top light is lit for a zero but not for a one. A '?' means the combination is not used.


7



The map above is translated into binary logic using AND, OR, and NOT gates (functions). The functions behave as shown below:

A B  AND(A,B)
0 0     0
0 1     0
1 0     0
1 1     1

A B   OR(A,B)
0 0     0
0 1     1
1 0     1
1 1     1

A     NOT(A)
0       1
1       0

The tables for the functions above are known as 'truth tables.'


8



One solution for development of the circuitry functions for inputs A, B, C, and D to correctly light the top light is shown below:

 OR(
    OR(
       OR(A,C),
       AND(B,D)
      ),
    AND(NOT(B),NOT(D))
   )
By extending the table on page three above, the correctness of the functions can be verified. The top light should be lit for zero, two, three, five, six, seven, eight, and nine but not for one or four. (The other combinations are not used and therefore do not matter.) An output of 1 turns on the light--and output of 0 turns off the light. For example, the input combination for zero (A = 0, B = 0, C = 0, D = 0) should turn on the light which means the output of the circuitry functions should be a 1 for the given inputs. The input combination for one (A = 0, B = 0, C = 0, D = 1) should turn off the light which means the output of the circuitry functions should be a 0 for the given inputs.


9



Exercises

Exercise 1: Using truth tables with inputs A, B, C and D, verify that the circuitry functions above include each square with a 'X' and avoid including any blank squares. (The squares with a '?' are not used and therefore can be included or not--either is okay.)

Exercise 2: Draw Karnaugh maps for lights one to six.

Exercise 3: Develop the circuitry functions for lights one to six.

Exercise 4: Verify the corrections of the functions developed in Exercise 3 using the procedure from Exercise 1.

Exercise 5: Download the Java Developers Kit , insert the functions developed above, recompile the program, and run the program to test the correctness of the functions.

Exercise 6: Make any combination of the changes suggested below and repeat Exercises 2 through 5:

Change six:      Change seven:     Change nine:
 _                _         _       _        _
|_   to  |_      | |   to    |     |_|  to  |_|
|_|      |_|       |         |      _|        |