CSC270 Lab #4
EXPERIMENT #1: A "Do-it-yourself" Decoder
Complete the circuit shown in Figure 1 by adding the name of the circuit inside the logic symbol, and by adding the pin numbers on the inputs and outputs of the gates. Also, do not forget that each circuit requires power and ground.
When you are done, implement the circuit on the breadboard section of your kit. Make sure you have turned off the power before you start wiring. Make sure also that you connect the outputs of the inverters to the four logic indicators. Verify your connections before you turn the power back on. Activate the two inputs and record the outputs in the table below:
SW1 | SW2 | L4 | L3 | L2 | L1 |
0 | 0 | ||||
0 | 1 | ||||
1 | 0 | ||||
1 | 1 |
Because the inactive outputs are all set to zero, and the active one is set to 1, we refer to this type of circuit as a circuit with "active high" outputs.
Now connect L1, L2, L3 and L4 to the input of the inverters rather than their output, and record the variation of L4, L3, L2 and L1 as a function of SW2 and SW1.
SW1 | SW2 | L4 | L3 | L2 | L1 |
0 | 0 | ||||
0 | 1 | ||||
1 | 0 | ||||
1 | 1 |
You now have the opposite behavior, where the inactive outputs are all 1 except for one that is set to 0. We refer to this type of circuit as a circuit with active-low outputs.
Most decoders work as the last circuit you just tested, rather than the one you first experimented with, although the first circuit had a more "logical" behavior.
Do not disassemble your circuit, as you will need it for the next section.
EXPERIMENT #2: Implementing an Adder with a Decoder
In this section, you will be using the decoder you have implemented in the previous section to create a two-bit adder. This adder will have two inputs, controlled by SW1 and SW2, and will generate two outputs, SUM and CARRY.
First, fill out the truth table for Sum and Carry below. Identify the minterms needed to implement the SUM and CARRY signals.
A | B | Sum | Carry |
0 | 0 | ||
0 | 1 | ||
1 | 0 | ||
1 | 1 |
Knowing that the decoder you have implemented in Part I generates all the minterms of SW1 and SW2, add the necessary gates to generate Sum and Carry from the outputs of the decoder.
EXPERIMENT #3: THE 74LS42
Block 6 on the circuit board attached to your kit contains a circuit centered on a 7442 (or 74LS42). The logic diagram of the circuit is shown in Figure 2. It has four inputs connected to the test points labeled TP602, TP603, TP604, and TP605. Connect these test points to the data switches. You may want to add a "post-it" note above the data switches to indicate which inputs of the 74LS42 (A, B, C or D) you are activating with the switches. The ten outputs of the 7442 are connected to 10 LEDs, labeled L604 to L613.
To apply power to the 7442, close DIP-switches 7 and 8 in Block 6 (closing a switch means bringing it in the position where the little knob is aligned with the number "1" painted on the switch). (Note: A Dip switch is a "Dual In Line" switch, that is a series of miniature switches that have the same footprint as a regular integrated circuit.)
Turn the Kit power back ON. Activate the data switches and record the variation of the output LEDs in the table below.
D | C | B | A | L13 | L12 | L11 | L10 | L9 | L8 | L7 | L6 | L5 | L4 |
Do all 16 combinations result in an LED change? Does this decoder have active-low or active-high outputs? An hexadecimal decoder is a decoder that is sensitive to all 16 possible binary inputs. A decimal decoder is sensitive to only those input patterns corresponding to the decimal numbers 0 (0000) to 9 (1001). What type of decoder is the 7442? In other words, does it decode decimal or hexadecimal numbers?
EXPERIMENT #4: Another Kind of decoder: The 9368
The 9368 is a binary to 7-segment decoder. It implements all seven functions required to turn on and off the LEDs of a 7-segment display. We saw in class today how to implement the function activating the "a" LED of a display. The 9368 contains all the functions for the a, b, c, d, e, f, and g LEDs. The 9368, like the circuit we saw inclass, takes only BCD (Binary-Coded Decimal) numbers (no hexadecimal numbers).
But before we play with the 9368, you need to understand how another circuit, the 74LS90.
Figure 3 shows the circuit implemented in Block 7. It contains a 74LS90, which we haven't seen yet, but which we will have an opportunity to meet again when the course moves on to sequential circuits. It is a BCD counter. If you apply the clock signal to its input (TP701), it starts counting in BCD (i.e. counting from 0 to 9 and then back to 0). Every cycle of the clock, the counter changes state, and the 4 LEDs L701, L702, L703, and L704 indicate the new binary output.
Let's test the circuit. First, turn the Kit power OFF.
Close all the DIP switches in Block 7, except for Switch 1 which you will leave open (OFF). (It provides power to the 9368, which we do not want to test yet). Connect TP701 to the clock signal (TP906). This way, the 1 Hz signal generated by the base of the kit is fed to the counter. Turn the Kit power ON. What pattern do you observe on the LEDs? Record the sequence of binary patterns you observe on the four LEDs in the table below.
L704 | L703 | L702 | L701 |
Back to exploring the 9368 decoder...
In our circuit these four outputs are fed to the 9368 which implements the conversion from binary to 7-segment. Close Switch 1 in Block 7 (ON) to apply power to the 9368 circuit. Note how the pattern on the 7-segment display is associated with the pattern on the 4 LEDs.
In the table below, indicate the relationship between the pattern of LEDs and the number shown on the 7-segment display.
L704 | L703 | L702 | L701 | 7-segment readout |
You have played tonight with different kinds of decoders. They all work in the same way, "decoding" the input to figure out which output to activate. Sometimes they have active low outputs, sometimes active high. Sometimes they accept decimal only inputs, sometimes fully binary patterns. Sometimes, still, they are used for specific applications, like the 7-segment decoder.