1
\$\begingroup\$

I think that the code below is wrong because it uses blocking (=) instead of non-blocking (<=) assignments but since there is only one statement in the always block is this an issue?

Also, it is sensitive to op but it also updates op within the always block, will this create some sort of loop condition?

Are there other problems with it?

always @ (a or op)
begin
 op = a + b;
end
asked Apr 15, 2019 at 7:26
\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

You are using (reading) b and it is not in the sensitivity list.

op should not be in the sensitivity list but it does not hurt.

It is strongly recommended to use always @( *) in these cases.

The assignment is correct and should be blocking.

answered Apr 15, 2019 at 7:44
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.