Latest Post

Ads

Verilog: 2 - 4 Decoder Structural/Gate Level Modelling with Testbench

Verilog Code for 2-4 Decoder Structural/Gate Level Modelling

2-4 Line Decoder
2-4 Line Decoder
module decoder_2_to_4(
    input a0,
    input a1,
    output d0,
    output d1,
    output d2,
    output d3
    );
               not(an0,a0),(an1,a1);
               and(d0,an0,an1),(d1,a0,an1),(d2,an0,a1),(d3,a0,a1);
endmodule


//Testbench code for 2-4 Decoder Structural/Gate Level Modelling

initial begin
// Initialize Inputs
a0 = 0;a1 = 0;
// Wait 100 ns for global reset to finish
#100;
// Add stimulus here
#100; a0=1;a1=0;
#100; a0=0;a1=1;
#100; a0=1;a1=1;

end

Output:
Verilog 2-4 Decode
Verilog 2-4 Decoder Response

Other Verilog Programs:

Go to Index of Verilog Programming

Comments

Ads

Popular posts from this blog

VLSI: 1-4 DEMUX (Demultiplexer) Dataflow Modelling with Testbench

VLSI: BCD to Excess 3 and Excess 3 to BCD Dataflow Modelling

VLSI: 2 Bit Magnitude Comparator Dataflow Modelling

Verilog: 8 to 1 MUX Behavioral Modelling using Verilog Case Statement with Testbench Code

1 to 4 DEMUX (Demultiplexer) Verilog CodeStructural/Gate Level Modelling with Testbench