Skip to main content

Procedural vs Continuous Assignments in Verilog

· loading · loading · · ·
HDL Verilog Procedural Assignment Continuous Assignment Wire Reg RTL FPGA Design
Axolot Logic
Author
Axolot Logic
Digital Design Engineer
Table of Contents
Verilog HDL Series - This article is part of a series.
Part 9: This Article

πŸ” Procedural vs Continuous Assignments in Verilog
#

Verilog supports two main types of assignments, each used in different contexts for modeling hardware accurately.


βš™οΈ Continuous Assignment
#

  • Uses the assign keyword
  • Automatically updates the output whenever any input changes
  • Describes combinational logic
  • Signal must be a wire type

βœ… Example:
#

assign y = a & b;

Key Points:

  • Declared outside any always or initial block
  • Suitable for simple logic and dataflow connections
  • Behaves like a real physical wire

πŸ” Procedural Assignment
#

  • Defined inside initial or always blocks
  • Describes sequential or controlled logic
  • Signal must be a reg, integer, or real

βœ… Example:
#

always @(posedge clk) begin
  count <= count + 1;
end

Key Points:

  • Supports conditional logic (if, case, for)
  • Must use = (blocking) or <= (non-blocking)
  • Used for FSMs, registers, clocked logic

🧠 Summary Table
#

Feature Continuous Assignment Procedural Assignment
Keyword assign always, initial
Signal type wire reg, integer, etc.
Location Outside blocks Inside procedural blocks
Update timing Continuous On triggered events
Control structures ❌ Not supported βœ… Supported
Synthesis use βœ… Yes βœ… Yes

πŸ” Tip: Common Error
#

reg y;
assign y = a & b;  // ❌ Error! Cannot drive reg from assign

➑️ Use wire with assign, or move logic into an always block.


πŸ’‘ Understanding these two assignment types is essential for writing valid, synthesizable Verilog code.


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

Related

Parametric Hardware with `generate` in Verilog
· loading · loading
HDL Verilog Generate Genvar Parametric Design RTL
Understanding the `initial` Block in Verilog
· loading · loading
HDL Verilog Initial Block Simulation Testbench RTL Design
Blocking vs Non-Blocking Assignments
· loading · loading
HDL Verilog HDL
Command-Line Input
· loading · loading
HDL Verilog HDL
Task and Function
· loading · loading
HDL Verilog HDL
Hierarchical Reference
· loading · loading
HDL Verilog HDL