Skip to main content

Verilog Blocking vs. Non-Blocking Assignments

· loading · loading · ·
Hardware Design Verilog Assignments Blocking Assignment NonBlocking Assignment RTL Design Sequential Logic
Hardware Design
Axolot Logic
Author
Axolot Logic
Digital Design Engineer
Table of Contents
Verilog HDL Series - This article is part of a series.
Part 10: This Article

⛓️ Blocking vs Non-Blocking Assignments in Verilog
#

Verilog 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
#

ContextPreferred 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.


Verilog HDL Series - This article is part of a series.
Part 10: This Article

Related

Verilog Assignments: Procedural vs. Continuous Explained
· loading · loading
Hardware Design Verilog Assignments Continuous Assignment Procedural Assignment RTL Design Hardware Description Language
Hardware Design
Verilog Namespaces: Understanding Scope and Modularity
· loading · loading
Hardware Design Verilog Namespace Verilog Scope Modularity RTL Design Hardware Description Language
Hardware Design
Hardware Design Abstraction Levels in Verilog
·238 words·2 mins· loading · loading
Hardware Design Hardware Abstraction RTL Design Gate Level Transistor Level Digital Design
Hardware Design
Verilog Control Flow: if, case, loops & RTL Guidelines
· loading · loading
Hardware Design Verilog Control Flow Verilog If-Else Verilog Case Verilog Loops RTL Design
Hardware Design
Verilog Parameters: Making Modules Reusable & Configurable
· loading · loading
Hardware Design Verilog Parameters Reusable Design Configurable Modules RTL Design Hardware Description Language
Hardware Design
Verilog Synthesis: From RTL to Gate-Level Netlist
· loading · loading
Hardware Design Verilog Synthesis RTL Design Gate Level Netlist FPGA Design ASIC Design
Hardware Design