E3: Digital electronics Goals: Basic understanding of logic circuits. Become familiar with the most common digital components and their use. Equipment: 1 st. LED bridge 1 st. 7-segment display. 2 st. IC (4x2-input NAND) 1 st. IC (6x1-input NOT) 1 st. IC (3x3-input NAND) 1 st. IC (2x4-input NAND) 2 st. IC (7-segment display driver) 1 st. IC (2x1 JK-flip-flop) 1 st. IC (4-bitars binary counter) 1 st. IC (5-bit shift register) 1 st. Breadboard 1 st. digital oscilloscope. The components 1. The light emitting diodes (LED) The voltage drop over an LED is ca. 2 V Limit the current by a few hundred ohm series resistor. The cathode side cut off. 2. The LED bridge. Ten individual LEDs in one unit. The anode side is marked by the cut off corner. Also here you need the series resistor. 3. The resistor bridge. 8 pc. 470 Ω resistors Connected together on one side. See fig 1. Fig 1. Resistor bridge
4. 7-segment display 7 LEDs which can show the digits 0-9. The anode is common. The decoding from binary number to shining segments is done in the circuit. Pins a, b, c, d, e, f, g connect to the individual diode cathodes. The pin DP connects to the decimal point. Figur 2. 7-segment display Figur 3. 74HC47 driver to 7 segment display 5. 7-segment display driver circuit The 74HC47 chip with supply voltages (pin 16: V CC = + 5 V and pin 8: GND = 0 V) decodes the binary number (inputs DCBA). The relevant segments labels have corresponding output pins on the chip. RBI and RBO may be unconnected (nc). LT stands for Lamp Test. When grounded, all LEDs of the display will shine 6. The inverter chip The 74HC04 circuit contains 6 inverters ( NOT gates). The supply voltages shall be the normal : V CC = + 5 V och GND = 0 V. Since the chip contains 6 gates it is called a 6x1 NOT gate. The label HC indcates that it is not a standard TTL circuit. The C means that it uses the CMOS definition of logic 1 and logic 0. This will be important when we use the chip to make a clock pulse generator. Figur 4. 74HC04 NOT-gate
7. NAND-gate NAND-gates have two or more inputs per gate. The pin assignments for three NAND chips follow in figure 5. You have them in the box. 74HC00 4x2 input NAND 74HC10 3x3 input NAND 74HC20 2x4 input NAND Figur 5 Pinouts of the NAND gates
8. J-K Flip-Flop The J-K Flip Flop is a type of circuit called sequential net. When the clock signal, Ck, presents a falling edge, the status on the J and K inputs is loaded into the flip-flop. The stored values depend on the previous values in the flip-flop (the sequentiality). There are two control signals CL and PR. (clear and preset). 74HC76 (2x1 JK flip-flop) 74HC93 (4-bit binary counter) 74HC96 5-bit shift register Principal sketch of the shift register. Figur 6. Circuits with Flip-Flops
How to connect IC s to the breadboard Remove a chip carefully. Use a screwdriver or similar to lift it up in small steps at each end. Large chips with many legs may require special tools. Make sure that you don t forget supply voltage and ground connection! Inputs must in general be connected in order to have well defined status. Static electricity can easily charge up an input to make it logic 1. Pins labeled NC (Not Connected) can be left open. The Lab work starts here: A. Logic circuits You use the LED-bridge to visualize the output result. Use the resistor bridge to provide individual protection resistors to the LEDs (maximum 8 are used). Connect + 5 V to the common pin of the resistor bridge and the anode of the individual LEDs to the other end of each resistor. How can you make the LED shine? Save the LED circuit for use later during the lab (all day). Normally, logic circuits operate on simultaneous pulses on the inputs. We will make it easier with static values 0V (logic 0 ) and 5V (logic 1 ) by connecting wires to ground and to the supply voltage. Let us start with the inverter, 74HC04. Connect the chip. Study one of the six inverters. Connect logic 1 to the input. Inspect the output with the LED (use one of the segments of the bridge). What do you observe? Describe it in the report. Now lets study the 74HC00, NAND circuit. Connect the chip. Use the LED bridge to inspect the result. Fill out the truth table. Connect the output to the inverter! What logic operation does this circuit perform?
A B Q (just NAND) Q (NAND with inverter) B. Full adder. We will build a 1-bit full adder. Lets take it step by step. The circuit diagram for the half adder is found below. Build it on the breadboard. A B =1 XOR Q & AND C UT Construct the truth table. Unfortunately, we have only NOT- and NAND-gates. At first sight this may seem like a complication and you think you need a lot of circuitry. Once the half adder works you shall make another half adder. Then you connect the two half adders to a full adder. Here you will see that you can save components by being clever.
AND AND or C ut A B C in XOR XOR Q Construct the Truth table. Explain what the circuit does. C. Multiplexer and decoder The two circuits are illustrated in the figures. It is not so instructive to connect and try them. So just let us analyse what these two important circuits do. Explain the function of the two circuits. What is the use of them in a digital system, e.g a computer. D. Clocksignal generator (oscillator) A digital system is normally driven by a clock pulse that keeps track of data in the system. The clock is a pulse train by which activities in the digital system are coordinated. The clock generator we build is a poor mans clock with bad timing accuracy. Precision timing uses crystal oscillators
instead. Simple clock signalgenerator Choose capacitor and resistor to obtain a period time of approximately 1 ms. Study the signals by oscilloskope and explain how the circuit works, based on a sketch of the oscilloscope information at crucial points. Add an inverter on the output to obtain sharp edges on the clock which ideally has vertical steps when changing state. You will need the clockpulse generator later. D. Sequential nets, the flip-flop. So far, we have dealt with combinatorial logic. The output stat does only depend on what the input is. Sequential logic differs so that the output state depend on the input and what the old state was. You see it in the figures below as the connection from the output, back to the input. The simplest flip-flop is called the SR-flip-flop. The index n refers to the clockpulse in the sequence so Q n+1 is the new value and Q n was the previous one. From the truth table you see that One setting (01)corresponds to setting the value to 0, next setting (10)the value is set to 1 and with (11) the previous value is kept. This corresponds to the three states of a memory cell in a computer, clear bi, set bit and remeber bit. For this simple the (00) value has undefined result. Make a complete truth table, i.e. including also the different possibilities of old values. The JK-flip-flop has 4 a well defined states. For J=1 and K=1 the new value is then the inverse of the old value. This is not needed for the memory function but it is very useful in an important circuit, the binary counter.
Make a complete truth table, i.e. including also the different possibilities of old values. F. The binary counter. Connect 74HC93, binary counter according to the description. The chip contains three flip-flops which are connected together and a fourth which is individual. You must connect it to the other three externally to obtain a 4-bit counter. The reset inputs R(1) och R(2) must be grounded. Connect Q A, Q B, Q C, och Q D, to the LED bridge. Use the clock adjusted to a frequency of ca 1Hz, as input. Visualize the clocking on a LED. Describe function with a table and in words. Change to 1kHz frequency. Use the oscilloscope to study the function in detail. Make a sketch of your observations with the oscilloscope. You need the binary counter in part G. Change the frequency back to 1Hz. G. Visualize the counting with 7-segment display. Connect the display (don t forget the protection resistor) to the 74HC47 translator chip. Check that it works by grounding the LT pin. All segments should shine. The outputs from the binary counter should then be removed from the LED bridge and instead connected as Q A =A, Q B =B, Q C =C och Q D =D where A,B,C,D are pins on the 74HC47. Describe the result. It does not look allright all the way up to the result FF. Why? What would you like to do to solve this? This is a common problem so the chips are prepared for a solution. Try to figure it out. You have to check what is inside the chips. Do the change so that the display works as one digit in a decimal counter. Describe your solution.
H. Shiftregister Look at the circuit diagram and explain the function of the shift register. What can it be used for in a digital system. Which matematical operation does it perform? If you have time you can hook up the 74HC96, 5-bit shift register. Connect the parallel outputs to the LED bridge. Connect CL to logic 1 and PE to logic 0. SI to logic 0 and Ck to the clock. Connect a bit pattern on pins PR A, PR B, PR C, PR D, PR E. By quickly setting PRESET ENABLE to logic 1 and back to 0 you load the bit pattern into the shift register. On the next clock edge, the data is moved one step. The last bit emerges on Q E. Connect Q E with SERIAL INPUT and the bit pattern will rotate continuously. You can also try to feed in data into the SERIAL INPUT synchronized by hand with the clock (you have to make the clock it really slow).