Verilog Syntax Q

Status
Not open for further replies.

wuchy143

Member
Hi All,

I"m a little confused from the code below in reference to reset. What is it checking on reset? It is high? Or low?

if (~RESET) begin
q <= 1'b0;
 
Good link! Thx

So in context to what I was referring to the if statement is checking to see if RESET = 0. If it's true it then assigns a "0" to Q on the next clock cycle?
 
It does assign the value of zero to q, but not necessarily on the next clock cycle. If the code looks like this:

always@(posedge clock or reset)
if(~reset)
q <= 0;
...

Then the assignment is immediate and asychronous. If it looks like this:

always@(posedge clock)
if(~reset)
q<= 0;
...

then the reset values are assigned at the next clock.
 
Ok. So having that reset in there is making it happen on the next clock cycle? Hmmm I wonder why this is
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…