Professional Documents
Culture Documents
Verilog 2
Verilog 2
Exp.No: 1
Aim: To test and verify the truth table of following logic gates using ICs.
NAND (IC7400) Gate, NOR (IC7402) Gate, NOT (IC7404) Gate, AND (IC7408) Gate, OR
(IC7432), XOR(IC7486) Gate and XNOR (IC747266) Gate.
Apparatus Required
o IC 7400 ,IC 7402 , IC 7404 , IC 7408 1 no (each IC )
IC 7432 , IC 7486 , IC 74266
o Patch Cord / Connecting Wires
Theory
OR (IC7432)Gate:
The OR Gate performs logical addition, commonly known as OR Function. IC7432 is a
quad 2-input OR function. It has two or more inputs and only one output. The operation of OR
gate is such that a HIGH (1) on the output is produced when any one of the inputs is HIGH (1).
The output is LOW (0) only when all the inputs are LOW (0).
AND (IC7408)Gate:
The AND Gate performs logical multiplication, commonly known as AND function.
IC7408 is a quad 2-input AND function. It has two inputs and only one output. The output of an
AND gate is HIGH only when all the inputs are HIGH. Even if any one of the inputs is LOW,
the output will be LOW.
NOT (IC7404)Gate:
The NOT performs the basic logical function called inversion or complementation.
IC7404 is a hex 1-input NOT function. It has one input and one output. The purpose of this logic
gate is to convert one logic to the opposite logic level. When HIGH input is applied to an inverter,
a LOW output appears at its output and vice versa.
NAND (IC7400)Gate:
NAND gate is a contraction of the NOT-AND gates. IC7400 is a quad 2-input NAND
function. It has two inputs and only one output. When all the inputs are HIGH, the output is
LOW. If any one or both the inputs are LOW, then the output is HIGH. The NAND called as
Universal Gate.
NOR(IC7402) Gate:
NOR gate is a contraction of the NOT-OR gates. IC7402 is a quad 2-input NOR function.
It has is a gate with two and one output. When all the inputs are LOW, the output is HIGH. If any
one or both the inputs are HIGH, then the output is LOW. The NOR gate called as Universal
Gate.
EX-OR (IC7486) Gate:
IC7486 is a quad 2-input EX-OR function. The output of a gate is HIGH when odd numbers
of HIGH inputs are applied. If Even number of HIGH inputs or all the inputs are LOW the output
will be LOW.
EX-NOR (IC74266) Gate:
IC74266 is a quad 2-input Ex-NOR function. It is a gate with two and one output. When
all the inputs are LOW or HIGH the output will be HIGH. The output of a gate is LOW when
odd numbers of HIGH inputs are applied.
Procedure
Note: Student should write it on your own with proper meaning and sentence formation
Circuit Diagram
NAND Gate (IC7400)
IC Diagram
Logic Diagram
Truth Table
A B Y=(A.B)’
0 0
0 1
1 0
1 1
IC Diagram
Logic Diagram
Truth table
A B Y=(A+B)’
0 0
0 1
1 0
1 1
IC Diagram
Logic Diagram
Truth Table
A Y=A’
IC Diagram
Logic Diagram
Truth Table
A B Y=A.B
0 0
0 1
1 0
1 1
IC Diagram
Logic Diagram
Truth Table
A B Y=A+B
0 0
0 1
1 0
1 1
IC Diagram
Logic Diagram
Truth Table
A B Y=A⊕B
0 0
0 1
1 0
1 1
IC Diagram
Logic Diagram
Truth Table
A B Y=(A⊕B)’
0 0
0 1
1 0
1 1
Conclusion: The testing of logic gates using ICs was done and output was verified by the functionality.
Exp.No: 2
TESTING OF ADDERS
Aim
: To test and verify the following adders using IC 7486, 7408 & 7432.
➢ Half Adder
➢ Full Adder
Apparatus Required
Theory
Half Adder:
The half adder is an example of a simple, functional digital circuit built from two logic
gates. The half adder adds to one-bit binary numbers (AB). The output is the sum of the two bits
(S) and the carry (C). Note how the same two inputs are directed to two different gates. The
inputs to the XOR gate are also the inputs to the AND gate. The input "wires" to the XOR gate
are tied to the input wires of the AND gate; thus, when voltage is applied to the A input of the
XOR gate, the A input to the AND gate receives the same voltage.
Sum = A’B + AB’ = A⊕B
Carry = AB
Full Adder:
The full-adder circuit adds three one-bit binary numbers (C A B) and outputs two one-bit
binary numbers, a sum (S) and a carry (C1). The full-adder is usually a component in a cascade
of adders, which add 8, 16, 32, etc. binary numbers. The carry input for the full-adder circuit is
from the carry output from the circuit "above" itself in the cascade. The carry output from the full
adder is fed to another full adder "below" itself in the cascade. If you look closely, you'll see the
full adder is simply two half adders joined by an OR.
Sum = A⊕B⊕C
Carry = AB + BC + AC
Procedure
Note: Student should write it on your own with proper meaning and sentence formation
Half Adder
Truthtable
INPUTS OUTPUTS
A B S= A ⊕ B C= A.B
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
K-Map
Note: Student should have to find out the expression of Sum and Carry using Half Adder
truth table
Logic Diagram
Circuit Diagram
INPUTS OUTPUTS
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
K-map:
Note: Student should have to find out the expression of Sum and Carry using Full Adder
truthtable
Logic Diagram
Circuit Diagram
Conclusion
Thus the testing of half adder and full adder using ICs was done and output is verified by
the functionality.
VIVA QUESTIONS:-
Exp.No: 3
TESTING OF SUBTRACTORS
Aim
To test and verify the following Subtractors using ICs 7486, 7408, 7404, 7432.
➢ Half Subtractor
➢ Full Subtractor
Apparatus Required
Theory
Half Subtractor:
As in the case of the addition using logic gates, a full subtractor is made by combining
two half- subtractors and an additional OR-gate. A full subtractor has the borrow in capability
and so allows cascading which results in the possibility of multi-bit subtraction. The circuit
diagram for a full subtractor is given below.
Difference = A⊕B⊕C
Borrow = A’B + BC + A’C
Procedure
Note: Student should write it on your own with proper meaning and sentence formation
Half Subtractor
Truth table
INPUTS OUTPUTS
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
K-Map
Note: Student should have to find out the expression of Difference and Borrow using
Half Subtractor truthtable
Logic Diagram
Circuit Diagram
Full Subtractor
Truth table
INPUTS OUTPUTS
A B C Diff Bor
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
K-Map
Note: Student should have to find out the expression of Difference and Borrow using Full
Subtractor truthtable
Logic Diagram
Circuit Diagram
Conclusion
Thus the testing of half subtractor and full subtractor using ICs was done and output was
Verified by the functionality.
Viva Questions:
Q4 How to implement a half subtractor using half adder ICs. If yes which output pin is
required to be modified and how? Is there any benefit of doing so or not?
Q5 Do you expect different output if the order of inputs are changed in a subtractor?
Q6 If yes, any change will be observed in Difference (D) output pin?
Q7 How many minimum number of NOR gates are required to implement a full substractor?
Aim:
To design basic Logic gates (AND Gate, OR Gate, NOT Gate, XOR Gate, XNOR Gate)
using Dataflow modeling.
Tools Required:
Program:
AND Gate:
OR Gate:
NOT Gate:
endmodule
XOR Gate:
module xor1(Y,A,B);
output Y;
input A,B;
assign Y= A^ B;
endmodule
XNOR Gate:
module xnor1(Y,A,B);
output Y;
input A,B;
assign Y= ~(A^ B);
endmodule
AND Gate
Logic Diagram
Truth Table
A B Y=A.B
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate Logic
Diagram
Truth Table
A B Y=A+B
0 0 0
VIT Chennai Page 54
DIGITAL DESIGN 2016-17
0 1 1
1 0 1
1 1 1
Diagram
Truth Table
A Y=A’
0 1
1 0
Diagram
Truth Table
A B Y=A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
XNOR Gate
Logic Diagram
A B Y=(A⊕B)’
0 0 1
0 1 0
1 0 0
1 1 1
Result
The design of basic logic gates are done by Data flow modeling and verified the
functionality by simulation.
Aim:
To design of Universal Logic Gates (NAND Gate, NOR Gate) using Gate level
modeling.
Tools Required:
Program:
NAND Gate:
module NAND(Y,A,B);
output Y;
input A,B;
nand u1(Y,A,B);
endmodule
NOR Gate:
module NOR(Y,A,B);
output Y;
input A,B;
nor u1(Y,A,B);
endmodule
NAND Gate
Logic Diagram
A B Y=(A.B)’
0 0 1
0 1 1
1 0 1
1 1 0
Diagram
Truth Table
A B Y=(A+B)’
0 0 1
0 1 0
1 0 0
1 1 0
Result
The design of universal gates are done by Gate level modeling and verified the
functionality by simulation.
DESIGN OF ADDERS
Aim:
➢ Half Adder(HA)
➢ Full Adder(FA)
Tools Required:
Program:
Half Adder
Full Adder
Half Adder
Logic Diagram
Truth Table
INPUTS OUTPUTS
A B S= A ⊕ B C= A.B
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Logic Diagram
Truth Table
INPUTS OUTPUTS
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
Result
The design of adders (Half and Full Adder) are done by Gate level modeling and verified
the functionality by simulation..
DESIGN OF SUBTRACTOR
Tools Required:
Program:
Half Subtractor
input A,B;
wire W;
xor XOR(Diff,A,B);
and AND(Bor,W,B);
not NOT1(W,A);
endmodule
Full Subtractor
input A, B, C;
wire W0,W1,W2,W3,W4;
endmodule
Half Subtractor
Logic Diagram
Truth Table
INPUTS OUTPUTS
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Truth Table
INPUTS OUTPUTS
A B C Diff Bor
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
Result