Archived
1
0
This repository has been archived on 2026-02-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
iceberg/testbench/half_adder_tb.sv
T
2022-03-04 01:38:36 +01:00

17 lines
594 B
Systemverilog

'include "cpu/alu/halfadder.sv"
module halfadder_tb();
reg ta,tb;
wire t_sum, t_carry;
halfadder dut(t_sum, t_carry, ta, tb);
initial begin
ta = 0; tb = 0;
$monitor("A/B: %b, %b ",ta, tb, "S/C: %b, %b",t_sum, t_carry);
#5 ta = 1; tb = 0;
$monitor("A/B: %b, %b ",ta, tb, "S/C: %b, %b",t_sum, t_carry);
#5 ta = 0; tb = 1;
$monitor("A/B: %b, %b ",ta, tb, "S/C: %b, %b",t_sum, t_carry);
#5 ta = 1; tb = 1;
$monitor("A/B: %b, %b ",ta, tb, "S/C: %b, %b",t_sum, t_carry);
end
endmodule