non-nullable

OP #3614570
Rate this post
useful
not useful
hey, guys! can you help me with part of veilog code?

always@(posedge clk)
begin
if(counter<=width)
    out <=1'b1;
else
    out <=1'b0;

counter<=counter+1'd1;

if(counter>=18'd195312)
  counter=18'b0;
  $display("%d",counter[17:0]);
end


when COUNTER equals 195312 I want set to null it.
it nulled, but the next clock CLK continues to count COUNTER to 
195313...
why is this happening???

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now