Counter Ps
Counter Ps
counter.v
96/01/24
22:50:17
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
clk;
reset;
cnt;
[7:0]
//
reg
//
The counter doesnt have any delay since the
//
output is latched when the posedge of the clock happens.
//
To be closer to the hardware implementation,
//
I could use a temporary value which would store
//
the intermediate result of the counter.
always @(posedge clk)
if (!reset)
cnt = cnt + 1;
else
cnt = 0;
endmodule