In this experiment, we will design a “guess the pattern” game. One player will set three inputs, A, B, and C, to any combination of binary values. This player does not show the pattern to the other player. The other player sets three other inputs, D, E, and F, to some combination of binary values. If A,B,C = D,E,F, that is, A = D, B = E, and C = F, then the game lights a single light, an LED in this case. If not, the LED is not lit.
To design this game, we first design a circuit to check whether or not A and D are equal. First complete the truth table in Table L6.1(a). Enter all possible combinations of values for A and D; then enter an output value of 1 if A and D are the same, or 0 if they are not. Next, determine a function for this truth table. Repeat this to develop functions that check if B and E are equal, and if C and F are identical, using Tables L6.1(b) and (c).
Table L6.1: Truth tables for the three comparisons (a) A = D, (b) B = E, and (c) C = F
( a ) | ( b ) | ( c ) | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
Now that you have an equation for each of our three comparisons, the next task is to design three logic circuits to generate the functions A = D, B = E, and C = F. You should be able to generate each of these functions using either:
(You could also use one XNOR gate, but we won’t do that here. The 74266 chip is a special type of chip that uses open collector outputs. We could use that chip, but we would have to connect additional resistors to make them work with our other chips. For now, consider it sufficient that we will use only regular, non-open collector chips to simplify our design.)
The design of the three circuits should be identical, except for their different input and output values, since each compares two different inputs to see if they are equal.
After designing and building these three circuits, test them using a logic probe. Vary the inputs to check every combination in the truth tables. Verify that each circuit correctly outputs a 1 whenever and only when it inputs are the same.
Now we must take the three circuit outputs and combine them, outputting a 1 only when (A = D), (B = E), and (C = F) are all 1. First complete the truth table in Table L6.2. The inputs (A = D), (B = E), and (C = F) would be generated by the circuits we just designed. The truth table should have output (ABC = DEF) equal to 1 only when all three inputs are 1.
( A = D ) | ( B = E ) | ( C = F ) | ABC = DEF |
---|---|---|---|
Next we design a circuit to take these three inputs and output a 1 only when all three are 1. This is a relatively straightforward design. After designing this circuit, test all possible combinations of input values with a logic probe to verify that it generates an output of 1 only when all three inputs are 1.
Now connect the sections of your circuits together as shown in Figure L6.1. The first three circuits check whether A = D, B = E, and C = F. The outputs of these circuits are input to the last circuit, which checks whether all three pairs of bits are the same. It outputs a 1 if the player has guessed the pre-set pattern, or 0 otherwise.
Finally, we connect the (ABC = DEF) output to the LED, as shown in Figure L6.1. Note that the direction of the LED is important. The LED has two different length leads. The longer lead should be connected to the circuit that checks if ABC = DEF and the shorter lead should be connected to the resistor. Notice the resistor in this circuit. This is needed to keep the LED from receiving too much current and burning out.
After designing and building the circuit, demonstrate it to the instructor.
In the report describe briefly the design procedure, from the truth table to the logic functions and finally the logic gates and their connections. Include a schematic of the final circuit.