Lab 1 To 10 DLD
Lab 1 To 10 DLD
OR Gate:
The OR gate is an electronic circuit that gives a high output (1) if
one or more of its inputs are high. A plus (+) is used to show the
OR operation.
NOT Gate:
The NOT gate is an electronic circuit that produces an inverted
version of the input at its output. It is also known as an inverter.
NAND Gate:
This is a NOT-AND gate which is equal to an AND gate followed
by a NOT gate. The output of NAND gate is high if any of the
inputs are low. The symbol is an AND gate with a small circle on
the output. The small circle represents inversion.
NOR Gate:
This is a NOT-OR gate which is equal to an OR gate followed by a
NOT gate. The output of NOR gate is low if any of the inputs are
high. The symbol is an OR gate with a small circle on the output.
The small circle represents inversion.
XOR Gate:
The 'Exclusive-OR' gate is a circuit which will give a high output if
odd number of inputs are high. An encircled plus sign “ ” is used to
show the EOR operation.
XNOR Gate:
The XNOR gate is a digital logic gate whose function is the logical
complement of the Exclusive OR (XOR) gate.
In lab Task 1:
Observation Table for different Gates
INPUT OUTPUT
1 7402 4001
2 7403 4011
3 7408 4030
4 7409 4071
5 7432 4072
6 7486 4012
7 7404 4002
8 7427 4075
9 7420 4073
10 7421 4071
11 7412 4093
12 7411 4081
13 7410 4023
14 7405 4025
15 7412 4077
Lab #2
AN
D FROM NAND
AN
D FROM NOR
OR
FROM NOR
POST LAB
NOR TO NAND
NOR TO XOR
Critical Analysis:
After performing this lab I have learnt how that these gates can be further used for
the making of logic gates.with the help of this lab I will be able to differentiate
between different gates like XOR and etc. I am also able how to construct their logic
function using nor gate and NAND.
Lab # 3:
Introduction to Verilog using Xilinx ISE
Apparatus:
Xilinx
FPGA
Concept:
Verilog is a hardware description language used to write code to describe circuits and
gates. Its scope is from most simple circuits like AND gates to very complex output
circuits with thousands of inputs.
Xilinx is an IDE which gives us programming environment to code in Verilog and test
our code.
It provides drivers and connections to put our circuit on FPGA and test it too.
Verilog code:
module BasicFuncs(a,b,NOTa,AND,OR,NOR,NAND,XOR,XNOR
);
input a,b;
output NOTa,AND,OR,NOR,NAND,XOR,XNOR;
assign NOTa = ~a;
assign AND = a && b;
assign OR = a || b;
assign NOR = ~(a || b);
assign NAND = ~(a && b);
assign XOR = a^b;
assign XNOR = ~(a^b);
endmodule
TEST BENCH:
module FuncTest;
// Inputs
reg a;
reg b;
// Outputs
wire NOTa;
wire AND;
wire OR;
wire NOR;
wire NAND;
wire XOR;
wire XNOR;
end
endmodule
BEHAVIOUR TEST:
Part 2: Implement Boolean expression using Xilinx:
PROCEDURE:
Create project in Xilinx.
Specify inputs and outputs in main module.
Implement the Boolean expression using gates.
Give final output as output function variable
Create test file.
Test wave form.
module FuncDataFlow(x,y,z,F);
iSnput x,y,z;
output F;
assign F = x | (y&(~x)) | (y&(~z))
endmodule
module FuncGateLevel(x,y,z,F);
input x,y,z;
output F;
wire not_x,not_z,f1,f2,f3;
not n1(not_x,x);
not n2(not_z,z);
and a1(f1,not_x,y);
and a2(f2,y,not_z);
or o1(f3,f1,f2);
or o2(F,f3,x);
endmodule
module DataFlowTest;
// Inputs
reg x;
reg y;
reg z;
// Outputs
wire F;
initial begin
x = 0;
y = 0;
z = 0;
#100;
x = 0;
y = 0;
z = 1;
#100;
x = 0;
y = 1;
z = 0;
#100;
x = 0;
y = 1;
z = 1;
#100;
x = 1;
y = 0;
z = 0;
#100;
x = 1;
y = 0;
z = 1;
#100;
x = 1;
y = 1;
z = 0;
#100;
x = 1;
y = 1;
z = 1;
#100;
end
endmodule
Behavior Test:
CriticalAnalysis/Conclusion:
In this lab we learned the digital circuit or gate designinng, How to use XILINX
ISE software and how to create a project on it. We are able stimulate the
different gates.We heve learned how to design and verify the digital circuits.
Now we can easily compere the Gate Level, Data Flow Level, Function and The
Truth Table of the Function and verify results by comparing.
LAB #04
Design and Implementation of Boolean
Functions by Standard Forms using
ICs/Verilog
𝒙 𝒚 𝒛 𝑴𝒊𝒏𝒕𝒆𝒓𝒎𝒔 𝑴𝒂𝒙𝒕𝒆𝒓𝒎𝒔 𝑭 �
�
̅
0 0 0 𝑚0 = 𝑥 ′ 𝑦 ′ 𝑧 ′ 𝑀0 = 𝑥 + 𝑦 + 𝑧 0 1
0 0 1 𝑚1 = 𝑥 ′ 𝑦 ′ 𝑧 𝑀 1 = 𝑥 + 𝑦 + 𝑧′ 1 0
𝑚2 = 𝑥 ′𝑦𝑧 ′ 𝑀2 = 𝑥 + 𝑦′ + 𝑧
0 1 0 0 1
0 1 1 𝑚3 = 𝑥 ′ 𝑦𝑧 𝑀3 = 𝑥 + 𝑦 ′ + 𝑧 ′ 1 0
𝑚4 = 𝑥𝑦 ′ 𝑧 ′ 𝑀4 = 𝑥′ + 𝑦 + 𝑧
1 0 0 1 0
𝑚5 = 𝑥𝑦 ′ 𝑧 𝑀5 = 𝑥 ′ + 𝑦 + 𝑧 ′
1 0 1 0 1
𝑚6 = 𝑥𝑦𝑧 ′ 𝑀6 = 𝑥′+𝑦′ + 𝑧
1 1 0 0 1
𝑚7 = 𝑥𝑦𝑧 𝑀7 = 𝑥 ′ + 𝑦 ′ + 𝑧 ′
1 1 1 0 1
Pre-Lab Tasks:
QNO1:
Answer:
𝒙 𝒚 𝒛 𝑴𝒊𝒏𝒕𝒆𝒓𝒎𝒔 𝑴𝒂𝒙𝒕𝒆𝒓𝒎𝒔 𝑭 𝑥
+
𝑦z
0 0 0 𝑚0 = 𝑥 ′ 𝑦 ′ 𝑧 ′ 𝑀0 = 𝑥 + 𝑦 + 𝑧 0 0
0 0 1 𝑚1 = 𝑥 ′ 𝑦 ′ 𝑧 𝑀 1 = 𝑥 + 𝑦 + 𝑧′ 1 0
𝑚2 = 𝑥 ′𝑦𝑧 ′ 𝑀2 = 𝑥 + 𝑦′ + 𝑧
0 1 0 0 0
0 1 1 𝑚3 = 𝑥 ′ 𝑦𝑧 𝑀3 = 𝑥 + 𝑦 ′ + 𝑧 ′ 1 1
𝑚4 = 𝑥𝑦 ′ 𝑧 ′ 𝑀4 = 𝑥′ + 𝑦 + 𝑧
1 0 0 1 1
𝑚5 = 𝑥𝑦 ′ 𝑧 𝑀5 = 𝑥 ′ + 𝑦 + 𝑧 ′
1 0 1 0 1
𝑚6 = 𝑥𝑦𝑧 ′ 𝑀6 = 𝑥′+𝑦′ + 𝑧
1 1 0 0 1
𝑚7 = 𝑥𝑦𝑧 𝑀7 = 𝑥 ′ + 𝑦 ′ + 𝑧 ′
1 1 1 0 1
Sum of minterms:
F = ∑ (3, 4, 5, 6, 7)
F = A’BC + AB’C’ + AB’C + ABC’ + ABC
QNO2:
Answer:
𝐹′
𝒙 𝒚 𝒛 𝑴𝒊𝒏𝒕𝒆𝒓𝒎𝒔 𝑴𝒂𝒙𝒕𝒆𝒓𝒎𝒔 𝑭 (
= 𝑥+
𝑦𝑧) ′
0 0 0 𝑚0 = 𝑥 ′ 𝑦 ′ 𝑧 ′ 𝑀0 = 𝑥 + 𝑦 + 𝑧 0 1
0 0 1 𝑚1 = 𝑥 ′ 𝑦 ′ 𝑧 𝑀 1 = 𝑥 + 𝑦 + 𝑧′ 1 1
𝑚2 = 𝑥 ′𝑦𝑧 ′ 𝑀2 = 𝑥 + 𝑦′ + 𝑧
0 1 0 0 1
0 1 1 𝑚3 = 𝑥 ′ 𝑦𝑧 𝑀3 = 𝑥 + 𝑦 ′ + 𝑧 ′ 1 0
𝑚4 = 𝑥𝑦 ′ 𝑧 ′ 𝑀4 = 𝑥′ + 𝑦 + 𝑧
1 0 0 1 0
𝑚5 = 𝑥𝑦 ′ 𝑧 𝑀5 = 𝑥 ′ + 𝑦 + 𝑧 ′
1 0 1 0 0
𝑚6 = 𝑥𝑦𝑧 ′ 𝑀6 = 𝑥′+𝑦′ + 𝑧
1 1 0 0 0
𝑚7 = 𝑥𝑦𝑧 𝑀7 = 𝑥 ′ + 𝑦 ′ + 𝑧 ′
1 1 1 0 0
Product of maxterms:
F = π (3,4,5,6,7)
F = (x’+y+z)(x’+y+z’)(x’+y’+z)(x’+y’+z’)(x+y’+z’)
QNO3:
Given the function as defined in the truth table (Table), express 𝐹 using sum of
minterms and product of maxterms.
Answer:
𝒙 𝒚 𝒛 𝑴𝒊𝒏𝒕𝒆𝒓𝒎𝒔 𝑴𝒂𝒙𝒕𝒆𝒓𝒎𝒔 𝑭 �
�
̅
0 0 0 𝑚0 = 𝑥 ′ 𝑦 ′ 𝑧 ′ 𝑀0 = 𝑥 + 𝑦 + 𝑧 0 1
0 0 1 𝑚1 = 𝑥 ′ 𝑦 ′ 𝑧 𝑀 1 = 𝑥 + 𝑦 + 𝑧′ 1 0
𝑚2 = 𝑥 ′𝑦𝑧 ′ 𝑀2 = 𝑥 + 𝑦′ + 𝑧
0 1 0 0 1
0 1 1 𝑚3 = 𝑥 ′ 𝑦𝑧 𝑀3 = 𝑥 + 𝑦 ′ + 𝑧 ′ 1 0
𝑚4 = 𝑥𝑦 ′ 𝑧 ′ 𝑀4 = 𝑥′ + 𝑦 + 𝑧
1 0 0 1 0
𝑚5 = 𝑥𝑦 ′ 𝑧 𝑀5 = 𝑥 ′ + 𝑦 + 𝑧 ′
1 0 1 0 1
𝑚6 = 𝑥𝑦𝑧 ′ 𝑀6 = 𝑥′+𝑦′ + 𝑧
1 1 0 0 1
𝑚7 = 𝑥𝑦𝑧 𝑀7 = 𝑥 ′ + 𝑦 ′ + 𝑧 ′
1 1 1 0 1
Sum of minterms:
F= ∑ (1,3,4)
F=x’y’z+x’yz+xy’z’
F= π (0,2,5,6,7)
F=(x+y+z)(x+y’+z)(x’+y+z’)(x’+y’+z)(x’+y’+z’)
In-Lab Tasks:
Circuit Implementation
1. First, make the circuit diagram of the given Task.
2. Select appropriate logic gate ICs which are needed.
3. Make connections according to the circuit diagram you made.
4. Connect the input to data switches and output to the logic indicator.
5. Follow the input sequence and record the output.
TASK: Implement the circuit for the given function “F”. Function’s output is given in
Table
4.5. Finds its Boolean expression in SoP and PoS forms.
Table 4.5: Truth Table for F (In-Lab)
𝑨 𝑩 𝑪 𝑫 𝑭
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 1
1 0 0 0 1
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Boolean Equations:
Sum of Min-terms equation of F:
A’B’CD+ A’BCD+ AB’C’D’+ ABC’D+ ABCD’+ ABCD
Lab # 5
Consider,
Truth table:
A B C D F
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 1
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 1
1 0 1 0 1
1 0 1 1 0
1 1 0 0 1
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1
Part b and c: