What are Blocking and Non-Blocking Assignments?

In Verilog, blocking (=) and non-blocking (<=) assignments are used inside procedural blocks (always, initial) to assign values to variables.

Understanding the difference is one of the most frequently asked RTL Design interview questions.


1. Blocking Assignment (=)

A blocking assignment executes sequentially. The next statement waits until the current assignment is completed.

Example

always @(*) begin
    a = b;
    c = a;
end

Execution

a gets value of b
c gets updated value of a

So if:

b = 5

Then:

a = 5
c = 5

Typical Usage

✅ Combinational Logic

always @(*) begin
    y = a & b;
end

2. Non-Blocking Assignment (<=)