Skip to main content

Blocking vs Non-Blocking Assignments

· loading · loading · · ·
HDL SystemVerilog HDL
Axolot Logic
Author
Axolot Logic
Digital Design Engineer
Table of Contents
SystemVerilog - This article is part of a series.
Part 6: This Article

⛓️ Blocking vs Non-Blocking Assignments in SystemVerilog
#

SystemVerilog provides two types of procedural assignments inside always or initial blocks:


➡️ Blocking Assignment (=)
#

  • Executes immediately and in sequence
  • Each line blocks the next until it’s done
  • Typically used in combinational logic

✅ Example:
#

always @(*) begin
  a = b;
  c = a;  // uses updated 'a'
end

Think: Like normal programming assignments (step-by-step).


Non-Blocking Assignment (<=)
#

  • Schedules the update — doesn’t happen immediately
  • Allows all right-hand sides to be evaluated before updating left-hand sides
  • Used in sequential (clocked) logic

✅ Example:
#

always @(posedge clk) begin
  a <= b;
  c <= a;  // 'a' is not updated yet, uses old value
end

Think: Like flip-flop behavior — values update at the end of the clock cycle.


🧠 Best Practice
#

Context Preferred Assignment
Combinational logic (always @(*)) = (blocking)
Sequential logic (always @(posedge clk)) <= (non-blocking)

Never mix = and <= in the same always block — it can lead to confusing and incorrect simulation behavior.


SystemVerilog - This article is part of a series.
Part 6: This Article

Related

SystemVerilog Arrays
· loading · loading
HDL SystemVerilog HDL
SystemVerilog Data Types
· loading · loading
HDL SystemVerilog HDL
SystemVerilog Intoduction
· loading · loading
HDL SystemVerilog HDL
SystemVerilog Loops & Control Flow Statements
· loading · loading
HDL SystemVerilog HDL
SystemVerilog Tasks and Functions
· loading · loading
HDL SystemVerilog HDL
SystemVerilog Typedef & Alias
· loading · loading
HDL SystemVerilog HDL