Sub topic 13
Clock period, setup time, hold time and propagation delay
This chapter assumes you know how a D flip-flop samples its input on a clock edge. It also assumes you can read a gate-level circuit. Here you will learn to compute the shortest legal clock period and the highest clock frequency of a synchronous circuit. You will also learn to check for hold violations.
Why timing limits the clock
A flip-flop copies its D input at the active clock edge. The input must already be stable when the edge arrives, and it must stay stable briefly afterward. Real gates and wires take time to settle. The clock period therefore cannot be arbitrarily short.
Every timing question in GATE reduces to one pattern. A launching flip-flop releases data on one edge. The data crosses combinational logic. A capturing flip-flop samples it on the next edge.
The four timing parameters
| Parameter | Symbol | Meaning |
|---|---|---|
| Clock-to-Q delay | t_cq | Time from the active clock edge until the flip-flop output is valid. Often called propagation delay of the flip-flop. |
| Combinational delay | t_comb | Time for a change to travel through the logic between two flip-flops. |
| Setup time | t_setup | Time the D input must be stable before the capturing clock edge. |
| Hold time | t_hold | Time the D input must stay stable after the capturing clock edge. |
Each delay has a maximum and a minimum value. The maximum comes from the slowest path and worst conditions. The minimum comes from the fastest path. Setup checks use maximum delays. Hold checks use minimum delays. Mixing them up is the most common error.
The setup constraint and the clock period
New data leaves FF1 at the edge, takes tcq to appear, and then passes through the logic. It must arrive at FF2 at least tsetup before the next edge, one clock period T later:
T ≥ tcq(max) + tcomb(max) + t_setup
The maximum clock frequency is fmax = 1 / Tmin.
If the circuit has several register-to-register paths, compute T for each path. The clock period must satisfy the slowest one. This is the critical path.
Worked example
Suppose tcq = 2 ns, tcomb(max) = 7 ns and t_setup = 1 ns.
Tmin = 2 + 7 + 1 = 10 ns, so fmax = 1 / 10 ns = 100 MHz.
Speeding up the logic from 7 ns to 5 ns gives T_min = 8 ns, which is 125 MHz. Shortening a path that is not critical changes nothing.
Direct connection
If FF1 drives FF2 with no logic, tcomb = 0. For example, in a shift register the constraint becomes T ≥ tcq + t_setup.
The hold constraint
Hold checks guard against data changing too soon after the capturing edge. New data launched at the same edge must not race through and overwrite the value FF2 is still capturing:
tcq(min) + tcomb(min) ≥ t_hold
The hold constraint does not contain T. Slowing the clock does not fix a hold violation. The remedy is to add delay on the short path, for example with buffers.
Take tcq(min) = 1 ns, tcomb(min) = 0.5 ns and t_hold = 0.5 ns. The left side is 1.5 ns, which is at least 0.5 ns. The hold slack is 1.0 ns, so the check passes.
Clock skew
Clock skew is the difference in clock arrival times at two flip-flops. Define skew = (capture clock arrival) − (launch clock arrival). Then:
- Setup: T ≥ tcq(max) + tcomb(max) + t_setup − skew
- Hold: tcq(min) + tcomb(min) ≥ t_hold + skew
Positive skew means the capturing flip-flop receives its clock later. This gives the data more time, so it helps setup, but it hurts hold. Negative skew does the opposite.
Some textbooks treat skew as a penalty that always shrinks the margin. They write T ≥ tcq + tcomb + tsetup + tskew. This is the worst-case form. Read the question to see which convention it uses. If it only says "clock skew of 0.5 ns" without a direction, the pessimistic form is usually intended.
Checking the numbers with code
This Python script applies both constraints to the worked example.
def min_period(t_cq_max, t_comb_max, t_setup, skew=0.0):
"""Smallest clock period in ns. skew = capture arrival - launch arrival."""
return t_cq_max + t_comb_max + t_setup - skew
def hold_slack(t_cq_min, t_comb_min, t_hold, skew=0.0):
"""Positive slack means the hold check passes."""
return t_cq_min + t_comb_min - t_hold - skew
t = min_period(2.0, 7.0, 1.0)
print("T_min =", t, "ns, f_max =", 1000 / t, "MHz")
for skew in (0.0, 0.8, 1.2):
period = min_period(2.0, 7.0, 1.0, skew)
slack = round(hold_slack(1.0, 0.5, 0.5, skew), 2)
status = "OK" if slack >= 0 else "HOLD VIOLATION"
print(f"skew={skew}: T_min={period:.1f} ns, hold slack={slack} ns, {status}")Expected output:
T_min = 10.0 ns, f_max = 100.0 MHz
skew=0.0: T_min=10.0 ns, hold slack=1.0 ns, OK
skew=0.8: T_min=9.2 ns, hold slack=0.2 ns, OK
skew=1.2: T_min=8.8 ns, hold slack=-0.2 ns, HOLD VIOLATIONAt skew 1.2 ns the period shrinks to 8.8 ns, but the circuit fails anyway. Larger positive skew helps setup and eventually breaks hold.
Applying the model to counters
Timing also explains why synchronous counters beat ripple counters.
In a ripple counter, each flip-flop is clocked by the previous one. The delays add up. For n flip-flops, the output settles after about n × tpd, where tpd is one flip-flop's clock-to-Q delay. The clock period must exceed this settling time, or the decoded count shows glitches and wrong values. The maximum frequency is roughly 1 / (n × t_pd).
In a synchronous counter, all flip-flops share one clock. The limit is the setup path: tcq + (delay of the AND gate chain that forms the toggle conditions) + tsetup. A 4-bit counter with a 3-input AND gate in the longest path has T ≥ tcq + tAND + t_setup. This does not grow with the flip-flops in the chain, except through the AND gate delay.
The ripple counter has a further problem. Its flip-flops change at different times, so a decoder on its outputs can produce brief wrong states.
Common errors
- Using the wrong delay extreme. Use maximum delays for setup and minimum delays for hold.
- Believing a slower clock fixes hold. T does not appear in the hold inequality.
- Forgetting t_cq. The path starts at the clock edge, not when the flip-flop output changes.
- Taking the wrong path. In a circuit with several stages, T is set by the slowest stage only.
- Mixing units. Convert ns to MHz with f = 1000 / T(ns).
Exercises
Exercise
A synchronous circuit has tcq = 1.5 ns, tsetup = 0.5 ns and a combinational path of 6 ns between two flip-flops. Find the minimum clock period and the maximum frequency.
Show answer
Tmin = 1.5 + 6 + 0.5 = 8 ns. fmax = 1000 / 8 = 125 MHz.
Exercise
Two stages of logic sit between three flip-flops. Stage 1 has tcomb = 4 ns and stage 2 has tcomb = 9 ns. Both flip-flops have tcq = 2 ns and tsetup = 1 ns. What is the minimum clock period?
Show answer
Stage 1 needs 2 + 4 + 1 = 7 ns. Stage 2 needs 2 + 9 + 1 = 12 ns. The clock must satisfy both, so T_min = 12 ns.
Exercise
A shift register has tcq(min) = 0.8 ns, thold = 1.0 ns, no logic between flip-flops, and zero skew. Does it meet hold? If it fails, does lowering the clock frequency help?
Show answer
tcq(min) + tcomb(min) = 0.8 + 0 = 0.8 ns, which is less than t_hold = 1.0 ns. The hold check fails by 0.2 ns. Lowering the frequency does not help, because T is not in the hold inequality. Add at least 0.2 ns of delay in the path, for example with a buffer.
Exercise
A 4-bit ripple counter uses flip-flops with t_pd = 12 ns each. Roughly what is the highest clock frequency at which its output is valid?
Show answer
Settling time is about 4 × 12 = 48 ns. The clock period must be at least this, so f_max ≈ 1000 / 48 ≈ 20.8 MHz.