Digital Networks and Systems Laboratory 2 Basic Digital Building Blocks Time 4 hours Aim To investigate the basic digital circuit building blocks constructed from combinatorial logic or dedicated Integrated Circuits. Introduction In the previous module you have been shown the basic logic gates. The logic gates can be combined to form circuits that perform useful functions. These Basic digital building blocks will later be used to form more complex and powerful circuits. Encoders and Decoders The encoder is a circuit that takes one input and produces the equivalent coded output. For example, 16 line to 4 line encoder circuit takes a HIGH on one of its 16 input lines and produces an equivalent binary representation on its 4 output lines. The decoder is a circuit that produces one active output for a particular coded input. For example, a 4 bit decoder circuit takes as the input a 4 bit binary code and produce a HIGH on one of 16 output lines. Flip-Flops The flip-flop is a digital memory circuit that can remain in the state in which it was set even after the input signals have been removed. This means that the circuits have a memory function and will hold a value ( 0 or 1) until the flip-flop is forced to be 1 (set) or 0 (reset). Asserting the set or reset lines will set or reset the latch with any other values on the lines having no affect on the output state. It is possible to make flip-flops sample its inputs on a special triggering signal. This may be in the form of a level or an edge. A level trigger means that the flip-flop samples its inputs depending upon the voltage level of the trigger input. An edge trigger means that the flip-flop samples its inputs depending on a LOW-to-HIGH transition on the trigger line or a HIGH-to-LOW transition on a trigger line. Arithmetic Two four bit values can be added using the 74LS83A. This will produce a sum and a carry out. Subtraction can be performed using an adder by noting A B = A + (-B). The B is performed by taking the two s complement of B. This complemented value of B is then added to A to produce a sum. If the Most Significant Bit of the result is set then the result is in two s complement form and needs to be complemented again to find the magnitude. The 2 s complement can be found by inverting all the bits and then adding 1 to it.
Procedure Complete the following procedure and fill in your results in the laboratory sheet provided. (a) Encoders and Decoders 0 1 No Connection A 2 3 B Figure 1 four to two line encoder. Construct the circuit shown in figure 1 Generate the truth table by setting the input lines high one at a time. The other input lines should be set low. A B 0 1 2 3 Figure 2 two to four line decoder. Construct the circuit shown in figure 2. Generate the truth table for the circuit.
(b) RS Flip-Flops R S _ Figure 3 RS Flip-Flop. Construct the circuit shown in figure 3. Apply the following inputs to the circuit and determine the output and /. R S 1 0 0 1 1 What is the meaning of R and S? 2 What effect does setting S=0 and R=0 have on the circuit? A Set Enable S R / / Reset Figure 4 Gated RS Flip-Flop. Construct the circuit shown in figure 4. Draw the waveforms at A and Set for the following conditions : i. Enable = Low Set =1kHz square wave. ii. Enable = High Set = 1kHz square wave. 3 What is the purpose of the enable line? Remove the function generator. Generate the truth table for Set, Enable, Reset, by measuring the inputs and outputs of the circuit. Do not use Set=1, Reset=1
(c) Toggle Flip-Flops Examine the Datasheet for the 74LS76 and set J1=H, K1=H. Connect a 1KHz square wave to /CLK1. Connect the CRO to dual channel and draw the waveforms on /CLK1 and 1. Determine the frequency of /CLK1 and 1 4 (d) What can you deduce about the effect of a toggle flip-flop? Adder circuit Examine the data sheet for the 7483A and construct a circuit to add A=5 and B=3. Connect a seven segment display to the output. Record the output of the display and the carry. Change the circuit to add, 9 and 9. Record the output of the display and the carry. 5 (e) What does the carry indicate? Brainteaser Design and build a circuit that will perform subtraction using two 7483A ICs. Get your demonstrator to check your design before you build it. Check it using the following values. Record the output in binary and write the equivalent decimal output. A=5,B=2 A=5,B=7 Hint: A B = A + (-B)
74LS00 uad 2 input NAND 74LS02 uad 2 input NOR 74LS04 Hex inverter 74LS08 uad 2 input AND 74LS32 uad 2 input OR 74LS76 Dual JK Flip-flop with preset & clear 74LS83 4 bit adder with fast carry
Laboratory 2 Date:.././. Name:. Basic Building Blocks Bay:..... Partner:.. (a) Encoders and Decoders Encoder Input A B 0 1 2 3 Decoder A B 0 1 2 3 (b) RS Flip-Flops R S / 1 0 0 1 1 2. Waveforms A, Set, Enable=L Waveforms A, Set, Enable=H
3 Enable=0 Set Reset Enable=1 Set Reset (c) Toggle flip-flops Frequency /CP1.. 1 4 (d) Adder Circuit A B Output Carry 5 3 9 9 5 (e) Brain Teaser A B Bin Dec 5 2 5 7