Experiment 1
Experiment 1
Name-Saiyamsood
Roll no-21104091
Structure:
Waveform:
Structure:
WaveForm:
(II) OR Gate
OR gate using data flow:
module orGate_Saiyam_21104091(a,b,c);
Input a,b;
output c;
assign c = a | b;
Endmodule
Structure:
Waveform:
OR Gate using behavioral modelling:
module orGate_Saiyam_21104091(a , b , c);
Input a , b;
output c;
reg c;
always@(a or b)
begin
case({a,b})
2'b00: begin
c=1'b0;
End
2'b01: begin
c=1'b1;
End
2'b10:begin
c=1'b1;
end
2'b11: begin
c=1'b1;
End
default:begin
c=1'b0;
end
endcase
End
Endmodule
Structure:
Waveform:
OR Gate using structural modelling:
module orGate_Saiyam_21104091(a,b,c);
Input a,b;
output c;
assign c = a | b;
Endmodule
OR Gate simulation using structural modelling:
module orGate_;
reg a;
reg b;
// Outputs
wire c;
orGate_Saiyam_21104091uut (
.a(a),
.b(b),
.c(c) );
Initial
begin
#0 a=0;b=0;
#10 a=0;b=1;
#10 a=1;b=0;
#10 a=1;b=1;
end
Endmodule
Structure:
Waveform:
(III) EX-or gate
EX-or gate using data flow:
module exorGate_Saiyam_21104091(a,b,c);
Input a,b;
output c;
assign c = a ^ b;
Endmodule
Structure:
Waveform:
EX-or gate using behavioral modelling:
module exorGate_Saiyam_21104091(a , b , c);
Input a , b;
output c;
reg c;
always@(a or b)
begin
case({a,b})
2'b00: begin
c=1'b0;
End
2'b01: begin
c=1'b1;
End
2'b10:begin
c=1'b1;
end
2'b11: begin
c=1'b1;
End
default:begin
c=1'b0;
end
endcase
End
Endmodule
EX-or gate simulation using behavioral modelling:
module exorGate_;
reg a;
reg b;
// Outputs
wire c;
exorGate_Saiyam_21104091uut (
.a(a),
.b(b),
.c(c) );
Initial
begin
#0 a=0;b=0;
#10 a=0;b=1;
#10 a=1;b=0;
#10 a=1;b=1;
end
Endmodule
Structure:
Waveform:
EX-or gate using Structural modelling:
module exorGate_Saiyam_21104091(a,b,c);
Input a,b;
output c;
assign c = a ^ b;
Endmodule
Structure:
Waveform:
(IV) NAND GATE:
NAND gate using data flow:
module nandGate_Saiyam_21104091(a,b,c);
Input a,b;
output c;
assign c = ~(a&b);
Endmodule
NAND gate simulation using data flow:
module nandGate_;
reg a;
reg b;
// Outputs
wire c;
nandGate_Saiyam_21104091uut (
.a(a),
.b(b),
.c(c) );
Initial
begin
#0 a=0;b=0;
#10 a=0;b=1;
#10 a=1;b=0;
#10 a=1;b=1;
end
Endmodule
Structure:
Waveform:
Structure:
Waveform:
Structure:
Waveform:
Structure:
Waveform:
Structure:
Waveform:
NOR GATE using structural modelling:
module norGate_Saiyam_21104091(a,b,c);
Input a,b;
output c;
assign c = ~(a|b);
Endmodule
Structure:
Waveform:
Waveform:
Structure:
Waveform:
module exnorGate_;
reg a;
reg b;
// Outputs
wire c;
exnorGate_Saiyam_21104091uut (
.a(a),
.b(b),
.c(c) );
Initial
begin
#0 a=0;b=0;
#10 a=0;b=1;
#10 a=1;b=0;
#10 a=1;b=1;
end
Endmodule
Structure:
Waveform:
RESULT: All basic gates are implemented in data flow, behavioral and
structural modelling and their corresponding logic circuits and simulations are
successfully obtained.