EC Lab4 202211008 Merged
EC Lab4 202211008 Merged
1
Certificate
2
List of Experiments
3
Experiment 1
Components Required:-
•
Breadboard
•
IC
•
LED
•
Wires
•
Voltage source (+5V)
4
Theory:-
:- AND Gate:-
NAND Gate:-
A NAND gate (“not AND gate”) is a logic gate that
produces a low output (0) only if all its inputs are
true,and high output (1) otherwise. Hence the NAND
gate is the inverse of an AND gate, and its circuit is
produced by connecting an AND gate to a NOT gate.
5
NOT Gate:-
A NOT gate, often called an inverter, is a nice digital
logic gate to start with because it has only a single
input with simple behavior. A NOT gate performs
logical negation on its input. In other words, if the
input is true, then the output will be false. Similarly,
afalse input results in a true output.
NOR Gate:-
A NOR gate (“not OR gate”) is a logic gate that
produces a high output (1) only if all its inputs are
false, and low output (0) otherwise. Hence the NOR
gate is the inverse of an OR gate, and its circuit is
produced by connecting an OR gate to a NOT gate.
OR Gate:-
An OR gate is a logic gate that performs logical OR
operation. A logical OR operation has a high output
(1) if one or both the inputs to the gate are high (1).
Ifneither input is high, a low output (0) results.
6
XOR Gate:-
Observation:-
Nand Gate:-
Truth table:
A B NAND
0 0 1
0 1 1
1 0 1
1 1 0
7
NOT Gate:-
Truth table:
A NOT
0 1
1 0
8
AND Gate:-
Truth table:
A B AND
0 0 0
0 1 0
1 0 0
1 1 1
9
XOR Gate:-
Truth table:
A B XOR
0 0 0
0 1 1
1 0 1
1 1 0
10
OR Gate:-
Truth table:
A B OR
0 0 1
0 1 1
1 0 1
1 1 0
11
NOR Gate:-
Truth table:
A B NOR
0 0 1
0 1 0
1 0 0
1 1 0
12
Conclusion:-
We've double checked the truth table, for all types of logic gates,
such as NAND, NOT ,AND, XOR, NOR and OR gates.
*-*-*-*-*
13
Indian Institute of Information Technology,
Vadodara International Campus Diu IIITV-
ICD
Name:Ayush kumar
Roll: 202211008
Branch: CSE
Batch: 2022
Subject: EC261
Session: 2022-23
Certificate
This is to certify that Mr. Ayush Kumar of B-Tech batch 2022
Semester 3 Enrollment No. 202211008 Branch CSE hasbeen
found satisfactory in the continuous internal evaluation of the
laboratory, practical and term work in the subject EC261 for
the academic year 2022– 2023.
Aim:
(i) Make the different basic logic gates using the NAND gate.
Components required:
Breadboard, IC, LED, wires,voltage source(+5V)
Theory:
A logic gate is an idealized or physical device implementing a Boolean function,
alogicaloperation performed on one or more binary inputs that produces a single binary
output.
NAND gate: The NAND gate operates as an AND gate followed by a NOT gate. It acts in
the manner of the logical operation "and" followed by negation. The output is"false" if
bothinputs are "true." Otherwise, the output is "true."
XOR gate: The XOR (exclusive-OR) gate acts in the same way as the logical "either/or."
The output is "true" if either, but not both, of the inputs are "true." The output is "false" if
both inputs are "false" or if both inputs are "true." Another way of looking at this circuit is
toobserve that the output is 1 if the inputs are different, but 0if the inputs are the same.
And gate: The output is "true" when both inputs are "true." Otherwise, the output
is"false."In other words, the output is 1 only when both inputs one AND two are
1.
Or gate :The output is "true" if either or both of the inputs are "true." If both inputs are
"false," then the output is "false." In other words, for the output to be 1, at leastinput one
OR two must be 1.
NOT gate: A logical inverter is called a NOT gate. It has only one input. It reverses the
logicstate. If the input is 1, then the output is 0. If the input is 0, then the output is1.
XNOR gate: The XNOR (exclusive-NOR) gate is a combination XOR gate followed by an
inverter. Its output is "true" if the inputs are the same, and "false" if the inputsare different.
Adder circuit A logic circuit used for adding two 1-bit numbers or simply two bits is called
as a Half Adder circuit. This circuit has two inputs and two outputs. The inputsare the two 1-
bit binary numbers and the outputs are Sum and Carry.
Observations:
(a) NAND gate
A NO
T
0 1
1 0
A B XO
R
0 0 0
0 1 1
1 0 1
1 1 0
Circuit and Truth table:
e) XNOR gate
g) Adder circuit
Circuit and Truth table:
A B A+ Carr
B y
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
h) Subtractor Circuit
Circuit and Truth table:
A B A- Borro
B w
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Conclusion:
We have verified the truth table for all logic gates including NAND,
NOT, AND, XOR, XNOR, OR gates.
1
Certificate
2
List of Experiments
3
Experiment 1
Components Required:-
Breadboard
IC
LED
Wires
Voltage source (+5V)
4
Theory:-
AND Gate:-
NAND Gate:-
A NAND gate (“not AND gate”) is a logic gate that
produces a low output (0) only if all its inputs are
true, and high output (1) otherwise. Hence the
NAND gate is the inverse of an AND gate, and its
circuit is produced by connecting an AND gate to a
NOT gate.
5
NOT Gate:-
A NOT gate, often called an inverter, is a nice digital
logic gate to start with because it has only a single
input with simple behavior. A NOT gate performs
logical negation on its input. In other words, if the
input is true, then the output will be false. Similarly,
a false input results in a true output.
NOR Gate:-
A NOR gate (“not OR gate”) is a logic gate that
produces a high output (1) only if all its inputs are
false, and low output (0) otherwise. Hence the NOR
gate is the inverse of an OR gate, and its circuit is
produced by connecting an OR gate to a NOT gate.
OR Gate:-
An OR gate is a logic gate that performs logical OR
operation. A logical OR operation has a high output
(1) if one or both the inputs to the gate are high (1). If
neither input is high, a low output (0) results.
6
XOR Gate:-
Observation:-
Nand Gate:-
Truth table:
A B NAND
0 0 1
0 1 1
1 0 1
1 1 0
7
NOT Gate:-
Truth table:
A NOT
0 1
1 0
AND Gate:-
Truth table:
A B AND
0 0 0
0 1 0
1 0 0
1 1 1
8
XOR Gate:-
Truth table:
A B XOR
0 0 0
0 1 1
1 0 1
1 1 0
OR Gate:-
Truth table:
A B OR
0 0 1
0 1 1
1 0 1
1 1 0
9
NOR Gate:-
Truth table:
A B NOR
0 0 1
0 1 0
1 0 0
1 1 0
1
Conclusion:-
1
Experiment 2
Components Required:-
Breadboard
IC
LED
Wires
Voltage source (+5V)
NAND GATE (7400)
NOR GATE (7402)
Software :-
Logisim
1
Theory:-
Universal Gates:-
1
Half Adder Circuit :-
1
Characteristics Equations of Half adder :-
Truth Table:-
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
1
Half Subtractor Circuit :-
1
Characteristics Equations of Half subtractor :-
Truth Table:-
A B Difference Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
1
Observations:-
1
1
2
Conclusion:-
We have verified the truth table of all gates using universal
gates. We have also verified the truth table of half adder and
half subtractor circuit using universal gates.
*-*-*-*-*
2
Experiment 3
Components Required:-
Breadboard
IC
LED
Wires
Voltage source (+5V)
AND GATE (7408)
OR GATE (7432)
XOR GATE (7486)
Software :-
Logisim
2
Theory:-
Full Adder:-
2
Characteristic Equations of Full Adder
Sum, S=A⊕B⊕C=A′B′+A′BC′+AB′C′+ABC
Truth Table:-
Sum, S=A⊕B⊕C=A′B′C+A′BC′+AB′C′
+ABC Carry, Cout =AB+AC+BC
A B C Sum Carry
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
2
Full Subtractor:-
2
Characteristic Equations of Full Subtractor
2
Binary to Grey Code Convertor
Formula:-
𝐺𝑛−1 = 𝐵𝑛⊕𝐵𝑛−1
Formula:-
𝐵𝑛−1 = 𝐵𝑛⊕𝐺𝑛−1
2
2 Bit Adder Circuit :-
Truth Table:-
2
Observation:-
2
3
Conclusion:-
*-*-*-*-*
3
Indian Institute of Information
Technology
Vadodara,International
Campus Diu
2 Bit Comparator
A magnitude comparator is a circuit that compares 2 binary
numbers in order tofind out whether those 2 numbers are equal
or first number is less than second number or second number is
less than first number.
We logically design a circuit that takes 2 input for A and 2 input
for B and givesone output for A<B or A=B or A>B.
Characteristic equation:-
A>B: A1(B1’)+A0(B1’B0’)
+A1A0(B0’)A<B:
A1’B1+B0’B1B0+A1’A0’B0
A=B: (A0 XOR B0)’(A1 XOR
B1)’
2*1 Multiplexer
In 2*1 MUX, there are only 2 inputs, 1 selection pin and a single
output on basis of the combination of input which are present at
selection line. So, one of these 2 input will be connected to
output. A 2-to-1 multiplexer consists of two inputs A0 and A1,
one select input S and one output Y. Depending on the select
signal, the output is connected to either of the inputs. Since
there are two input signals, only two ways are possible to
connect the inputs to the outputs, so one select is needed to do
these operations. When the select line is low, the output is
switched to the D0 input; when the select line is high, the output
is switched to the D1 input.
Logical
expressionY=
S0’A0+S0A1
4*1 Multiplexer
The 4x1 multiplexer has four data inputs I3, I2, I1 and I0, two
select lines s1 and s0 and one output Y. The block diagram
of the 4x1 multiplexer is shown in the following figure.
S1 S0 I1 I2 I3 I4 Output
0 0 0 x x x 0
0 0 1 x x x 1
0 1 x 0 x x 0
0 1 x 1 x x 1
1 0 x x 0 x 0
1 0 x x 1 x 1
1 1 x x x 0 0
1 1 x x x 1 1
Logical Expression:-
Y=S1ʹS0ʹI0+S1ʹS0I1+S1S0ʹI2
+S1S0I3
4*2 Encoder
An encoder is a digital circuit that converts a set of binary
inputs into a single binary code. Binary code represents the
position of an input and is used to identify the specific input
that is active.
The 4 to 2 encoder consists of four inputs Y3, Y2, Y1 and Y0
and two outputs A1 and A0. At any given time, only one of
these four inputs can be “1” to get the corresponding binary
code as output. The figure below shows the logic symbol of a 4
to 2 encoder.
INPUTS OUTPUTS
Y3 Y2 Y1 Y0 A1 A0
0 0 0 1 0 0
0 0 1 0 0 1
0 1 0 0 1 0
1 0 0 0 1 1
Logical
Expression:-A1
= Y3 + Y2
A0 = Y3 + Y1
2*4 Decoder
The 2*4 decoder has two inputs A1 and A0 and four outputs Y3,
Y2, Y1 and Y0. The functional diagram of 2 to 4 decoders is shown
in the following figure.
Logical
expression:
-
Y3=EA1A0
Y2=EA1A0’
Y1=EA
A0’
Y0=EA1’
A0’
Conclusion: - Verified the truth table of a 2-bit comparator,
verified the truth table of a 4*1 MUX using a 2*1 MUX, and
also created a 4*2 encoder and a 2*4 decoder.
Indian Institute of Information Technology,
Vadodara International Campus Diu IIITV-
ICD
Name: Ayush
kumar Roll:
202211008
Branch: CSE
Batch: 2022
Subject: EC261
Session: 2022-23
Certificate
This is to certify that Mr. Ayush Kumar of B-Tech batch 2022
Semester 3 Enrollment No. 202211008 Branch CSE hasbeen
found satisfactory in the continuous internal evaluation of the
laboratory, practical and term work in the subject EC261 for
the academic year 2022– 2023.
Aim:
Design the following
Components required:
Breadboard, IC, LED, wires,voltage source(+5V), Logisim software
Latch:
A Latch is a special type of logical circuit. The latches have low and high
two stablestates. Due to these states, latches also refer to as bistable-
multivibrators. A latchis a storage device that holds the data using the
feedback lane. The latch stores 1 - bit until the device set to 1. The latch
changes the stored data and constantly trials the inputs when the enable input
set to 1.
Jk Latch:
The JK Latch is the same as the SR Latch. In JK latch, the unclear states
are removed, and the output is toggled when the JK inputs are high. The
only difference between SR latch JK latches is that there is no output
feedback towards the inputs inthe SR latch, but it is present in the JK latch.
SR Latch:
D Latch:
The D latch is the same as D flip flop. The only difference between these two
is theENABLE input. The output of the latch is the same as the input passed
tothe Data input when the ENABLE input set to 1. At that time, the latch is
open,and the path is transparent from input to output. If the ENABLE input is
set to 0, the D latch's output is the last value of the latch, i.e., independent from
the input D, and thelatch is closed.
Flip Flops:
Flip flop is a circuit that maintains a state until directed by input to change
the state.A basic flip flop can be constructed using four NAND or four NOR
gates.
JK Flip-flops:
The JK Flip Flop is a gated SR flip-flop having the addition of a clockinput
circuitry. The invalid or illegal output condition occurs when both of the
inputsare set to 1 and are prevented by the addition of a clock input circuit.
So, the JKflip- flop has four possible input combinations, i.e., 1, 0, "no
change" and "toggle".
SR Flip-flops:
The SR flip flop is a 1-bit memory bistable device having two inputs, i.e., SET
and RESET. The SET input 'S' set the device or produce the output 1, and the
RESET input 'R' reset the device or produce the output 0. The SR flip flop
stands for "Set-Reset" flip flop. The reset input is used to get back the flip flop
toits original state from the current state with an output 'Q'. This output depends
on the set and reset conditions, which is either at the logic level "0" or "1".
D Flip-flop:
It ensures that at the same time, both the inputs, i.e., S and R, are never equal to
1. The Delay flip-flop is designed using a gated SR flip-flop with an inverter
connected between the inputs allowing for a single input D(Data). This single
data input, which is labeled as "D" used in place of the "Set" input and for the
complementary "Reset" input, the inverter is used. Thus, the level-sensitive D-
type orD flip flop is constructed from a level-sensitive SR flip flop.
T Flip-flop:
The T flip-flop is also called toggle flip-flop. It is a change of the JK flip-
flop.The T flip flop is received by relating both inputs of a JK flip-flop. The
T flip-flop is received by relating the inputs 'J' and 'K'. When T = 0, both
AND gatesare disabled.
Observations:
(a) JK Latch
Truth Table:
J K Q Q’
0 0 Memory
0 1 0 1
1 0 1 0
1 1 Memory
(b) SR Latch
Truth table :
Enabl S R Q Q’
e
0 X X Memor
y
1 0 0 Memor
y
1 0 1 0 1
1 1 0 1 0
1 1 1 0 0
(c) D Latch
Truth Table:
Enabl D Q Q’
e
0 X Memor
y
1 0 0 1
1 1 1 0
S R Qn Qn+1 J K
0 0 0 0 0 X
0 0 1 1 X 0
0 1 0 0 0 X
0 1 1 0 X 1
1 0 0 1 1 X
1 0 1 1 X 0
1 1 0 X X X
1 1 1 X X X
Truth Table:
D Qn Qn+ J K
1
0 0 0 0 X
0 1 0 X 1
1 0 1 1 X
1 1 1 X 0
Truth Table:
T Qn Qn+ J K
1
0 0 0 0 X
0 1 1 X 0
1 0 1 1 X
1 1 0 X 1
Conclusion:
We have successfully created and verified the truth table of JK,SR
and D latch.
We have also converted JK flip flop to SR, D, T flip-flops and
viceversaand verified their respective truth table.
*************