Verilog
TestBench
Simulation
more_vert
New Verilog
New Test Bench
Save
Download Verilog
Download TestBench
Upload Verilog
Upload TestBench
//full adder module fa (a, b, cin, s, cout); input a,b,cin; output s, cout; assign {cout,s} = a + b + cin; endmodule
Console:
module test; reg a, b, cin; wire s, cout; integer i; fa uut (.a(a), .b(b), .cin(cin), .s(s), .cout(cout) ); initial begin a = 0; b = 0; cin = 0; end always @ ( a, b, cin ) begin for ( i = 0; i < 8; i = i + 1 ) begin #10 {a, b, cin} = i; $monitor( "%d ns: a + b + cin = %b + %b + %b = cout sum = %b %b", $time, a, b, cin, cout, s ); end #10 $stop; end endmodule
Bin
Hex
add_circle_outline
remove_circle_outline
file_download
forward