Digital Logic Design Lab File
Digital Logic Design Lab File
TECHNOLOGY
LAB MANUAL
ON
II B. TECH I SEMESTER
R20 B.TECH ECE
Fig:SOP Form
Truth Table:
A B C AB AC BC X
0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 1 0 0 0 0 0
0 1 1 0 0 1 1
1 0 0 0 0 0 0
1 0 1 0 1 0 1
1 1 0 1 0 0 1
1 1 1 1 1 1 1
POS FORM:
POS: - It is the product of the sums form in which the terms are taken as 0. It is denoted in the
K- )
Theory: Logic gates are electronic circuits which perform logical functions on one or more
inputs to produce one output. There are seven logic gates. When all the input combinations of a
logic gate are written in a series and their corresponding outputs written along them, then this
input/ output combination is called Truth Table. Various gates and their working is explained
here.
AND Gate
AND gate produces an output as 1, when all its inputs are 1; otherwise the output is 0. This gate
can have minimum 2 inputs but output is always one. Its output is 0 when any input is 0.
IC 7408
OR Gate
OR gate produces an output as 1, when any or all its inputs are 1; otherwise the output is 0. This
gate can have minimum 2 inputs but output is always one. Its output is 0 when all input are 0.
IC 7432
NOT Gate
NOT gate produces the complement of its input. This gate is also called an INVERTER. It
always has one input and one output. Its output is 0 when input is 1 and output is 1 when input is
0.
IC 7404
NAND Gate
NAND gate is actually a series of AND gate with NOT gate. If we connect the output of an AND
gate to the input of a NOT gate, this combination will work as NOT-AND or NAND gate. Its
output is 1 when any or all inputs are 0, otherwise output is 1.
IC 7400
NOR Gate
NOR gate is actually a series of OR gate with NOT gate. If we connect the output of an OR gate
to the input of a NOT gate, this combination will work as NOT-OR or NOR gate. Its output is 0
when any or all inputs are 1, otherwise output is 1.
IC 7402
IC 7486
Exclusive NOR (X-NOR) Gate
X- not odd, otherwise
output is 0. It has two inputs and one output.
Procedure:
1. Connect the trainer kit to ac power supply.
2. Connect the inputs of any one logic gate to the logic sources and its output to the logic
indicator.
3. Apply various input combinations and observe output for each one.
4. Verify the truth table for each input/ output combination.
5. Repeat the process for all other logic gates.
6. Switch off the ac power supply.
RESULT:
Experiment No: 2
Design and realization of logic gates using universal gates
Aim:-To study the realization of basic gates using universal gates. Understanding how to construct
any combinational logic function using NAND or NOR gates only.
Requirements:
IC 7402(NOR), IC 7400(NAND), 7404(NOT), 7408(AND), 7432(OR), KL 33002,
power
supply, connecting wires and Breadboard etc.
Theory:
AND, OR, NOT are called basic gates as their logical operation cannot be simplified further.
NAND and NOR are called universal gates as using only NAND or only NOR, any
logic function can be implemented. Using NAND and NOR gates and De Morgan's
Theorems different basic gates & EX-OR gates are realized.
De Morgan`s Law:
In formal logic, De Morgan's laws are rules relating the logical operators
"AND" and "OR" in terms of each other via negation. With two operands
A and B:
1. A.B = A + B
2. A+B = A . B
The NAND gate is equivalent to an OR gate with the bubble at its inputs
which are as shown.
The NOR gate is equivalent to an AND gate with the bubble at its inputs which are
as shown.
IMPLEMENTING INVERTER USING NAND GATE :
The figure shows two ways in which a NAND gate can be used as an inverter (NOT
gate).
1. All NAND input pins connect to the input signal A gives an output
2. One NAND input pin is connected to the input signal A while all other
input pins are connected to logic 1. The output will be
An AND gate can be replaced by NAND gates as shown in the figure (The
AND is replaced by a NAND gate with its output complemented by a
NAND gate inverter).
The figure shows two ways in which a NOR gate can be used as an
inverter (NOT gate).
All NOR input pins connect to the input signal A gives an output
One NOR input pin is connected to the input signal A while all other
input pins are connected to logic 0. The output will be
RESULT:
EXPERIMENT - 3
DESIGN 450KHZ CLOCK USING NAND/NOR GATES
AIM: To design 450KHZ clock using nand/nor gates.
APPARATUS : clock generator trainer kit Patch cords
THEORY:
Pulse generator using NAND gate
Pulse generator using NAND gate:
This simple pulse generator using NAND gate is very useful and can be used as
clock generator NAND
gate connected as NOT gate.
Analyzing the circuit diagram and remembering the truth table for a NAND gate, we know that
NOT gate.
How the pulse generator using NAND gate works?
The NAND gate has at its output a square wave whose frequency depends on the values
of capacitorC1 and the series combination of the potentiometer P and resistor R1.
When the output of NAND gate is High (logical 1), the capacitor C1 (which has no charge) sends a
logical zero (0) at the inputs of the NAND gate. The capacitor begins to charge through the
resistorand potentiometer assembly.
Once the capacitor is charged, both inputs of the gate are high (logical 1), causing its output to go
low (logic zero). With the low output, capacitor discharge begins through the same set
of resistorand potentiometer in series, returning to its original state. The process is repeated
continously.You can use a 3.0V to 15V power suppy.
Procedure :
1. Connect the circuit as per the circuit diagram .
2. Apply the different values of resistors and capacitors and the observe the frequency .
3.Repeat the process for different combinations of resistors and capacitors.
4. Compare the theoretical and practical values of frequencies.
Result:
Experiment No: 4
Design a 4 bit Adder / Subtractor
Aim: To design a 4 bit Adder / Subtractor
Apparatus: Adder/subtractor logic trainer kit, patch cords
Theory:
In Digital Circuits, A Binary Adder-Subtractor is one which is capable of both addition
and subtraction of binary numbers in one circuit itself. The operation being performed depends
upon the binary value the control signal holds. It is one of the components of the ALU (Arithmetic
Logic Unit).This Circuit Requires prerequisite knowledge of Exor Gate, Binary Addition and
Subtraction, Full Adder.
Circuit diagram:
Truth table:
ADDITION:
Inputs Outputs
A4 A3 A2 A1 B4 B3 B2 B1 C0 S4 S3 S2 S1
1 0 0 0 0 0 1 0 0 1 0 1 0
1 0 0 0 1 0 0 0 1 0 0 0 0
0 0 1 0 1 0 0 0 0 1 0 1 0
1 0 1 0 1 1 0 1 1 0 1 1 1
SUBTRACTION:
Inputs Outputs
A4 A3 A2 A1 B4 B3 B2 B1 B0 S4 S3 S2 S1
1 0 0 0 0 0 1 0 0 0 1 1 0
1 0 0 0 1 0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 1 0 1 0
1 0 1 0 1 1 0 1 1 1 1 0 1
Procedure:
1. Connect the circuit as per circuit diagram.
2. Connect the inputs to the switches and outputs to the logic indicators.
3. Apply the different combinations of inputs and observe the outputs.
4. Apply M=0 for addition operation and M=1 for subtraction operation.
5. Note down the values of cout and sum in addition operation and difference and borrow in
subtraction operation.
Result:
Experiment No: 5
Design and realization a 4 bit gray to Binary and Binary to Gray Converter
Aim: To Design and realization a 4 bit gray to Binary and Binary to Gray Converter
Apparatus: binary to gray logic trainer kit, Patch cords
Theory:
The logical circuit which converts binary code to equivalent gray code is known as binary
to gray code converter. The gray code is a non weighted code. The successive gray code differs
in one bit position only that means it is a unit distance code. It is also referred as cyclic code. It is
not suitable for arithmetic operations. It is the most popular of the unit distance codes. It is also a
reflective code. An n-bit Gray code can be obtained by reflecting an n-1 bit code about an axis
after 2n-1 rows, and putting the MSB of 0 above the axis and the MSB of 1 below the axis.
Reflection of Gray codes is shown below.
The 4 bits binary to gray code conversion table is given below
INPUTS OUTPUTS
BINARY CODE GRAY CODE
A B C D G1 G2 G3 G4
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
Grey to Binary conversion:
INPUTS OUTPUTS
BINARY CODE GRAY CODE
A B C D G1 G2 G3 G4
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
Procedure:
1. Connect the circuit as per the circuit diagram.
2. Connect the inputs to the switch and outputs to the logic indicators.
3. Apply the different combinations of inputs and observe the outputs.
Result:
Experiment No: 6
8-bit parallel load and serial out shift register using flip-flops.
Aim: To Design and realize an 8-bit parallel load and serial out shift register using flip-
flops.
Apparatus: PISO trainer kit, patch cords
Theory:
Parallel-in/ serial-out shift registers do everything that the previous serial-in/ serial-out shift
registers do plus input data to all stages simultaneously. The parallel-in/ serial-out shift register
stores data, shifts it on a clock by clock basis, and delays it by the number of stages times the
clock period. In addition, parallel-in/ serial-out really means that we can load data in parallel
into all stages before any shifting ever begins. This is a way to convert data from
a parallel format to a serial format. By parallel format we mean that the data bits are present
simultaneously on individual wires, one for each data bit as shown below. By serial format we
mean that the data bits are presented sequentially in time on a single wire or circuit as in the
Timing Diagram:
Procedure:
1. Connect the circuit as per circuit diagram.
2. Connect the CLK to CLK I/P as shown above.
3. Connect D0,D1,D2,D3 and Shift/Load to input switches.
4. If shift/load =0 inputs are loaded into flipflops and shift/load = 1 shift operation is
performed.
5. Observe the serial output at the last flipflop.
Result:
Experiment No: 7
Synchronous and Asynchronous counter using flip-flops
Aim:
To Design and realization a Synchronous and Asynchronous counters using flip-flops
Apparatus:
counters trainer kit, patch cords
Theory:
Since we know that binary count sequences follow a pattern of octave (factor of 2)
frequency division, and that J-K flip-
capable of performing this type of frequency division, we can envision a circuit made up of
several J-K flip-flops, cascaded to produce four bits of output. The main problem facing us is
to determine how to connect these flip-flops together so that they toggle at the right times to
produce the proper binary sequence.
The Synchronous Counter, the external clock signal is connected to the clock input of
EVERY individual flip-flop within the counter so that all of the flip-flops are clocked together
simultaneously (in parallel) at the same time giving a fixed time relationship. In other words,
nal.
Asynchronous up counter:
Asynchronous up counter
Asynchronous Down counter:
Synchronous up counter:
Up Counter:
Clock Decimal Q3 Q2 Q1 Q0
Pulse No.
1st 0 0 0 0 0
2nd 1 0 0 0 1
3rd 2 0 0 1 0
4th 3 0 0 1 1
5th 4 0 1 0 0
6th 5 0 1 0 1
7th 6 0 1 1 0
8th 7 0 1 1 1
9th 8 1 0 0 0
10th 9 1 0 0 1
11th 10 1 0 1 0
12th 11 1 0 1 1
13th 12 1 1 0 0
14th 13 1 1 0 1
15th 14 1 1 1 0
th
16 15 1 1 1 1
Down counter:
Clock Decimal Q3 Q2 Q1 Q0
Pulse No.
1st 15 1 1 1 1
2nd 14 1 1 1 0
3rd 13 1 1 0 1
4th 12 1 1 0 0
5th 11 1 0 1 1
6th 10 1 0 1 0
7th 9 1 0 0 1
8th 8 1 0 0 0
9th 7 0 1 1 1
10th 6 0 1 1 0
11th 5 0 1 0 1
12th 4 0 1 0 0
13th 3 0 0 1 1
14th 2 0 0 1 0
15th 1 0 0 0 1
16th 0 0 0 0 0
Procedure:
1. Connect the circuit as per circuit diagram.
2. Connect the CLK to CLK I/P as shown above.
3. Verify the truth table as given above.
Result:
Experiment No: 8
Asynchronous counters using flip-flops
Aim:
To Design and realize Asynchronous counters using flip-flops
Apparatus:
Asynchronous counters trainer kit, Patch cords
Theory:
Asynchronous up counter:
Truth table:
Up Counter:
Clock Decimal Q3 Q2 Q1 Q0
Pulse No.
1st 0 0 0 0 0
2nd 1 0 0 0 1
3rd 2 0 0 1 0
th
4 3 0 0 1 1
5th 4 0 1 0 0
6th 5 0 1 0 1
th
7 6 0 1 1 0
th
8 7 0 1 1 1
9th 8 1 0 0 0
10th 9 1 0 0 1
11th 10 1 0 1 0
12th 11 1 0 1 1
13th 12 1 1 0 0
14th 13 1 1 0 1
15th 14 1 1 1 0
16th 15 1 1 1 1
Down counter:
Clock Decimal Q3 Q2 Q1 Q0
Pulse No.
1st 15 1 1 1 1
2nd 14 1 1 1 0
3rd 13 1 1 0 1
4th 12 1 1 0 0
5th 11 1 0 1 1
6th 10 1 0 1 0
7th 9 1 0 0 1
8th 8 1 0 0 0
9th 7 0 1 1 1
10th 6 0 1 1 0
11th 5 0 1 0 1
12th 4 0 1 0 0
13th 3 0 0 1 1
14th 2 0 0 1 0
15th 1 0 0 0 1
th
16 0 0 0 0 0
Procedure:
1. Connect the circuit as per circuit diagram.
2. Connect the CLK to CLK I/P as shown above.
3. Verify the truth table as given above.
Result:
Experiment No: 9
8x1 Multiplexer using 2x1 Multiplexer
Aim:
To Design and realization 8x1 using 2x1 mux
Apparatus:
Trainer kit, Patch cords
Theory:
This is an 8X1 MUX with inputs d0,d1,d2,d3,d4,d5,d6,d7 , Y as output and S2, S1,
S0 as selection lines. The output will depend upon the combination of S2,S1 & S0 as shown in
the truth table.
Circuit Diagram:
Truth table:
Procedure:
1. Connect the circuit as per circuit diagram.
2. Connect D0 to D7 to the input switches.
3. Connect selection line inputs to the input switches.
4. Connect the output terminal Y to the output indicator (LED).
5. Verify the truth table given above.
Result:
Experiment No: 10
Design and realization 4-bit comparator
Apparatus: MTS-COMPARATOR
PATCH CORDS
Theory:
A magnitude digital Comparator is a combinational circuit that compares two digital or binary
numbers in order to find out whether one binary number is equal, less than or greater than the
other binary number. We logically design a circuit for which we will have two inputs one for
A and other for B and have three output terminals, one for A > B condition, one for A = B
condition and one for A < B condition.
A comparator used to compare two bits is called a single bit comparator. It consists of two
inputs each for two single bit numbers and three outputs to generate less than, equal to and
greater than between two binary numbers.
A comparator used to compare two binary numbers each of two bits is called a 2-bit
Magnitude comparator. It consists of four inputs and three outputs to generate less than,
equal to and greater than between two binary numbers.
A comparator used to compare two binary numbers each of four bits is called a 4-bit
magnitude comparator. It consists of eight inputs each for two four bit numbers and three
outputs to generate less than, equal to and greater than between two binary numbers.
Pin diagram:
Observe the Truth Table. Truth Table:
A3,B3 A2,B2 A1,B1 A0,B0 A>B A<B A=B A>B A<B A=B
A3>B3 X X X X X X H L L
A3<B3 X X X X X X L H L
A3=B3 A2>B2 X X X X X H L L
A3=B3 A2<B2 X X X X X L H L
5. Connect the inputs of first stage to logic sources and output of the last gate to logic
indicator.
6. Apply various input combinations and observe output for each one.
7. Verify the truth table for each input/ output combination.
8. Repeat the process for all logic functions.
9. Switch off the ac power supply.
Result:
Experiment No: 11
Design and Realization of a sequence detector-a finite state machine
PATCH CORDS
Theory:
A sequence detector is a sequential state machine which takes an input string of bits and generates an
output 1 whenever the target sequence has been detected. In a Mealy machine, output depends on the
present state and the external input (x). Hence in the diagram, the output is written outside the states,
along with inputs. Sequence detector is of two types:
Overlapping
Non-Overlapping
In an overlapping sequence detector the last bit of one sequence becomes the first bit of next sequence.
However, in non-overlapping sequence detector the last bit of one sequence does not become the first bit
-overlapping 101 Mealy
sequence detector.
Procedure:
The state diagram of a Mealy machine for a 101 sequence detector is:
Step 2: Code Assignment
Rule 1 : States having the same next states for a given input condition should have adjacent assignments.
Rule 2: States that are the next states to a single state must be given adjacent assignments. Rule 1 given
preference over Rule 2
Step 3: Make Present State/Next State table use D-Flip Flops for design purpose.
Step 4: Draw K-maps for Dx, Dy and output (Z)
Circuit diagram:
Truth Table:
D QA QB QC QD
1 0 0 0 0
1 1 0 0 0
1 1 1 0 0
0 1 1 1 0
1 0 1 1 1
1 1 0 1 1
0 1 1 0 1
0 0 1 1 0
1 0 0 1 1
0 1 0 0 1
1 0 1 0 0
0 1 0 1 0
0 0 1 0 1
0 0 0 1 0
0 0 0 0 1
1 0 0 0 0
Procedure:
1. Connect the circuit as per the circuit diagram.
2. Connect the XNOR gate output to the D input and inputs to XNOR gate are from third
and fourth flip flop.
3. .
4. Connect the clock and clear inputs as shown in diagram.
5.
Result:
Experiment No: 13