Latest Post

Ads

VLSI: 2-1 MUX Structural/Gate Level Modelling with Testbench

Verilog Code for 2-1 MUX Structural/Gate Level Modelling

module two_to_1_mux(
output Y,
input D0, D1, S,
wire T1, T2, Sbar
    );
and (T1, D1, S), (T2, D0, Sbar);
not (Sbar, S);
or (Y, T1, T2);
endmodule

//Testbench code for 2-1 MUX Structural/Gate Level Modelling

initial begin




                             // Initialize Inputs
                             S = 0; D0 = 0; D1 = 0;
                             // Wait 100 ns for global reset to finish
                             #100;

                             // Add stimulus here
                             #100; S = 0;D0 = 0;D1 = 1;
                             #100; S = 0;D0 = 1;D1 = 0;
                             #100; S = 0;D0 = 1;D1 = 1;
                             #100; S = 1;D0 = 0;D1 = 0;
                             #100; S = 1;D0 = 0;D1 = 1;
                             #100; S = 1;D0 = 1;D1 = 0;
                             #100; S = 1;D0 = 1;D1 = 1;

end

Output:

Comments

Ads

Popular posts from this blog

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

Full Subtractor Verilog Code in Structural/Gate Level Modelling with Testbench

VLSI: 4-1 MUX Dataflow Modelling with Testbench

VLSI: Half Subtractor and Full Subtractor Gate Level Modelling

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