RTL (register transfer level) design
WHY does RTL exist?
WHAT is RTL, precisely?

HOW does data actually flow? (Derive the timing)
Worked Example 1 — A simple accumulator
Design: acc <= acc + data_in; on each clock.
module accum(input clk, input rst, input [7:0] data_in,
output reg [7:0] acc);
always @(posedge clk) begin
if (rst) acc <= 8'd0; // synchronous reset
else acc <= acc + data_in;
end
endmoduleStep: use <= (non-blocking). Why this step? Non-blocking assignment schedules the update at the end of the timestep, modeling "all registers latch simultaneously on the edge." Real flip-flops all fire together — <= matches that. Using = here would create a false ordering dependency.
Step: reset inside @(posedge clk). Why? This is a synchronous reset — it only takes effect on an edge, exactly like real logic feeding the D input.
Timing: critical path = adder. If ns, adder ns, ns, then ns, so MHz.
Worked Example 2 — Combinational vs sequential split
Compute y = (a + b) * c, registered output.
reg [15:0] y;
wire [15:0] prod = (a + b) * c; // combinational (assign-style)
always @(posedge clk) y <= prod; // sequential: latch itStep: keep the arithmetic combinational, latch only at the end. Why? Separating "compute" (a pure function, no clock) from "store" (the register) is the essence of RTL. The tool synthesizes an adder + multiplier as gates, then one register bank.
Forecast-then-Verify: Predict — how many registers? Only the 16-bit y → 16 flip-flops. The adder/multiplier are gates, not registers. ✅ (Beginners often think every wire is stored — it isn't.)
Worked Example 3 — Blocking mistake in sequential logic
// BUGGY intent: swap a and b every clock
always @(posedge clk) begin
a = b; // blocking
b = a; // now b gets the NEW a, not old a!
enda=b executes, then b=a sees the already-updated a. Both become old b. Fix:
always @(posedge clk) begin
a <= b;
b <= a; // both use OLD values → true swap
endWhy the fix works: non-blocking reads all right-hand sides using pre-edge values, then updates simultaneously — a faithful register model.
Recall Feynman: explain to a 12-year-old
Imagine a relay race. Registers are runners standing at fixed spots holding a baton (a number). The clock is a whistle. On every whistle, each runner hands the baton to the next runner. But between whistles, the baton passes through a little machine (the logic) that changes it — maybe adds 1. The whole trick: the machine must finish changing the baton before the next whistle blows, or the next runner grabs a half-cooked number. Blow the whistle too fast → chaos. RTL is just writing down: "at each whistle, this runner gets this changed baton."
Flashcards
What does RTL stand for and describe?
The two fundamental building blocks in RTL?
Write the max-clock-period (setup) constraint.
Why does the critical path determine max frequency?
Why use non-blocking (<=) in @(posedge clk) blocks?
= imposes false ordering.Write the hold-time constraint and note what's special.
Which signals become registers in synthesis?
How do you make a design run at a higher clock frequency?
Difference between synchronous and asynchronous reset (RTL)?
@(posedge clk) and acts only on an edge; async reset is in the sensitivity list and acts immediately.Connections
- HDL & Digital Design Flow
- Verilog syntax and semantics
- Combinational logic design
- Sequential logic and flip-flops
- Logic synthesis
- Static Timing Analysis
- Pipelining
- Finite State Machines
- Clock domains and metastability
Concept Map
Hinglish (regional understanding)
Intuition Hinglish mein samjho
Dekho, RTL ka matlab hai apne circuit ko is tarah describe karna: "har clock edge pe, kaunsa register kaunsi value store karega." Do hi cheezein hoti hain — registers (jo numbers yaad rakhte hain) aur combinational logic (jo bina yaad rakhe seedha compute karti hai, jaise adder). Data ek register se nikalta hai, beech ki logic se hoke guzarta hai (add, multiply, jo bhi), aur agli clock edge pe doosre register mein "latch" ho jaata hai. Bas yahi hai poora khel.
Sabse important baat timing hai. Register se signal nikalne mein lagta hai, logic ko compute karne mein , aur next register ko capture ke liye pehle chahiye. In sabka total clock period se kam hona chahiye: . Jo path sabse slow hai wo critical path hai — wahi tumhari maximum speed decide karta hai. Agar clock bahut fast kar doge, logic settle nahi hogi aur galat value latch ho jaayegi.
Verilog mein ek golden rule yaad rakho: sequential block (always @(posedge clk)) mein hamesha <= (non-blocking) use karo, aur combinational (always @(*)) mein = (blocking). Kyun? Kyunki real flip-flops sab ek saath, ek hi edge pe update hote hain — <= yahi parallel behaviour model karta hai. Agar = use karoge sequential mein, to swap type bugs aa jaayenge. RTL master karne ke liye bas yeh soch: "kya is signal ko clock ke aar-paar yaad rakhna hai?" Haan → register. Nahi → sirf logic.