Skip to main content

Verilog Assignments: Procedural vs. Continuous Explained

· loading · loading · ·
Hardware Design Verilog Assignments Continuous Assignment Procedural Assignment RTL Design Hardware Description Language
Hardware 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
#

FeatureContinuous AssignmentProcedural Assignment
Keywordassignalways, initial
Signal typewirereg, integer, etc.
LocationOutside blocksInside procedural blocks
Update timingContinuousOn 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

Verilog Blocking vs. Non-Blocking Assignments
· loading · loading
Hardware Design Verilog Assignments Blocking Assignment NonBlocking Assignment RTL Design Sequential Logic
Hardware Design
Verilog Namespaces: Understanding Scope and Modularity
· loading · loading
Hardware Design Verilog Namespace Verilog Scope Modularity RTL Design Hardware Description Language
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
Introduction to Verilog: Basics for Digital Design
·753 words·4 mins· loading · loading
Hardware Design Verilog FPGA ASIC RTL Design Hardware Description Language
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 Modules, Ports, Assignments & Best Practices
· loading · loading
Hardware Design Verilog Module Verilog Ports Verilog Assign Verilog Always Hardware Description Language
Hardware Design