Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

New Articles From Microcontroller Tips

Back
Top