Latest Post

Ads

VLSI: Full Adder Dataflow Modelling with Testbench

Verilog Code for Full Adder Dataflow Modelling

module full_adder(
    input a,
    input b,
    input cin,
    output s,
    output cout,

    );
assign x = a ^ b ;
assign y = x & cin ;
assign z = a & b ;
assign s = x ^ cin ;
assign cout = y | z ;
endmodule

//Testbench code for Full Adder Dataflow Modelling

initial begin
                             // Initialize Inputs
                             a = 0;b = 0;cin = 0;
                             // Wait 100 ns for global reset to finish
                             #100;

                             // Add stimulus here
                             #100; a = 0;b = 0;cin = 1;
                             #100; a = 0;b = 1;cin = 0;
                             #100; a = 0;b = 1;cin = 1;
                             #100; a = 1;b = 0;cin = 0;
                             #100; a = 1;b = 0;cin = 1;
                             #100; a = 1;b = 1;cin = 0;
                             #100; a = 1;b = 1;cin = 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