Integrated Lab1
Integrated Lab1
LAB No: 01
Object:
Follow the methodology behind the hardware design using hardware descriptive language.
Task 01:
To Design AND gate by using gate level modeling.
Circuit Diagram:
a
x
b
Truth Table:
Input OutPut
a b c
0 0 0
0 1 0
1 0 0
1 1 1
Coding:
//design module
module gate(x,a,b);
input a,b;
output x;
and a1(x,a,b);
endmodule
//Stimulus module
module Talha;
reg a,b;
wire x;
gate g1(x,a,b);
initial
begin
a=1'b0; b=1'b0;
#20
a=1'b0; b=1'b1;
#20
a=1'b1; b=1'b0;
#20
a=1'b1; b=1'b1;
#20
$finish;
end
endmodule
Result:
Truth Table:
Input OutPut
a b x
0 0 0
0 1 1
1 0 1
1 1 1
Coding:
//design module
module gate(x,a,b);
input a,b;
output x;
or a1(x,a,b);
endmodule
//stimulus module
module Talha;
reg a,b;
wire x;
gate g1(x,a,b);
Electronic Engineering Department
Sir Syed University Of Engineering And Technology
Name: Talha Mustafa Course Code: EE-380L
Roll No: 2020-EE-060 Section: B
initial
begin
a=1'b0; b=1'b0;
#30
a=1'b0; b=1'b1;
#30
a=1'b1; b=1'b0;
#30
a=1'b1; b=1'b1;
#30
$finish;
end
endmodule
Result:
Input OutPut
a b x
0 0 1
0 1 1
1 0 1
1 1 0
Coding:
//design module
module gate(x,a,b);
input a,b;
output x;
nand a1(x,a,b);
endmodule
//stimulus module
module Talha;
reg a,b;
wire x;
Result:
a
x
b
Truth Table:
Input OutPut
a b x
0 0 1
0 1 0
1 0 0
1 1 0
Coding:
//design module
module gate(x,a,b);
input a,b;
output x;
nor a1(x,a,b);
endmodule
//stimulus module
module Talha;
Result:
a Out
Truth Table:
Input OutPut
a Out
0 1
1 0
Coding:
//design module
module gate(out,a);
input a;
output out;
not a1(out,a);
endmodule
//stimulus module
module wasif;
reg a;
wire out;
gate g1(out,a);
initial
Result: