Verilog/02-counter_with_enable/counter_with_enable_tb.v
2024-10-25 15:34:10 +03:00

23 lines
No EOL
538 B
Verilog

module counter_with_enable_tb;
parameter WIDTH = 8;
reg reset = 0;
reg enable = 0;
initial begin
#17 reset = 1;
#11 enable = 1;
#17 reset = 0;
#11 enable = 1;
#17 reset = 1;
#17 $stop;
end
reg clk = 0;
always begin
#1 clk = 0;
#1 clk = 1;
end
wire[WIDTH-1:0] output_wire;
counter_with_enable c1(output_wire, enable, clk, reset);
initial
$monitor("Time = %t, Value = %h (%0d)", $time, output_wire, output_wire);
endmodule