williamd4112
Newbie level 1
- Joined
- Mar 8, 2015
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 10
I have learned verilog for a while. But I almost work on basic components. This is the first time that I use IP core to generate some basic components.
I try the binary counter. Generate and instantiate successfully. But when I use my testbench to check its functionality, I got some strange problems.
This is my testbench:
If it work properly, it should count in 10 unit time.
But output in monitor is the following ...
Why ? Why it start after 100 unit time ? I have checked it data sheet, but I still have no idea.
I try the binary counter. Generate and instantiate successfully. But when I use my testbench to check its functionality, I got some strange problems.
This is my testbench:
PHP:
module Counter_t(
);
reg clk;
wire[15:0] q;
Counter counter(
.clk(clk), // input clk
.q(q) // output [15 : 0] q
);
always #5 clk = ~clk;
initial begin
clk = 0;
$monitor("%g:\t%b\n",$time,q);
end
endmodule
If it work properly, it should count in 10 unit time.
But output in monitor is the following ...
PHP:
0: 0000000000000000
105: 0000000000000001
115: 0000000000000010
125: 0000000000000011
135: 0000000000000100
Why ? Why it start after 100 unit time ? I have checked it data sheet, but I still have no idea.