Digital Logic Design Lab Manual
Digital Logic Design Lab Manual
M1: To provide quality education facilities for preparing professionals who match global
standards.
M2: To create good atmosphere for research and innovation by providing state of the art
laboratories.
M3: To prepare a cadre of engineers and scientists who will cater to the industrial
development and economic growth of the society and country in future.
M4: To strengthen industry- institute interactions and interactions with alumni for mutual
benefits by the exchange of knowledge, ideas and visions to promote lifelong learning.
PO1: Engineering knowledge: Apply the knowledge of basic sciences and fundamental
engineering concepts in solving engineering problems.
PO2: Problem analysis: Identify and define engineering problems, conduct experiments and
investigate to analyze and interpret data to arrive at substantial conclusions.
PO4: Conduct investigations of complex problems: Perform investigations, design and conduct
experiments, analyze and interpret the results to provide valid conclusions.
PO5: Modern tool usage: Select/ develop and apply appropriate techniques and IT tools for the
design and analysis of the systems.
PO6: The engineer and society: Give reasoning and assess societal, health, legal and cultural
issues with competency in professional engineering practice.
PO8: Ethics: An ability to apply ethical principles and commit to professional ethics and
responsibilities and norms of the engineering practice.
PO9: Individual and team work: Function effectively as an individual and as a member or leader
in diverse teams and in multi-disciplinary situations.
PO11: Project management and finance: Demonstrate apply engineering and management
principles in their own / team projects in multi-disciplinary environment.
PO12: Life-long learning: An ability to do the needs of current technological trends at electrical
industry by bridging the gap between academic and industry.
PSO1:• Apply the knowledge of electrical engineering to analyze and solve the complex problems
in electrical power and engineering with social utility.
•
PSO2:• The application of recent techniques along with modern software tools for design,
simulation and analyzing electrical systems.
•
PSO3:• Adapting to technological changes and professional and societal needs by engaging in
lifelong learning, thereby contributing to career development.
PEO2: To analyze, plan and design electrical system including modern methodologies to address
the issues in a technically sound and economically viable manner.
PEO3: To develop a skillful workforce who can practice as a team professionally and ethically in a
wide range of electrical engineering related fields.
PEO4: To prepare them for lifelong learning for successful carrier development by giving them the
state- of the-art technology in the learning process.
Course Outcomes: -
After successful completion of this course, the students will be able to demonstrate the
ability to –
➢ Construct the truth table of various logic gates and combination circuits using logic
gates.
➢ Design, test and evaluate various combinational circuits such as adders, subtractors,
multiplexers, demultiplexers, decoders etc.
1. Digital Logic Gates: Investigate logic behavior of AND, OR, NAND, NOR, EX-OR,
EX-NOR, Invert and Buffer gates, use of Universal NAND Gate.
3. Combinational circuits: design, assemble and test: adders and subtractors, comparators.
4. Design and implementation of code converters, gray code to binary and BCD to seven
segment display.
8. Shift Register: Design and investigate the operation of all type of shift registers with
parallel load.
9. Counters: Design, assemble and test various ripple and synchronous counters-decimal
counter, Binary counter with parallel load.
Do’s
➢ Conduct yourself in a responsible manner at all times in the laboratory.
➢ Dress properly during a laboratory activity.
➢ Long hair, dangling jewellery and loose or baggy clothing are a hazard in the laboratory.
➢ Observe good housekeeping practices.
➢ Replace the materials in proper place after work to keep the lab area tidy.
Don’ts
➢ Do not wander around the room, distract other students, startle other students or
interfere with the laboratory experiments of others.
➢ Do not eat food, drink beverages or chew gum in the laboratory and do not use
laboratory glassware as containers for food or beverages.
➢ Do not open any irrelevant internet sites on lab computer
➢ Do not use a flash drive on lab computers.
➢ Do not upload, delete or alter any software on the lab PC.
➢ Do not switch on the trainer kit without verifying connection.
AIM
To investigate the logic behavior of AND, OR, NOT, NAND, NOR, EX-OR gates.
APPARATUS REQUIRED
THEORY
Logic Gate
A logic gate is defined as a logic circuit with one output and two (or) more logic inputs.
The output signal occurs only for combination of input variables.
There are basically three logic gates
a. AND gate
b. OR gate
c. NOT gate
These three gates are called as fundamental gates, because these gates form building block for
most probably all digital circuits. From these fundamental gates other three gates are derived.
They are called derived gates.
a. NAND gate
Y = A.B
Y=A+B
NOT Gate
NOT gate has single input and single output. The NOT gate is also known as Inverter.
It has one input (A) & one output (Y). IC No. is 7404. Its logical equation is,
Y = A NOT B, Y = A’
INPUT OUTPUT
A Y
0 1
1 0
NAND Gate
An NAND gate has two (or) more logic inputs and single output. The combination of
NOT gate and an AND gate is called as NAND gate. The IC no. for NAND gate is 7400. The
NOT-AND operation is known as NAND operation. If all inputs are 1 then output produced is
0. NAND gate is inverted AND gate.
Its logical equation is
Y = (A. B)’
An NAND gate has two (or) more logic inputs and single output. The combination of
NOT gate and an OR gate is called as NOR gate. IC 7402 is two I/P NOR gate IC. The NOT-
OR operation is known as NOR operation. If all the inputs are 0 then the O/P is 1. NOR gate
is inverted OR gate.
Its logical equation is
Y = (A+B)’
The XOR gate has two (or) more logic inputs and single output. 7486 is two inputs
XOR gate IC. EX-OR gate is not a basic operation & can be performed using basic gates. Its
logical equation is
Y=A’B+AB’
The NAND and NOR gates are called Universal gates, because all the logic gates and
logic functions can be implemented using NAND and NOR gates.
PROCEDURE
2 Input OR Gate
NOT Gate
OBSERVATION
INPUT OUTPUT
A Y
L
H
RESULT: The logic behavior of AND, OR, NOT, NAND, NOR, EX-OR gates is verified.
2. Define IC?
AIM
To Study and Verify NAND gate as a Universal Gate.
APPARATUS REQUIRED
THEORY
Universal gate
The NAND and NOR gates are called Universal gates, because all the logic gates and
logic functions can be implemented using NAND and NOR gates.
NAND Gate as Universal gate
INPUT OUTPUT
A Y
0 1
1 0
PROCEDURE:
APPARATUS REQUIRED
THEORY
The implication of logic circuits is based on Karnaugh’s map. There are two fundamental
approaches in logic design.
i. Product of Sum method
ii. Sum of product method
The Sum of product solution results in NAND circuit, while the Product of Sum solution results
in NOR circuit corresponding to a given truth table.
The designers can select either method, usually selects the simpler circuit because it costs less
and more reliable.
m0 m1
m2 m3
𝑥̅ 𝑦̅ 𝑥̅ 𝑦
𝑥𝑦̅ 𝑥𝑦
1. Position the IC’s [7408, 7432, and 7404] properly on the solder less bread board.
2. Connect the pin 7 of all the chips to ground using patch chord provided.
3. Connect the pin 14 of all the chips to +5V supply using patch chord provided.
4. Input A signal and B signals are connected at pin no 1 and 2 of the IC 7408.
5. Input A signal is complemented by connecting pin 1 of the IC 7404.
6. The inverted input A and B signals are connected to the pin 4 and 5 of IC 7432.
7. The output (7408) pin 3 and 6 are concerted to input pin 1 and 2 of
OR gate.
8. The output pin 3 of the OR gate give the Boolean function result.
INPUT INPUT 𝑌 = 𝐴𝐵 + 𝐴′ 𝐵
A B
L L
L H
H L
H H
APPARATUS REQUIRED
THEORY
Theorem 1: The compliment of the product of two variables is equal to the sum of the
compliment of each variable. Thus according to De-Morgan’s laws or De-Morgan's theorem if
A and B are the two variables or Boolean numbers. Then accordingly,
̅̅̅̅̅
𝐴. 𝐵 = 𝐴̅ + 𝐵̅
Theorem 2:-
The compliment of the sum of two variables is equal to the product of the compliment of each
variable. Thus according to De Morgan’s theorem if A and B are the two variables then,
̅̅̅̅̅̅̅̅
𝐴 + 𝐵 = 𝐴̅. 𝐵̅
PROCEDURE
Theorem 1
INPUT INPUT ̅̅̅̅̅
𝐴. 𝐵 𝐴̅ + 𝐵̅
A B
L L
L H
H L
H H
Theorem 2
INPUT INPUT ̅̅̅̅̅̅̅̅
𝐴 +𝐵 𝐴̅. 𝐵̅
A B
L L
L H
H L
H H
1. Define K-map?
2. Define SOP?
3. Define POS?
4. What are combinational circuits?
5. If there are four variables how many cells the K-map will have?
6. Which code is used for the identification of cells?
APPARATUS REQUIRED
THEORY
Half-Adder: A combinational logic circuit that performs the addition of two data bits, A and
B, is called a half-adder. Addition will result in two output bits; one of which is the sum bit S,
and the other is the carry bit, C. The Boolean functions describing the half-adder are:
𝑆 = 𝐴⨁𝐵
𝐶 = 𝐴. 𝐵
PROCEDURE: -
1. Position the IC’s [7486, 7408] properly on the solder less bread board.
2. Connect the pin 7 of all the chips to ground using patch chord provided.
3. Connect the pin 14 of all the chips to +5V supply using patch chord provided.
4. Connect the circuit as shown and get the output of Sum and Carry separately.
5. Take input from pin no. 1&2 of IC no.7486 and take output at pin no.3.
6. Pin no.3 is connected with LED.
7. Short pin no.1 of IC no.7486 to pin no.1 of IC no.7408.
8. Similarly, short pin no.2 of IC no.7486 to pin no.2 of IC no.7408.
9. Take output at Pin no.3 of IC no.7408 and connect to LED.
PRECAUTIONS: -
APPARATUS REQUIRED
THEORY
Full Adder: The half-adder does not take the carry bit from its previous stage into account.
This carry bit from its previous stage is called carry-in bit. A combinational logic circuit that
adds two data bits, A and B, and a carry-in bit,𝐶𝑖𝑛 is called a full-adder. The Boolean functions
describing the full-adder are:
𝑆 = 𝐴 ⊕ 𝐵⨁𝐶𝑖𝑛
𝐶 = 𝐴. 𝐵 + 𝐶𝑖𝑛 (𝐴⨁𝐵)
PROCEDURE: -
1. Position the IC’s [7486, 7408, and 7432] properly on the solder less bread board.
2. Connect the pin 7 of all the chips to ground using patch chord provided.
3. Connect the pin 14 of all the chips to +5V supply using patch chord provided.
4. Connect the circuit as shown and get the output of Sum and Carry separately.
5. Make the connections as per the circuit diagram for the full adder circuit, on the trainer
kit.
6. Switch on the VCC power supply and apply the various combinations of the inputs
according to the respective truth tables.
7. Verify that the outputs are according to the expected results.
AIM
To realize half subtractor using Logic gates.
APPARATUS REQUIRED
THEORY
Half- subtractor: Subtracting a single-bit binary value B from another A (i.e., A-B) produces
a difference bit D and a borrow out bit B0. This operation is called half subtraction and the
circuit to realize it is called a half subtractor. The Boolean functions describing the half-
subtractor are:
𝐷 = 𝐴⨁𝐵
𝐵0 = 𝐴′ 𝐵
.
PROCEDURE: -
1. Position the IC’s [7408, 7404, and 7432] properly on the solder less bread board.
2. Connect the pin 7 of all the chips to ground using patch chord provided.
3. Connect the pin 14 of all the chips to +5V supply using patch chord provided.
4. Connect the circuit as shown and get the output of difference and borrow separately.
5. Take input from pin no. 1&2 of IC no.7486 and take output at pin no.3.
6. Pin no.3 is connected with LED.
7. Short pin no.1 of IC no.7486 to pin no.1 of IC no.7404 and take output at pin no.2 of
IC no 7404.
8. Short pin no.2 of IC no.7404 to pin no.1 of IC no.7408.
9. Similarly, short pin no.2 of IC no.7486 to pin no.2 of IC no.7408.
10. Take output at Pin no.3 of IC no.7408 and connect to LED.
OBSERVATION [L=logic 0, H=logic 1]
APPARATUS REQUIRED
THEORY
𝐷 = 𝐴⨁𝐵 ⊕ 𝐶
𝐵0 = 𝐴′ 𝐵 + 𝐴′ 𝐶 + 𝐵𝐶
PROCEDURE: -
1. Position the IC’s [7486, 7408, 7402 and 7432] properly on the solder less bread board.
2. Connect the pin 7 of all the chips to ground using patch chord provided.
3. Connect the pin 14 of all the chips to +5V supply using patch chord provided.
4. Connect the circuit as shown and get the output of Difference and Borrow separately.
5. Make the connections as per the circuit diagram for the full substractor circuit, on the
trainer kit.
6. Switch on the VCC power supply and apply the various combinations of the inputs
according to the respective truth tables.
7. Verify that the outputs are according to the expected results.
APPARATUS REQUIRED
SL NO. COMPONENT SPECIFICATION QUANTITY
1. XOR GATE IC 7486 1
2. BREAD BOARD - 1
3. RESISTOR 220Ω 1
4. BATTERY 9V 1
5. LED - 1
6. CONNECTING WIRE - AS PER REQUIREMENT
THEORY
The Binary to Gray code converter is a logical circuit that is used to convert the binary code
into its equivalent gray code.
i. In the Gray code, the MSB will always be the same as the 1'st bit of the given binary
number.
ii. In order to perform the 2nd bit of the gray code, we perform the exclusive-or (XOR) of
the 1'st and 2nd bit of the binary number. It means that if both the bits are different, the
result will be one else the result will be 0.
iii. In order to get the 3rd bit of the gray code, we need to perform the exclusive-or (XOR)
of the 2nd and 3rd bit of the binary number. The process remains the same for the 4th bit
of the Gray code.
G3 = B3
G2 = B3 ⊕ B2
G1 = B2 ⊕ B1
G0 = B1 ⊕ B0
PROCEDURE:
PRECAUTIONS:
APPARATUS REQUIRED
THEORY
The Gray to Binary code converter is a logical circuit that is used to convert the gray code into
its equivalent binary code.
Just like Binary to Gray code conversion; it is also a very simple process. There are the
following steps used to convert the Gray code into Binary.
i. Just like binary to gray, in gray to binary, the 1st bit of the binary number is similar to
the MSB of the Gray code.
ii. The 2nd bit of the binary number is the same as the 1st bit of the binary number when
the 2nd bit of the Gray code is 0; otherwise, the 2nd bit is altered bit of the 1st bit of binary
number. It means if the 1st bit of the binary is 1, then the 2nd bit is 0, and if it is 0, then
the 2nd bit be 1.
iii. The 2nd step continues for all the bits of the binary number.
TRUTH TABLE
B3 = G3
B2 = G3 ⊕ G2
B1 = G3 ⊕ G2 ⊕ G1
B0 = G3 ⊕ G2 ⊕ G1 ⊕ G0
PRECAUTIONS:
AIM: -
To implementation and verify of truth table of 4x1 Multiplexer and 1x4 Demultiplexer.
APPARATUS REQUIRED: -
THEORY: -
MULTIPLEXER:
Multiplexer generally means many into one. A multiplexer is a circuit with many inputs
but only one output. By applying control signals we can steer any input to the output. The
circuit has n-input signal, control signal (m) & one output signal, where 2𝑛 = 𝑚. One of the
popular multiplexers is the 16 to 1 multiplexer, which has 16 input bits, 4 control bits & 1
output bit.
4x1 Multiplexer
The 4x1 Multiplexer has four input lines I0, I1, I2 and I3 and one output line Y. The
selection of a particular input is controlled by set of selection lines, S1 and S0.
Demultiplexer means generally one into many. A demultiplexer is a logic circuit with one input
and many outputs. By applying control signals, we can steer the input signal to one of the output
lines. The circuit has one input signal, m control signal and n output signals, where2𝑛 = 𝑚. It
functions as an electronic switch to route an incoming data signal to one of several outputs.
1x4 Demultiplexer
The 1x4 Demultiplexer has one input I and four outputs Y0, Y1, Y2 and Y3.
TRUTH TABLE
Input Selection line Output
I S1 S0 Y3 Y2 Y1 Y0
I 0 0 0 0 0 I
I 0 1 0 0 I 0
I 1 0 0 I 0 0
I 1 1 I 0 0 0
PROCEDURE: -
PRECAUTIONS: -
4x1 Multiplexer
Input line Selection line Output
I0 I1 I2 I3 S1 S0 Y
H L L H L L
L L H H L H
H H L L H L
L H L H H H
1x4 Demultiplexer
Input Selection line Output
I S1 S0 Y3 Y2 Y1 Y0
H L L
H L H
H H L
H H H
RESULT: - Hence, the truth table of 4x1 Multiplexer and 1x4 Demultiplexer are verified and
found ok.
AIM: -
To Implement and verify the truth table of 3:8 decoder circuit.
APPARATUS REQUIRED: -
SL NO. COMPONENT SPECIFICATION QUANTITY
1 3:8 DECODER IC 74138 1
2 BREAD BOARD - 1
3 RESISTOR 220Ω 1
4 BATTERY 9V 1
5 LED - 1
6 CONNECTING WIRE - AS PER REQUIREMENT
THEORY: -
3:8 DECODER: A decoder is a combinational circuit that converts binary information from n
line to a maximum of 2𝑛 unique output lines. The name decoder is also used in conjunction
with some code converters such as BCD to seven segment decoders.
RESULT: -
PRECAUTIONS: -
1. Make the connections according to the IC pin diagram.
2. The connections should be tight.
3. The VCC and ground should be applied carefully at the specified pin only.
4. Swich off supply after completing the experiment.
APPARATUS REQUIRED: -
THEORY: -
RS FLIP-FLOP: There are two inputs to the flip-flop defined as R and S. When I/Ps R = 0
and S = 0 then O/P remains unchanged. When I/Ps R = 0 and S = 1 the flip-flop is switches to
the stable state where O/P is 1 i.e. SET. The I/P condition is R = 1 and S = 0 the flip-flop is
switched to the stable state where O/P is 0 i.e. RESET. The I/P condition is R = 1 and S = 1 the
flip-flop is switched to the stable state where O/P is forbidden.
JK FLIP-FLOP: For purpose of counting, the JK flip-flop is the ideal element to use. The
variable J and K are called control I/Ps because they determine what the flip- flop does when a
positive edge arrives. When J and K are both 0s, both AND gates are disabled and Q retains its
last value.
D FLIP –FLOP: This kind of flip flop prevents the value of D from reaching the Q output until
clock pulses occur. When the clock is low, both AND gates are disabled D can change value
without affecting the value of Q. On the other hand, when the clock is high, both AND gates
are enabled. In this case, Q is forced to equal the value of D. When the clock again goes low,
Q retains or stores the last value of D. a D flip flop is a bistable circuit whose D input is
transferred to the output after a clock pulse is received.
T FLIP-FLOP: The T or "toggle" flip-flop changes its output on each clock edge, giving an
output which is half the frequency of the signal to the T input. It is useful for constructing
binary counters, frequency dividers, and general binary addition devices. It can be made from
a J-K flip-flop by tying both of its inputs high.
RS FLIP-FLOP
D FLIP –FLOP
JK FLIP-FLOP
T FLIP-FLOP
IC 7474 or mostly known as IC 74LS74 is a dual D Flip Flop positive edge-triggered IC. It has
two independent D Flip Flops with complementary outputs. It has D input and Q output. The
data in the D input may be changed during the high or low clock but it does not affect the output
and the delay times also do not affect. The IC 7474 can be operated up to 7V voltage and 0 to
+70 degrees centigrade temperature. The main features of the IC 74LS74 are, it provides very
fast switching, low propagation delay, large operating mode, etc.
INPUTS OUTPUTS
PR CLR CLK D Q ̅
Q
L H X X H L
H L X X L H
L L X X H H
H H ↑ H H L
H H ↑ L L H
H H L X 𝑄0 ̅̅̅
𝑄0
H-High logic level, X-Either LOW or HIGH logic level, L-LOW logic level, ↑-Positive going
transition of the clock
IC 7474 Truth Table
The IC 7476 commonly known as IC 74LS76 is a dual JK flip IC with Set and Clear Input. The
Clock, Clear inputs are active low inputs. During the High-Low Clock Transition, input data is
transferred to the output. It is also a 16 pin IC. The IC 7476 can be operated from 4.75 to 5.25V
and 0 to +70 degrees centigrade temperature. It works with standard TTL voltage and provides
a very fast switching speed.
INPUTS OUTPUTS
PR CLR CLK J K Q ̅
Q
L H X X X H L
H L X X X L H
L L X X X H H
H H ↑ L L 𝑄0 ̅̅̅
𝑄0
H H ↑ H L H L
H H ↑ L H L H
H H ↑ H H Toggle
H-High logic level, X-Either LOW or HIGH logic level, L-LOW logic level, ↑-Positive going
transition of the clock
IC 7476 Truth Table
PROCEDURE: -
RESULT: -
PRECAUTIONS: -
APPARATUS REQUIRED: -
THEORY: -
Shift registers are a type of sequential logic circuit, mainly for storage of digital data. They are
a group of flip-flops connected in a chain so that the output from one flip-flop becomes the
input of the next flip-flop. All the flip-flops are driven by a common clock, and all are set or
reset simultaneously.
The serial in/serial out shift register accepts data serially – that is, one bit at a time on a single
line. It produces the stored information on its output also in serial form.
The serial in/parallel out shift register accepts data serially – that is, one bit at a time on a single
line. It produces the stored information on its output in parallel form.
The parallel in/serial out shift register accepts data in parallel. It produces the stored
information on its output also in serial form.
The parallel in/parallel out shift register accepts data in parallel. It produces the stored
information on its output in parallel form.
Shift Registers using IC 7495
IC 7495 is a shift register IC. It is also known as IC74LS95. It is a 4-bit device and having both
serial and parallel synchronous operating modes. The main application of this IC 7495 is
encryption and decryption in digital circuits.
SIPO
Clock Serial 𝐐𝑨 𝐐𝑩 𝐐𝑪 𝐐𝑫
I/P
1 0 0 X X X
2 1 1 0 X X
3 1 1 1 0 X
4 1 1 1 1 0
Clock Serial 𝐐𝑨 𝐐𝑩 𝐐𝑪 𝐐𝑫
I/P
1 d0 = 0 0 X X X
2 d1 = 1 1 0 X X
3 d2 = 1 1 1 0 X
4 d3 = 1 1 1 1 d0 = 0
5 X X 1 1 d1 = 1
6 X X X 1 d2 = 1
7 X X X X d3 = 1
PISO
PIPO
PROCEDURE:
Serial In Parallel Out (SIPO): -
1. Connections are made as per circuit diagram.
2. Keep the mode control in logic 0.
3. Apply the data at serial input.
4. Apply one clock pulse at clock 1 observe this data at QA .
5. Apply the next data at serial input.
6. Apply one clock pulse at clock 2, observe that the data on QA will shift to QB and the
new data applied will appear at QA .
PRECAUTIONS: -
APPARATUS REQUIRED: -
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 state simultaneously 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. Asynchronous counters are easy and simple to construct.
Design:
MOD-8 UP COUNTER
PRECAUTIONS: -
To design and test 3-bit binary synchronous counter using flip-flop IC 7476.
APPARATUS REQUIRED: -
THEORY: -
A counter in which each flip-flop is triggered by the output goes to previous flipflop. 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.
Design:
MOD-8 UP COUNTER
PROCEDURE: -
PRECAUTIONS: -
AIM: - To write a program in VHDL for implementing the digital logic gates-AND, OR, NOT,
NAND, NOR, XOR, XNOR and to verify the functionality.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity logic_gates is
port(a,b:in std_logic;
c,d,e,f,g,h,i:out std_logic);
end logic_gates;
architecture dataflow of logic_gates is
begin
c<=a and b;
d<=a or b;
e<=not b;
f<=a xor b;
g<=a nand b;
h<=a xnor b;
i<=a nor b;
end dataflow;
TRUTH TABLE
Inputs Outputs
a b c D e F g h i
0 0 0 0 1 0 1 1 1
0 1 0 1 0 1 1 0 0
1 0 0 1 1 1 1 0 0
1 1 1 1 0 0 0 1 0
OBSERVATION
Inputs Outputs
Timing (ns) a b c d E f g h i
0-100 0 0 0 0 1 0 1 1 1
100-200 0 1 0 1 0 1 1 0 0
200-300 1 0 0 1 1 1 1 0 0
300-400 1 1 1 1 0 0 0 1 0
CONCLUSION: - Hence all the logic gates are implemented in VHDL and their functionality
is verified.
AIM: - To write a program in VHDL for implementing NAND gate as universal gate and to
verify the functionality.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity nand_uni_gate is
port(a,b:in std_logic;
y_not,y_and,y_or,y_xor,y_nor:out std_logic);
end nand_uni_gate;
architecture nand_uni_gate_arch of nand_uni_gate is
begin
y_not<=a nand a;
y_and<=(a nand b) nand (a nand b);
y_or<=(a nand a) nand (b nand b);
y_nor<=((a nand a) nand (b nand b)) nand ((a nand a) nand (b nand b));
y_xor<=(a nand (a nand b)) nand (b nand (a nand b));
end nand_uni_gate_arch;
TRUTH TABLE
Inputs Outputs
A b y_not y_and y_or y_nor y_xor
0 0 1 0 0 1 0
0 1 1 0 1 0 1
1 0 0 0 1 0 1
1 1 0 1 1 0 0
OBSERVATION
Inputs Outputs
Timing (ns) a B y_not y_and y_or y_nor y_xor
0-100 0 0 1 0 0 1 0
100-200 0 1 1 0 1 0 1
200-300 1 0 0 0 1 0 1
300-400 1 1 0 1 1 0 0
CONCLUSION: - Hence NAND gate as universal gate is implemented in VHDL and the
functionality is verified.
AIM: - To write a program in VHDL for implementing Demorgan’s theorem and to verify
the functionality.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity Demorgan_ckt is
port(a,b:in std_logic;
and_not,not_or,or_not,not_and:out std_logic);
end Demorgan_ckt;
architecture Demorgan_arch of Demorgan_ckt is
begin
and_not<=not(a and b);
not_or<=(not a) or (not b);
or_not<=not(a or b);
not_and<=(not a) and (not b);
end Demorgan_arch;
TRUTH TABLE
Inputs Outputs
a b and_not not_or or_not not_and
0 0 1 1 1 1
0 1 1 1 0 0
1 0 1 1 0 0
1 1 0 0 0 0
OBSERVATION
Inputs Outputs
Timing (ns) A B and_not not_or or_not not_and
0-100 0 0 1 1 1 1
100-200 0 1 1 1 0 0
200-300 1 0 1 1 0 0
300-400 1 1 0 0 0 0
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity boolean_function is
port(a,b:in std_logic;
y:out std_logic);
end boolean_function;
architecture boolean_function _arch of boolean_function is
begin
y<=(a and b) or ((not a) and b);
end boolean_function _arch;
TRUTH TABLE
Inputs Output
a b y
0 0 0
0 1 1
1 0 0
1 1 1
OBSERVATION
Inputs Output
Timing (ns) a b y
0-100 0 0 0
100-200 0 1 1
200-300 1 0 0
300-400 1 1 1
CONCLUSION: - Hence the given Boolean function is implemented in VHDL and the
functionality is verified.
AIM: - To write a program in VHDL for implementing the half adder and to verify the
functionality.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity half_adder is
port(a,b: in std_logic;
s,c: out std_logic);
end half_adder;
architecture dataflow of half_adder is
begin
s<= a xor b;
c<= a and b;
end dataflow;
TRUTH TABLE
Inputs Outputs
a b s c
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
SIMULATION WAVEFORM
Inputs Outputs
Timing (ns) a b s c
0-100 0 0 0 0
100-200 0 1 1 0
200-300 1 0 1 0
300-400 1 1 0 1
CONCLUSION: - Hence the half adder is implemented in VHDL and the functionality is
verified.
AIM: - To write a program in VHDL for implementing the full adder and to verify the
functionality.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity full_adder is
port(x,y,z: in std_logic;
s,c: out std_logic);
end full_adder;
architecture dataflow of full_adder is
begin
s<= (x xor y)xor z;
c<= (x and y) or (y and z) or (z and x);
end dataflow;
TRUTH TABLE
Inputs Outputs
x Y z s c
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
SIMULATION WAVEFORM
Inputs Outputs
Timing (ns) x y z s c
0-100 0 0 1 1 0
100-200 0 1 1 0 1
200-300 1 0 1 0 1
300-400 1 1 1 1 1
CONCLUSION: - Hence the full adder is implemented in VHDL and the functionality is
verified.
AIM: - To write a program in VHDL for implementing the half subtractor and to verify the
functionality.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity half_subtractor is
port(x,y: in std_logic;
d,b: out std_logic);
end half_subtractor;
architecture dataflow of half_subtractor is
begin
d<= x xor y;
b<= (not x) and y;
end dataflow;
TRUTH TABLE
Inputs Outputs
x y d B
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
OBSERVATION
Inputs Outputs
Timing (ns) x y d b
0-100 0 0 0 0
100-200 0 1 1 1
200-300 1 0 1 0
300-400 1 1 0 0
CONCLUSION: - Hence the half subtractor is implemented in VHDL and the functionality
is verified.
AIM: - To write a program in VHDL for implementing the full subtractor and to verify the
functionality.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity full_subtractor is
port(x,y,z: in std_logic;
d,b: out std_logic);
end full_subtractor;
architecture dataflow of full_subtractor is
begin
d<= (x xor y) xor z;
b<= ((not x) and y) or ((not x) and z) or (y and z);
end dataflow;
TRUTH TABLE
Inputs Outputs
x Y z d b
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
OBSERVATION
Inputs Outputs
Timing (ns) x Y z d b
0-100 0 1 0 1 1
100-200 0 1 1 0 1
200-300 1 0 1 0 0
300-400 1 1 1 1 1
CONCLUSION: - Hence the full subtractor is implemented in VHDL and the functionality is
verified.
AIM: - To write a program in VHDL for implementing the two bit comparator and to verify
the functionality.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity comparator_2bit is
port(a:in std_logic_vector(1 downto 0);
b:in std_logic_vector(1 downto 0);
a_equal_b:out std_logic;
a_greater_b:out std_logic;
a_less_b:out std_logic);
end comparator_2bit;
architecture comparator_2bit_arch of comparator_2bit is
begin
a_equal_b<='1' when (a=b) else
'0';
a_greater_b<='1' when (a>b) else
'0';
a_less_b<='1' when (a<b) else
'0';
end comparator_2bit_arch;
Inputs Outputs
a(1) a(0) b(1) b(0) a_greater_b a_equal_b a_less_b
0 0 0 0 0 1 0
0 0 0 1 0 0 1
0 0 1 0 0 0 1
0 0 1 1 0 0 1
0 1 0 0 1 0 0
0 1 0 1 0 1 0
0 1 1 0 0 0 1
0 1 1 1 0 0 1
1 0 0 0 1 0 0
1 0 0 1 1 0 0
1 0 1 0 0 1 0
1 0 1 1 0 0 1
1 1 0 0 1 0 0
1 1 0 1 1 0 0
1 1 1 0 1 0 0
1 1 1 1 0 1 0
SIMULATION WAVEFORM
Inputs Outputs
Timing(ns) a(1) a(0) b(1) b(0) a_greater_b a_equal_b a_less_b
0-100 0 1 0 0 1 0 0
100-200 0 1 0 1 0 1 0
200-300 1 0 0 1 1 0 0
300-400 0 1 1 1 0 0 1
CONCLUSION: - Hence the two bit comparator is implemented in VHDL and the
functionality is verified.
COMPONENT OR2: -
library ieee;
use ieee.std_logic_1164.all;
entity or2 is
port(a,b:in std_logic;
c:out std_logic);
end or2;
architecture dataflow of or2 is
begin
c<=a or b;
end dataflow;
COMPONENT HALF ADDER: -
library ieee;
use ieee.std_logic_1164.all;
entity half_adder is
port(a,b: in std_logic;
s,c: out std_logic);
end half_adder;
architecture dataflow of half_adder is
begin
s<= a xor b;
c<= a and b;
end dataflow;
TOP MODULE: -
library ieee;
use ieee.std_logic_1164.all;
entity fulladder_halfadder is
port(x,y,z:in std_logic;
TRUTH TABLE
Inputs Outputs
x y z s c
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
AIM: -To write a program in VHDL for implementing binary to gray code converter and to
verify the functionality.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
entity binary2gray is
port(b:in std_logic_vector(3 downto 0);
g:out std_logic_vector(3 downto 0));
end binary2gray;
architecture behavioral of binary2gray is
begin
g(3)<=b(3);
g(2)<=b(3) xor b(2);
g(1)<=b(2) xor b(1);
g(0)<=b(1) xor b(0);
end behavioral;
TRUTH TABLE
Binary code Gray code
b(3) b(2) b(1) b(0) g(3) g(2) g(1) g(0)
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 0 1 1 0 0 0
OBSERVATION
CONCLUSION: - Hence binary to gray code converter is implemented in VHDL and the
functionality is verified.
AIM: -To write a program in VHDL for implementing gray to binary code converter and to
verify the functionality.
PROGRAM: -
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
entity gray_2_binary is
port(g:in std_logic_vector(3 downto 0);
b:out std_logic_vector(3 downto 0));
end gray_2_binary;
architecture gate_level of gray_2_binary is
begin
b(3)<=g(3);
b(2)<=g(3) xor g(2);
b(1)<=g(3) xor g(2) xor g(1);
b(0)<=g(3) xor g(2) xor g(1) xor g(0);
end gate_level;
TRUTH TABLE
OBSERVATION
CONCLUSION: - Hence gray to binary code converter is implemented in VHDL and the
functionality is verified.
SIMULATION WAVEFORM
CONCLUSION: - Hence BCD to seven segment display is implemented in VHDL and the
functionality is verified.
OBSERVATION
Selection line Input line Output
S(1) S(0) I(3) I(2) I(1) I(0) Y
0 0 0 1 0 1 1
0 1 0 0 0 1 0
1 0 0 0 0 1 0
1 1 1 0 0 1 1
CONCLUSION: - Hence the 4x1 multiplexer is implemented in VHDL and the functionality
is verified.
AIM: -To write a code in VHDL for implementing the 1x4 demultiplexer and to observe the
waveforms.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity demux1_4 is
port(I:in std_logic;
S:in std_logic_vector(1 downto 0);
Y:out std_logic_vector(3 downto 0));
end demux1_4;
architecture arch_demux of demux1_4 is
begin
process(I,S)
begin
if(S<="00")then
Y(3)<='0';
Y(2)<='0';
Y(1)<='0';
Y(0)<=I;
elsif(S<="01")then
Y(3)<='0';
Y(2)<='0';
Y(1)<=I;
Y(0)<='0';
elsif(S<="10")then
Y(3)<='0';
Y(2)<=I;
Y(1)<='0';
Y(0)<='0';
else
Y(3)<=I;
Y(2)<='0';
Y(1)<='0';
Y(0)<='0';
end if;
end process;
end arch_demux;
SIMULATION WAVEFORM
SIMULATION WAVEFORM
OBSERVATION
Inputs Outputs
Timing (ns) EN A(3) A(2) A(1) A(0) B(1) B(0)
0-100 1 0 0 0 1 0 0
100-200 1 0 0 1 0 0 1
200-300 1 0 1 0 0 1 0
300-400 1 1 0 0 0 1 1
TRUTH TABLE
Present State Input Next State
(𝑸𝒏 ) D (𝑸𝒏+𝟏 )
0 0 0
0 1 1
1 0 0
1 1 0
OBSERVATION
Timing(ns) Present State Timing(ns) Input Timing(ns) Next State
(𝑸𝒏 ) D (𝑸𝒏+𝟏 )
100-200 0 100-200 0 200-300 0
200-300 0 200-300 0 300-400 0
300-400 0 300-400 1 400-500 1
400-500 1 400-500 1 500-600 1
500-600 1 500-600 0 600-700 0
SIMULATION WAVEFORM
AIM: -To write a code in VHDL for implementing the 4 bit up counter and to observe the
waveforms.
PROGRAM: -
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity upcounter is
port(clock,CLR:in std_logic;
Q:out std_logic_vector(3 downto 0));
end upcounter;
architecture behavioral of upcounter is
signal tmp:std_logic_vector(3 downto 0);
begin
process(clock,CLR)
begin
if(CLR='1')then
tmp<="0000";
elsif(clock='1' and clock'event)then
tmp<=tmp+'1';
end if;
end process;
Q<=tmp;
end behavioral;
SIMULATION WAVEFORM
IC 7404 or IC 74LS04 is a logic gate IC. It consists of six NOT Gates. We know that the
NOT gate also called inverters because of it does the complements of the input. When we apply
0 or low signal to the input it gives 1 or high signal in output.
The IC 7404 consists of fourteen pins each pin are shown below.
Application of IC 7404:
1. IC 7404 is mostly used for digital electronics projects.
2. They are also used in some electronic devices.
3. They are also used in Space instruments.
The IC 7408 has total fourteen pins including ground and VCC. The simple pin diagram is
shown below.
Application of IC 7408:
1. IC 7408 is used for digital electronics projects.
2. Used in some electronics devices.
IC 7432 is a logic gate IC which consist of four OR Gates. The OR gate performs logical OR
operation. The OR gates come in form of DIP package ICs. Each gate has three terminal two
inputs and one output. The ICs are made by CMOS, TTL technology.
Pin Diagram of IC 7432:
The IC 7432 has fourteen pins like other logic gates ICs. The pin diagram is shown below.
Application of IC 7432:
1. IC 7432 are used in digital electronics projects.
IC 7400 is fourteen pin Logic Gate IC. The IC 7400 consist of four NAND Gates. The NAND
Gate is also called Universal Gate. The NAND gate has a total of three terminals, two inputs
terminals, and one output terminal. All NAND Gates are independent. IC 7400 is also called
Quad 2-input NAND Gate IC.
The IC 7400 has fourteen pins including VCC and ground pins. The simple pin diagram is shown
below,
Application of IC 7400
1. NAND gate is a universal gate so it can be used to make others gates like NOT, AND gates
etc.
2. They are used in digital electronics projects.
Pin no. 1(A4), 3(A3), 8(A2), 10(A1) are subjected to give first 4-bit numbers as input 1.
Pin no. 16(B4), 4(B3), 7(B2), 11(B1) are subjected to give the second 4-bit number as input
2.
Pin no. 15(S4), 2(S3), 6(S2), 9(S1) are the output pins to collect the data after addition.
This truth table shows the two 4-bit numbers as input and 4-bit output numbers with output carry.
IC 7483 can operate correctly with 4.75 to 5V DC. It can operate properly at 0 to 70 degrees
celcius temperature.
IC 7483 Applications
IC 7483 IC used in digital display driver circuits, counter circuits, calculator circuits, matrix
keyboards, etc.
IC 74138 is a Logical Decoder IC. It also has a demultiplexing facility. The IC 74138 is
available in the market with the name of 74LS138. It is a 3 to 8 decoder IC. The internal circuit
of this IC is made of high-speed Schottky barrier diode.
1. The pin no. 8 and 16 are the ground and VCC respectively for the power input.
2. There are a total of three input pins (pin no. 1, 2, 3). They are denoted by A0 , A1 , A2 . So, the
IC 74LS138 can take three binary input signals.
3. There are three enable input pins E1, E2 andE3 , (pin no. 4, 5, 6). E1 andE2 are the active
LOW pins that mean when low signals are applied to those pins, they will be active.
IC 74138 Applications
IC 74147 is a digital encoder IC that encodes 9 inputs lines into 4 output lines. It is also known
as the Decimal to BCD priority encoder. The priority encoder term is used because it provides
encoding for highest order data lines as a first priority. It is made up using Transistor-Transistor
Logic (TTL) technology. It is a 10 to 4 encoder IC.
The general specification of this IC are,
• It operates at 4.5V to 5.5 DC voltage.
• It delivers output current from low 70µA to high 8mA
• It operates at the temperature from -55℃ to 70℃
• Logic Case packaging type: DIP
• Mounting Type: Through Hole
We have four pins to give BCD inputs so we can display from 0 to 15 numbers but we have
need two seven segment display. In the below circuit diagram one seven segment display is
used so here 0 to 9 numbers can be shown.
INPUTS OUTPUTS
Decimal
Number
show in
LT RBO A3 A2 A1 A0 a b c d e f g display
0 0 0 0 0 0 1 1 1 1 1 1 0 0
0 0 0 0 0 1 0 1 1 0 0 0 0 1
0 0 0 0 1 0 1 1 0 1 1 0 1 2
0 0 0 0 1 1 1 1 1 1 0 0 1 3
0 0 0 1 0 0 0 1 1 0 0 1 1 4
0 0 0 1 0 1 1 0 1 1 0 1 1 5
0 0 0 1 1 0 1 0 1 1 1 1 1 6
0 0 0 1 1 1 1 1 1 0 0 0 0 7
0 0 1 0 0 0 1 1 1 1 1 1 1 8
0 0 1 0 0 1 1 1 1 1 0 1 1 9
The IC 7473 or mostly known as 74LS73 is a dual JK flip Flop logic gate IC. It is a negative
edge-triggered IC. It has two independent JK Flip Flops. They have complementary outputs.
These Flip Flops are negative edge triggered. It is also referred to as a JK Master Slave Flip
Flop. During the positive transition of the clock input, the data got transferred from the J and
K input to the master while during the negative transition the data is transferred from the master
to slave. So you may understand the data first transferred from the J and K input to master then
it transfer to the slave.
Now, let's see the features of the IC 7473
1. It has two J-K Master-Slave Flip Flop
2. It supports wide operating conditions and a large operating voltage range.
3. The output of the IC 7473 is directly CMOS, NMOS, and TTL Logic.
The IC 74LS73 can be operated from 0 degrees to 70 degrees centigrade temperature. And
IC 7474 or mostly known as IC 74LS74 is a dual D Flip Flop positive edge-triggered IC. It has
two independent D Flip Flops with complementary outputs. It has D input and Q output. The
data in the D input may be changed during the high or low clock but it does not affect the output
and the delay times also do not affect. The IC 7474 can be operated up to 7V voltage and 0 to
+70 degrees centigrade temperature. The main features of the IC 74LS74 are, it provides very
fast switching, low propagation delay, large operating mode, etc.
IC 7474 truth table
The truth table of IC 7474 is given below
INPUTS OUTPUTS
PR CLR CLK D Q ̅
Q
L H X X H L
H L X X L H
L L X X H H
H H ↑ H H L
H H ↑ L L H
H H L X 𝑄0 ̅̅̅
𝑄0
H-High logic level, X-Either LOW or HIGH logic level, L-LOW logic level, ↑-Positive going
transition of the clock IC 7474 Truth Table
The IC 7475 mostly known as 74HC75 is a 16 pin IC that contains four independent and
transparent D latches. You will be seen in the pin diagram the two latches have a common
enable which means the first two latches have the same enable and the second two latches have
the same enable. Among the different inputs, the D and clock inputs are synchronous inputs
whereas Set and Reset inputs are asynchronous inputs. The main features of the IC 7475 are, it
has 4-bit bistable latches, low operating voltage ranges, and wide operating conditions. It can
be operated from 4.75 to 5.25V voltage ranges and 0 to +70 degree centigrade temperature.
The IC 7476 commonly known as IC 74LS76 is a dual JK flip IC with Set and Clear Input. The
Clock, Clear inputs are active low inputs. During the High-Low Clock Transition, input data is
transferred to the output. It is also a 16 pin IC. The IC 7476 can be operated from 4.75 to 5.25V
and 0 to +70 degrees centigrade temperature. It works with standard TTL voltage and provides
a very fast switching speed.
IC 7476 truth table
The truth table of IC 7476 is given below
INPUTS OUTPUTS
PR CLR CLK J K Q ̅
Q
L H X X X H L
H L X X X L H
L L X X X H H
H H ↑ L L 𝑄0 ̅̅̅
𝑄0
H H ↑ H L H L
H H ↑ L H L H
H H ↑ H H Toggle
H-High logic level, X-Either LOW or HIGH logic level, L-LOW logic level, ↑-Positive going
transition of the clock
IC 7476 Truth Table
The pin diagram of IC 7490 is shown below. Here the actual IC name is 74LS90.
The internal circuit of IC 7490 is shown below. It consists of four numbers of Master-Slave
JK flip-flops that are internally connected.
The first flip-flop is independent and is driven by the CLKA pin. Another three flip-flops are
connected to the CLKB pin.
IC 7490 Applications
1. Mainly, IC 7490 is used in the digital counter circuits.
2. IC 7490 also used in digital timers and clocks.
3. IC 7490 is used in automatic controller circuits.
The left and right shifts are operated by separate clocks. The R-shift is operated by clock 1 and
the left shift is operated by clock 2. You can also see the mode control terminal is connected to
the AND gate which is also connected to the Clock 2 terminal. The four outputs have come
from four RS Flip Flop Circuits. You can see, the mode control terminal is connected through
the clamp diodes. These clamp diodes helped to limit the high-speed termination effect. Here,
all the shifts and parallel loads are synchronous.
IC 7495 Truth Table
The functional table or truth table of IC 7495 is shown below.
Pin no.2: The pin 2 is called Trigger. It is connected to the inverting terminal of the second
OpAmp or Comparator. As the non-inverting terminal of the second comparator is connected
to the 1/3Vcc point so if we decrease the voltage of the trigger pin below the 1/3 Vcc then the
output of the comparator will be high and the circuit will be triggered.
Usually, we connect the trigger pin with the VCC and when we want to change the current state
of the comparator, we should decrease the voltage of the trigger pin.
Pin no.3: The Pin 3 is called output. The pin 3 is to be connected to the load that means the IC
can drive the load through the output pin. The IC can deliver up to 200mA of current through
thispin.
Pin no.5: The pin no.5 is directly connected to the inverting terminal of the first comparator.
This pin is used to control the input voltage of the first comparator by applying external
voltage.
Pin no.6: As the inverting terminal of the first comparator is connected to the 2/3 Vcc point
so when the voltage of the non-inverting terminal is greater than2/3 Vcc the output of the first
comparator will be high. The pin no.6 or threshold pin is used to give the threshold voltage
which is greater than 2/3 Vcc.
Actually, the pin no.2 or Trigger and pin no.6 or Threshold pin are used to control the output
Pin no.7: The pin no.7 is called discharge pin. It is connected to the collector pin of the
transistor.
Pin no.8: The pin no.8 or Vcc is used to give power supply to the IC555. The voltage from
4.5V to 15V can be given to the IC555.
You can see in the below figure the internal circuit has no. of blocks. The first block is the
voltage divider circuit. The voltage divider circuit is made by three five
kiloOhm resistors connected in series. The next block is comparators. Here the comparator
using OpAmp is used. There are two comparators in the circuit. The next block is the RS
Flip-flop circuit.
The outputs of the comparators are given to the flip-flop circuit. Then the output of the flip-
flop circuit is going to the output inverter circuit. The function of the inverter circuit is that it
inverse the output of the flip-flop that means if the output of the flip-flop is high then the
output of the inverter will be low. The pin no.3 or output pin of the IC is connected to the
output of the inverter circuit. A discharge circuit using NPN transistor also connected to the
output of the flip-flop circuit.