Latest Post

Verilog: Full Adder Behavioral Modelling with Testbench Code

 Verilog Code Full Adder Behavioral Modelling

module Full_Adder (

input a, b, cin;

output sum, carry );

always @(a or b or cin)

assign {carry,sum} = a + b + cin;

endmodule


// test-bench

initial begin

a=0; b=0;

#100;

//wait 100ns for global reset to finish

//add stimulus here

#100 a=0; b=1; cin=1;

#100 a=1; b=0; cin=1;

#100 a=1; b=1; cin=1;

end

initial begin

#100 $monitor(“a=%b, b=%b, cin=%b, sum=%b, carry=%b”, a, b, cin, sum, carry);

end

endmodule


Xilinx Output:

Verilog Code for Full Adder Behavioral Modelling with Testbench
Verilog code for Full Adder Behavioral Modelling

 

Comments

Popular posts from this blog

Samir Palnitkar Solution Manual Free Download PDF of Verilog HDL

VLSI: 8-3 Encoder Dataflow Modelling with Testbench

VLSI: 4-1 MUX Dataflow Modelling with Testbench

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

Verilog: 8 to 1 Multiplexer (8-1 MUX) Dataflow Modelling with Testbench Code