Assigning values ​​in Verilog: the difference between assignment, <= and =

I've just started learning Verilog and I've seen these three lines from various sources. I am confused about the difference between the three:

  • c <= a & b;
  • assign c = ~ a;
  • c = 1'b0;

These lines seem to be assigning the value to c, but what's the difference? Thank.

+3


source share


1 answer


1) is <=

non-blocking and executed on every positive edge of the clock. they are priced in parallel, so no ordering guarantees. An example of this would be a register.

2) assign =

permanent assignment for out-of-operator posting always. the LHS value is updated when the RHS changes.



3) =

lock assignment, inside always statements provide a consistent order.

+5


source







All Articles