Latest Post

Ads

VLSI: 3-8 Decoder Dataflow Modelling with Testbench

Verilog Code for 3-8 Decoder Dataflow Modelling

module decoder3_to_8(
    input x,
    input y,
    input z,
    output d0,
    output d1,
    output d2,
    output d3,
    output d4,
    output d5,
    output d6,
    output d7
    );
assign d0 = xn & yn & zn;
assign d1 = xn & yn & z;
assign d2 = xn & y & zn;
assign d3 = xn & y & z;
assign d4 = x & yn & z;
assign d5 = x & yn & z;
assign d6 = x & y & zn;
assign d7 = x & y & z;
assign xn = ~ x;
assign yn = ~ y;
assign zn = ~ z;
endmodule

//Testbench code for 3-8 Decoder Dataflow Modelling

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

 end


Output:
VLSI: 3-8 Decoder Dataflow Modelling with Testbench

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