Eoc Lab Manual.docx
Eoc Lab Manual.docx
VERILOG CODE:
module logicgate (A,B,F);
input A,B;
output F;
and and1 (F,A,B);
endmodule
NAND gate:
VERILOG CODE:
module logicgate (A,B,F);
input A,B;
output F;
nand nand1 (F,A,B);
endmodule
OR Gate:
VERILOG CODE:
module logicgate (A,B,F);
input A,B;
output F;
or or1 (F,A,B);
endmodule
NOR gate
VERILOG CODE:
module logicgate (A,B,F);
input A,B;
output F;
nor nor1 (F,A,B);
endmodule
EX-OR gate
VERILOG CODE:
module logicgate (A,B,F);
input A,B;
output F;
xor xor1 (F,A,B);
endmodule
EX-NOR gate
Verilog code:
AIM: To control given LED sequence using NAND and NOR gates
Apparatus:
A B LED1 LED2
0 0 1 0
0 1 0 1
1 0 0 0
1 1 1 1
Theory: NAND and NOR gates are known as universal logic gates. We can implement
any logic by using these universal logic gates. A logic circuit is designed to control LED’s
using NAND and NOR logic gates.
Procedure:
b) By applyingthe inputs, the LED outputs are observed and the operation is verified with the
help of truth table.
Precautions:
1. Connections must be tight on the bread board.
Result:
1. Understand the concept of universal gates
2. Identify the replacement of universal gates instead of basic gates
3. LED on and off controlling using universal gates
EXPERIMENT – 3
Aim: To Design a combinational circuit that check the following conditions to start the car engine
Otherwise blow horn if any one condition fails
Apparatus:
Logic Gates
Principle of Operation:
It is used to provide the security and safety to the passengers travelling in the car. When
a driver step into the car first it checks whether all the doors are properly closed or not if the
doors are closed then it checks for seatbelt is fasten or not all the conditions are satisfied then
the engine will start otherwise buzzer will blown.
Block diagram:
Truth Table:
Inputs Outputs
Key Cardoors Seatbelt Buzzer Engine
0 X X 0 0
1 0 0 1 0
1 0 1 1 0
1 1 0 1 0
1 1 1 0 1
K-Maps:
Logic Diagram:
Procedure:
Result: Student is able to design a car security system using logic gates
EXPERIMENT – 4:
Two judges of the Indian Idol competition need the help of digital logic to display
whether the participant must stay or leave the competition without displaying their votes. The
selection criteria are as follows.
Components Required: LED’s (Green and Red), MUX IC, NI Multisim with MyDAQ
Theory:
1. There will be 4 possibilities based on the voting of two judges (say A & B).
2. If the 2 judges vote positively or negatively for the participant, then the participant
should leave the competition i.e., if 00 or 11 then output should be zero.
3. If both the judges vote compliment to each other, then the participant stays in the
competition i.e., if 01 or 10 then output should be one.
4. Since one of the combinations will occur at a time based on the voting we can
switch the output using a multiplexer.
5. The circuit diagram is shown below for the given conditions.
Circuit Diagram:
Truth Table:
Procedure:
Observation:
1. What happens if both the judges vote positively for the participant?
2. Does both LEDs glow at the same time for any combination?
3. Can we implement the digital logic for the given problem using universal gates other
than MUX
EXPERIMENT – 5
Components Required: -
1 IC 7474 1
2 IC 7486 1
3 Breadboard 1
4 LEDs 4
Theory:
1. Circuit counts through 24-1 different non-zero bit patterns.
2. Left most bit determines shift or more complex operation
3. Can build a similar circuit with any number of FFs, may need more xor gates.
4. In general, with n flip-flops, 2n-1 different non-zero bit patterns.
Circuit Diagram:
Block Diagram:
Procedure:
1. Let us consider the initial input data is “ 0001”;
2. D1,D2,D3 and D4 are input lines of corresponding flipflops.
3. Similarly q1,q2,q3 and q4 are output lines of corresponding
flipflops. 4. D1=q4, D2=q1^q4
D3=q2
D4=q3
12 12 1110 14
13 13 1111 15
14 14 1101 13
15 15 1001 9
16 16 0001 1
Schematic In NI-Multisim:
Result:
1) From this Design, we had understand the concept of flipflops and its Applications.
2) Understood the concept of LFSR and its uses.
DSCH Installation procedure
http://csit-sun.pub.ro/courses/vlsi/Carte_VLSI/intrage.insa-tlse.fr/_etienne/Microwind/index.html
TRUTH TABLE
module FULL ADDER (A,B,C,SUM,CARRY);
input A,B,C;
output SUM,CARRY;
and and1 (w1,A,B);
xor xor1 (w2,A,B);
and and2 (w3,w1,C);
xor xor2 (SUM,w1,C);
or or1 (CARRY,w1,w3);
endmodule
EXPERIMENT – 7
DESIGN AND VERIFICATION OF 3-BIT ODD PARITY GENERATOR USING VERILOG HDL
Aim: To design and verification of 3-bit odd parity generator using verilog HDL
Components required: DSCH Tool
module oddparitygenerator (A,B,C,Pe,b3,b2,b1);
input A,B,C;
output Pe,b3,b2,b1;
xor xor1 (w1,A,B);
xnor xnor2 (Pe,w1,C);
buf buf1 (b1,A);
buf buf2 (b2,B);
buf buf3 (b2,C);
endmodule
SR-Flip-Flop
D-Flip flop
JK-Flip flop
T-Flop flop
Verilog codes for Flip flops
EXPERIMENT – 9
DESIGN AND VERIFICATION OF 3-BIT SYNCHRONOUS COUNTER USING VERILOG HDL
Aim: To design and verification of 3-bit synchronous counter using verilog HDL
Components required: DSCH Tool
Circuit diagram:
Truth table