Professional Documents
Culture Documents
Lab#2 (3x8 Decoder Using Gate Level and Data Flow Abstraction) Objectives
Lab#2 (3x8 Decoder Using Gate Level and Data Flow Abstraction) Objectives
Objectives:
“Design and verification of 2x4 & 3x8 Decoder using Gate Level and Data flow Abstraction in
ModelSim”
module t_decoder2x4;
reg[1:0] S;
reg E;
wire[3:0] O;
decoder2x4 d1(O, S, E);
initial begin
S=2'b0; E=1'b1;
repeat(4)
#100 S=(S+2'b01);
#100 $finnish;
end
endmodule
module t_decoder3x8;
reg[2:0] S;
wire[7:0] O;
decoder3x8 d1(O,S);
initial begin
S=3'b0;
repeat(8)
#100 S=(S+3'b001);
#100 $finnish;
end
endmodule
module t_decoder2x4_df;
reg[1:0] S; reg E;
wire[3:0] O;
decoder2x4_dataflow d1(O, E, S);
initial begin
S=2'b0; E=1'b1;
repeat(4)
#100 S=(S+2'b01);
#100 $finnish;
end
endmodule
module t_decoder3x8_df;
reg[2:0] S;
wire[7:0] O;
decoder3x8_dataflow d1(O,S);
initial begin
S=3'b0;
repeat(8)
#100 S=(S+1'b1);
#100 $finnish;
end
endmodule