Latest Post

Ads

VLSI: 3-8 Decoder Structural/Gate Level Modelling with Testbench

Verilog Code for 3-8 Decoder Structural/Gate Level Modelling

3-8 Line Decoder
3-8 Line Decoder
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
    );
and (d0,xn,yn,zn),(d1,xn,yn,z),(d2,xn,y,zn),(d3,xn,y,z),(d4,x,yn,zn),(d5,x,yn,z),(d6,x,y,zn),(d7,x,y,z);
not (xn,x),(yn,y),(zn,z);
endmodule

//Testbench code for 3-8 Decoder Structural/Gate Level 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:
Verilog 3-8 Decoder
Verilog 3-8 Decoder Response

Other Verilog Programs:

Go to Index of Verilog Programming

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