Digital Circuits Lab
Digital Circuits Lab
LIST OF EXPERIMENTS:
1. Design a simple combinational circuit with four variables and obtain minimal expression
and verify the truth table using Digital Trainer Kit.
2. Verification of functional table of 3 to 8-line Decoder /De-multiplexer.
3. 4 Variable logic function verification using 8 to1 multiplexer.
4. Design full adder circuit and verify its functional table.
5. Design a four-bit ring counter using D Flip–Flops/JK Flip Flop and verify output
6. Design a four bit Johnson’s counter using D Flip-Flops/JK Flip Flops and verify output
7. Verify the operation of 4-bit Universal Shift Register for different Modes of operation.
8. Draw the circuit diagram of MOD-8 ripple counter and construct a circuit using T-Flip-
Flops and Test It with a low frequency clock and sketch the output waveforms.
9. Design MOD–8 synchronous counter using T Flip-Flop and verify the result and sketch
the output waveforms.
10. (a) Draw the circuit diagram of a single bit comparator and test the output
(b) Construct 7 Segment Display Circuit Using Decoder and7 Segment LED and test it.
11. Design Binary to Gray and Gray to Binary conversion using gates
CONTENTS
3 8 to1 multiplexer.
4 Full adder.
Four-bit ring counter using D Flip–Flops/JK Flip Flop.
5
Four bit Johnson’s counter using D Flip-Flops/JK Flip Flops.
6
create a file called Filename by choosing the Editor > New HDL File menu option to
Then add the file to the project by right clicking on the User Source Files Folder and choosing
Add HDL Files to Source File Folder from the context menu.
First, build the project by pressing the yellow Build button on the simulation button bar or
After the build you are also able to set the top-level component for the project and/or select
Check the Report window to find any syntax errors found by the build.
Next, start the simulator by pressing one of the green buttons on the Build and Simulate button bar.
EXP NO : DATE:
AIM:- Design a simple combinational circuit with four variables and obtain minimal expression
and verify the truth table
APPARATUS REQUIRED:
Desktop Computer, Synapticad Tool for Verilog Programming
Example:
SELECTI
ON OUTPUTS
LINES
A B C D Y
0 0 0 0 0
0 0 0 1 0
0 0 1 0 1
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0
1 1 0 1 1
1 1 1 0 0
1 1 1 1 1
Solution:-
Page 4
DCD LABORATORY II B.Tech I Sem
Explanation
The simplification of the function is done as per the following steps −
There are no isolated 1s in the K-Map.
The minterm m2 can form a 4-square with m3, m6, and m7. Make it and read it as −
A’C
The minterm m8 can form a 2-square with m10. Make it and read it as −
ABD’
The minterm m13 can form a 2-square with m15. Make it and read it as −
(AB’D)
Write all the product in SOP form.
So the simplified SOP expression is,
f(A,B,C,D)=A’C+AB’D+ABD’
RESULT:
Page 5
DCD LABORATORY II B.Tech I Sem
LOGIC DIAGRAM:
Page 6
DCD LABORATORY II B.Tech I Sem
APPARATUS REQUIRED:
Desktop Computer, Synapticad Tool for Verilog Programming
THEORY:
ENCODER:
For an 8-to-3 binary encoder with inputs I0-I7 the logic expressions of the outputsY0-
Y2 are:
DECODER:
A decoder is a device which does the reverse operation of an encoder, undoing the
encoding so that the original information can be retrieved. The same methodused to encode
is usually just reversed in order to decode. It is a combinational circuit thatconverts binary
information from n input lines to a maximum of 2n unique output lines. Indigital
electronics, a decoder can take the form of a multiple-input, multiple-output logiccircuit
that converts coded inputs into coded outputs, where the input and output codes are
different. e.g. n-to- 2n, binary-coded decimal decoders. Enable inputs must be on for the
decoder to function, otherwise its outputs assume a single "disabled" output code word. In
case of decoding all combinations of three bits eight (2 3=8) decoding gates are required.
This type of decoder is called 3-8 decoder because 3 inputs and 8 outputs. For any input
combination decoder outputs are 1.
Page 7
DCD LABORATORY II B.Tech I Sem
LOGIC DIAGRAM:
Page 8
DCD LABORATORY II B.Tech I Sem
DEMULTIPLEXER:
RESULT:
CONCLUSION:
VIVA QUESTIONS:
2. What is demultiplexer?
Page 9
DCD LABORATORY II B.Tech I Sem
LOGIC DIAGRAM:
FUNCTION TABLE
SELECTION STROBE
LINES OUTPUTS
C B A E Y Y
X X X 1 0 1
0 0 0 0 D0 D0
0 0 1 0 D1 D1
0 1 0 0 D2 D2
0 1 1 0 D3 D3
1 0 0 0 D4 D4
1 0 1 0 D5 D5
1 1 0 0 D6 D6
1 1 1 0 D7 D7
Page 10
DCD LABORATORY II B.Tech I Sem
APPARATUS REQUIRED:
Desktop Computer, Synapticad Tool for Verilog Programming
THEORY:
Design of 8 to 1 Multiplexer: It is a four-variable function and thus we require a multiplexer along with three
selection lines and 8 inputs. We select to apply variables B, C, and D for the selection lines. It is shown in
Table no.1. The first half of given minterms are associated with A' and the second half with A. Through
circling the minterms of the function and applying the rules for determine values for the multiplexer inputs,
the implementation represented in Table no.2.
The specified function can be implemented along with a 8-to-1 multiplexer as represented in fig.(a). 3 of the
variables as B, C and D are applied to the selection lines in order that is B is connected to s2, C to s1 and D to
s0. Hence the inputs of the multiplexer are 0, 1, A and A'. As BCD = 000,001 and 111 output F = 1 because
I0 and I8 = 1 for BCD(000), I1 = 1and I9 =1 correspondingly. Thus, minterms m0 = A' B' C' m1 = A' B' C,
m8 = A', B', C' and m9 = A' B' C generate a 1 output. While BCD = 010, 101 and 110, output F = 0, as I2, I5
and I6 respectively are equivalent to 0.
Page 11
DCD LABORATORY II B.Tech I Sem
Minterm A B C D F
0 0 0 0 0 1
1 0 0 0 1 1
2 0 0 1 0 0
3 0 0 1 1 1
4 0 1 0 0 1
5 0 1 0 1 0
6 0 1 1 0 0
7 0 1 1 1 0
8 1 0 0 0 1
9 1 0 0 1 1
10 1 0 1 0 0
11 1 0 1 1 0
12 1 1 0 0 0
13 1 1 0 1 0
14 1 1 1 0 0
15 1 1 1 1 1
Page 12
DCD LABORATORY II B.Tech I Sem
RESULT :
CONCLUSION:
Page 13
DCD LABORATORY II B.Tech I Sem
VIVA QUESTIONS:
1. What is a multiplexer?
3. What is a de-multiplexer?
Page 14
DCD LABORATORY II B.Tech I Sem
CIRCUIT DIAGRAM:
TRUTH TABLE
Page 15
DCD LABORATORY II B.Tech I Sem
APPARATUS REQUIRED:
Desktop Computer, Synapticad Tool for Verilog Programming
THEORY:
Full adder
A Full adder is a combinational circuit that performs addition of three input bits. Half adder
has inputs X, Y, Z and outputs sum (S) and carry(C). The truth table is
Page 16
DCD LABORATORY II B.Tech I Sem
Page 17
DCD LABORATORY II B.Tech I Sem
A full adder can also be implemented using two half adders and one OR gate as shown in
fig.The sum output from second half adder is
C=xy+yz+xz
RESULT:
CONCLUSION
VIVA QUESTIONS:
Page 18
DCD LABORATORY II B.Tech I Sem
LOGIC DIAGRAM:
Page 19
DCD LABORATORY II B.Tech I Sem
APPARATUS REQUIRED:
THEORY:
Ring counter and Johnson counters are basically shift registers Ring
Ring counter:
As it can be seen from the truth table there are four unique output stages for this counter. The
modulus value of a ring counter is n, where n is the number of flip flops. Ring
counter iscalled divided by N counter where N is the number of FF
Page 20
DCD LABORATORY II B.Tech I Sem
RESULT:
COCLUSION:
VIVA QUESTIONS:
Page 21
DCD LABORATORY II B.Tech I Sem
AIM: Design a four bit Johnson’s counter using D Flip-Flops/JK Flip Flops.
APPARATUS REQUIRED:
THEORY:
The modulus value of a ring counter can be doubled by making a small change in the ring counter circuit.
The Q‟ and Q of the last FFS are connected to the J and K input of the first FFrespectively. This is the
Johnson counter.
Initially the FFs are reset. After first clock pulse FF0 is set and the remaining FFs are reset.
After the eight clock pulse all the FFS are reset. There are eight different conditions creating a
mode 8 Johnson counter. Johnson counter is called a twisted ring counter or divide by 2N
counter.
Page 22
DCD LABORATORY II B.Tech I Sem
LOGIC DIAGRAM:
Page 23
DCD LABORATORY II B.Tech I Sem
RESULT:
COCLUSION:
VIVA QUESTIONS:
Page 24
DCD LABORATORY II B.Tech I Sem
LOGIC DIAGRAM:
Page 25
DCD LABORATORY II B.Tech I Sem
AIM: Verify the operation of 4-bit Universal Shift Register for different Modes of operation.
THEORY:
Shift registers are the sequential logic circuits that can store the data temporarily and provides
the data transfer towards its output device for every clock pulse. These are capable of
transferring/shifting the data either towards the right or left in serial and parallel modes. Based
on the mode of input/output operations, shift registers can be used as a serial-in-parallel-out shift
register, serial-in-serial-out shift register, parallel-in-parallel-out shift register, parallel-in-
parallel-out shift register. Based on shifting the data, there are universal shift registers and
bidirectional shift registers. Here is a complete description of the universal shift register.
What is a Universal Shift Register?
Definition: A register that can store the data and /shifts the data towards the right and left along
with the parallel load capability is known as a universal shift register. It can be used to perform
input/output operations in both serial and parallel modes. Unidirectional shift registers and
bidirectional shift registers are combined together to get the design of the universal shift register.
It is also known as a parallel-in-parallel-out shift register or shift register with the parallel load.
Universal shift registers are capable of performing 3 operations as listed below.
Parallel load operation – stores the data in parallel as well as the data in parallel
Shift left operation – stores the data and transfers the data shifting towards left in the
serial path
Shift right operation – stores the data and transfers the data by shifting towards right in
the serial path.
Hence, Universal shift registers can perform input/output operations with both serial and parallel
loads.
Serial input for shift-right control enables the data transfer towards the right and all the
serial input and output lines are connected to the shift-right mode. The input is given to
the AND gate-1 of the flip-flop -1 as shown in the figure via serial input pin.
Serial input for shift-left enables the data transfer towards the left and all the serial input
and output lines are connected to shift-left mode.
In parallel data transfer, all the parallel inputs and outputs lines are associated with the
parallel load.
Clear pin clears the register and set to 0.
CLK pin provides clock pulses to synchronize all the operations.
In the control state, the information or data in the register would not change even though
the clock pulse is applied.
If the register operates with a parallel load and shifts the data towards the right and left,
then it acts as a universal shift register.
From the above figure, selected pins the mode of operation of the universal shift register.
Serial input shifts the data towards the right and left and stores the data within the
register.
Page 26
DCD LABORATORY II B.Tech I Sem
FUNCTION TABLE:
S0 S1 Mode of Operation
0
0 Locked state (No change)
0
1 Shift-Left
Shift-Right
1 0
Parallel Loading
1 1
Page 27
DCD LABORATORY II B.Tech I Sem
Page 28
DCD LABORATORY II B.Tech I Sem
RESULT:
CONCLUSION:
VIVA QUESTIONS:
2. Explain the operation of a left shift register & a right shift register?
5. Explain the various modes in which the data can be entered or taken out from a register?
Page 29
DCD LABORATORY II B.Tech I Sem
AIM: Draw the circuit diagram of MOD-8 ripple counter and construct a circuit using T-Flip-Flops
and Test It with a low frequency clock and sketch the output waveforms.
APPARATUS REQUIRED:
Desktop Computer, Synapticad Tool for Verilog Programming
THEORY:
Asynchronous counter:
A digital counter is a set of flip flop. An Asynchronous counter uses T flip flop to perform a
counting function. The actual hardware used is usually J-K flip-flop connected to logic 1.
In ripple counter, the first flip-flop is clocked by the external clock pulse & then each successive
flip-flop is clocked by the Q or /Q‘ output the previous flip-flop. Therefore in an asynchronous
counter the flip-flop are not clocked simultaneously. The input of MS-JK is connected to VCC
because when both inputs are one output is toggled. As MS-JK is negative edge triggered at each
high to low transition the next flip-flop is triggered. On this basis the design is done for MOD-8
counter.
1) Up Counter:
Fig shows 3 bit Asynchronous Up Counter. Here Flip-flop A act as a MSB Flip-flop and Flip-
flop C can act as a LSB Flip-flop. Clock pulse is connected to the Clock of flip-flop C. Output of
Flip-flop C (Qc) is connected to clock of next flip-flop(i.e. Flip-flop B) and so on. As soon as
clock pulse changes output is going to -change(at the negative edge of clock pulse) as a Up count
sequence. For 3 bit Up counter Truth table is as shown below.
2) Down Counter:
Fig shows 3 bit Asynchronous Down Counter. Here Flip-flop a act as a MSB Flip-flop
and Flip-flop C can act as a LSB Flip-flop. Clock pulse is connected to the Clock of flip-flop C.
Output of Flip-flop C (Qc‘) is connected to clock of next flip- flop (i.e. Flip-flop B) and so on.
As soon as clock pulse changes output is going to change(at the negative edge of clock pulse) as
a down count sequence. For 3 bit down counter Truth table is as shown below.
Page 30
DCD LABORATORY II B.Tech I Sem
Truth Table:
LOGIC DIAGRAM:
Page 31
DCD LABORATORY II B.Tech I Sem
TIMING DIAGRAM:
CLK
Qa
0 0 0 0
3 1 1 1
Qb
0 0 1 1 0 0 1 1
Qc
0 0 0 0 1 1 1 1
CLK
Qc
0 0 0 0
1 1 1 1
Qb
0 1 1 0 0 1 1 0
Qa
0 0 0 0
1 1 1 1
Page 32
DCD LABORATORY II B.Tech I Sem
RESULT:
CONCLUSION:
VIVA QUESTIONS:
Page 33
DCD LABORATORY II B.Tech I Sem
APPARATUS REQUIRED:
Desktop Computer, Synapticad Tool for Verilog Programming
THEORY:
A counter in which each flip-flop is triggered by the output goes to previous flip-flop.As all
the flip-flops do not change states simultaneously in asynchronous counter, spike occur at the
output. To avoid this, strobe pulse is required. Because of the propagation delay the operating
speed of asynchronous counter is low. This problem can be solved by triggering all the flip-flops
in synchronous with the clock signal and such counters are called synchronous counters.
Page 34
DCD LABORATORY II B.Tech I Sem
MOD 8 COUNTER:
LOGIC DIAGRAM:
TRUTH TABLE:
States Input
Present Next T
0 0 0
0 1 1
1 0 1
1 1 0
Page 35
DCD LABORATORY II B.Tech I Sem
RESULT:
CONCLUSION:
VIVA QUESTIONS:
Page 36
DCD LABORATORY II B.Tech I Sem
LOGIC DIAGRAM:
INPUTS OUTPUTS
A>B = A B A B A>B A=B A<B
_ 0 0 0 1 0
A<B = A B
0 1 0 0 1 _ _
1 0 1 0 0 A=B = A B +AB
1 1 0 1 0
Page 37
DCD LABORATORY II B.Tech I Sem
AIM: Draw the circuit diagram of a single bit comparator and test the output.
APPARATUS REQUIRED:
Desktop Computer, Synapticad Tool for Verilog Programming
THEORY:
Magnitude Comparator is a logical circuit, which compares two signals A and B andgenerates
three logical outputs, whether A > B, A = B, or A < B. IC 7485 is a high
speed 4-bit Magnitude comparator , which compares two 4-bit words . The A = B Inputmust be
held high for proper compare operation.
Page 38
DCD LABORATORY II B.Tech I Sem
RESULT:
CONCLUSION:
VIVA QUESTIONS:
1. What is a comparator?
3. Derive the Boolean expressions of one bit comparator and two bit comparators.
4. How do you realize a higher magnitude comparator using lower bit comparator
Page 39
DCD LABORATORY II B.Tech I Sem
AIM: Construct 7 Segment Display Circuit Using Decoder and7 Segment LED and test it.
APPARATUS REQUIRED:
Desktop Computer, Synapticad Tool for Verilog Programming
THEORY:
The functions of LT, RBI, RBO and BI are given below. LT This is called the LAMP TEST
terminal and is used for segment testing. If it is connected to logic ‘0’ level, all the segements of
the display connected to the decoder will be ON. For normal decoding operation, this terminal is
to be connected to logic ‘1’ level. RBI For normal decoding operation, this is connected to logic
‘1’ level. If it is connected to logic ‘0’, the segment outputs will generate the data for normal 7-
segment decoding, for all BCD inputs except Zero. Whenever the BCD inputs correspond to
Zero, the 7-segment display switches off. This is used for zero blanking in multi-digit displays.
BI If it is connected to logic ‘0’ level, the display is switched-off irrespective of the BCD inputs.
This is used for conserving the power in multiplexed displays. RBO This output is used for
cascading purposes and is connected to the RBI terminal of the succeeding stage.
Page 40
DCD LABORATORY II B.Tech I Sem
CIRCUIT DIAGRAM:
Display
D C B A a b c d e f g
Number
0 0 0 0 0 0 0 0 0 0 1
0 0 0 1 1 0 0 1 1 1 1
0 0 1 0 0 0 1 0 0 1 0
0 0 1 1 0 0 0 0 1 1 0
0 1 0 0 1 0 0 1 1 0 0
0 1 0 1 0 1 0 0 1 0 0
0 1 1 0 1 1 0 0 0 0 0
0 1 1 1 0 0 0 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 0 1 1 0 0
Page 41
DCD LABORATORY II B.Tech I Sem
RESULT:
CONCLUSION:
VIVA QUESTIONS:
2. Can you use the segments outputs of 7448 decoder directly to drive a 7-Segment LED?
If not suggest a suitable interface?
5. What is the difference between common anode & common cathode display?
Page 42
DCD LABORATORY II B.Tech I Sem
AIM: Construct 7 Segment Display Circuit Using Decoder and7 Segment LED and test it.
APPARATUS REQUIRED:
Desktop Computer, Synapticad Tool for Verilog Programming
There are four inputs and four outputs. The input variable are defined as B3, B2, B1, B0 and the output
variables are defined as G3, G2, G1, G0. From the truth table, combinational circuit is designed.The logical
expressions are defined as :
B3 = G 3
B2 ⊕ B 3 = G 2
B1 ⊕ B 2 = G 1
B0 ⊕B1 =G0
Page 43
DCD LABORATORY II B.Tech I Sem
The Most Significant Bit (MSB) of the binary code is always equal to the MSB of the given binary number.
Other bits of the output binary code can be obtained by checking gray code bit at that index. If current gray code bit is
0, then copy previous binary code bit, else copy invert of previous binary code bit.
There are four inputs and four outputs. The input variable are defined as G3, G2, G1, G0 and the output variables are
defined as B3, B2, B1, B0. From the truth table, combinational circuit is designed. The logical expressions are defined
as :
G 0 ⊕ G1 ⊕ G2 ⊕ G3 = B 0
G 1 ⊕ G2 ⊕ G3 = B 1
G 2 ⊕ G3 = B 2
G3 =B3
Page 44
DCD LABORATORY II B.Tech I Sem
RESULT:
Page 45