VERILOG : 6. Primitives, Gate and Switch Delays in verilog
When we design digital circuits in Verilog, we often rely on primitives—the building blocks of complex systems. These are the lowest-level components (gates, switches, buffers, etc.) that mimic real hardware behavior. Understanding how to design using primitives is crucial, especially in ASIC (Application-Specific Integrated Circuit) and library development.
In this blog, we’ll cover:
✅ What Verilog primitives are
✅ How delays are modeled (rise, fall, turn-off, min/typ/max)
✅ Examples of gate delays with testbenches
✅ N-input and N-output primitives
Let’s dive in 🚀
🔹 What are Verilog Primitives?
Primitives are the basic logic gates and switches provided by Verilog.
-
They are built-in keywords like
and,or,not,buf, etc. -
They do not require module definitions (unlike user-defined modules).
-
ASIC vendors often use User-Defined Primitives (UDP) and standard gate primitives for library creation.
Think of them as the “Lego blocks” of digital hardware.
🔹 Modeling Gate and Switch Delays
In real circuits, logic gates take time to respond to input changes. Verilog allows us to add delays to primitives, making simulations closer to reality.
⏱ Types of Delays in Verilog
-
Rise Delay → Time to transition output to
1 -
Fall Delay → Time to transition output to
0 -
Turn-off Delay → Time to transition output to
z(high-impedance)
Additionally, each delay can have minimum, typical, and maximum values:
-
min→ Best-case delay (fastest response) -
typ→ Normal delay (realistic case) -
max→ Worst-case delay (slowest response)
👉 Syntax:
🔹 Examples of Delays in Verilog
🟢 Example 1 – Single Delay
Simulation Output:
Here, output changes 5 time units after input.
🟢 Example 2 – Rise and Fall Delays
-
Rise delay = 2
-
Fall delay = 3
So output is faster when rising, slower when falling.
🟢 Example 3 – All Delays Together
This allows different behaviors for rise, fall, and turn-off conditions.
🟢 Example 4 – Complex Delay Example
This models realistic timing differences across different gates.
🔹 N-Input and N-Output Primitives
✅ N-Input Primitives
-
and,nand,or,nor,xor,xnor -
First terminal = output
-
Remaining terminals = inputs
✅ N-Output Primitives
-
buf,not -
First terminals = outputs
-
Last terminal = input
🔹 Building Circuits Using Primitives
Now, let’s build some real circuits using only primitives.
🟢 Example – AND Gate from NANDs
🟢 Example – D Flip-Flop from NANDs
This mimics the latch + clock behavior of a flip-flop.
🟢 Example – Multiplexer from Primitives
This is a 4:1 multiplexer built using just NOT, AND, OR gates.
🎯 Key Takeaways
✔ Verilog primitives are the basic hardware blocks for modeling real circuits.
✔ Delays (rise, fall, turn-off) bring realism to simulations.
✔ We can build larger designs like AND gates, D-FFs, and MUXes using only primitives.
✔ Understanding min/typ/max delays is crucial for ASIC design and timing analysis.

Comments
Post a Comment