Skip to content
GATEiit

GATE EC · Digital Circuits

Setup and hold time

Setup time, hold time and clock-to-Q delay of a flip-flop, the setup (maximum delay) and hold (minimum delay) constraints of a register-to-register path, maximum clock frequency, the effect of clock skew, and metastability.

Before you start

This topic comes before: Critical path delay

Concept notes

1. Setup time, hold time and clock-to-Q delay

An edge-triggered flip-flop samples D at the active clock edge. To sample correctly, D must not change inside a small window around the edge.

  • Setup time tsu: the minimum time D must be stable before the active edge.
  • Hold time th: the minimum time D must stay stable after the active edge.
  • Clock-to-Q (propagation) delay tcq (also tpcq): the maximum time after the edge for Q to show the new value.
  • Contamination clock-to-Q tccq: the minimum time after the edge before Q can start to change.

The window from tsu before the edge to th after it is the aperture. Hold time can be zero or even negative for some flip-flops.

For combinational logic the matching pair is the propagation delay tpd (longest path, slowest case) and the contamination delay tcd (shortest path, fastest case).

What happens on a violation? The flip-flop may store the wrong value, or enter a metastable state: the output hovers between 0 and 1 for an unpredictable time before settling to either value.

CLKDQoldstablemay changetsuthtcq (clock-to-Q)active edge
D must be stable for t_su before and t_h after the active clock edge; Q changes t_cq after the edge.

2. The setup constraint and maximum clock frequency

Take a path: flip-flop FF1 launches data at a clock edge, it passes through combinational logic, and FF2 captures it at the next edge. The data must reach FF2 at least tsu before that edge. With no clock skew: Tclk≥tcq+tpd+tsu,fmax=1tcq+tpd+tsu. Use the slowest values: maximum clock-to-Q and the critical (longest) path delay.

Setup slack =Tclk−(tcq+tpd+tsu). Negative slack is a setup violation.

How to fix a setup violation:

  • lower the clock frequency (longer Tclk);
  • shorten the critical path (faster gates, better logic, fewer levels);
  • add pipeline registers to split the path.

Circuits with several paths: compute the delay of every register-to-register path (including a flip-flop's feedback path to itself) and take the largest for the clock period. In a pipeline, the slowest stage sets the clock.

Inputs from outside the circuit count too: if the input arrives at time tin after the edge, the path is tin+tpd+tsu.

DQFF1 (launch)DQFF2 (capture)combinationallogictpd max, tcd minCLKdelayadds skew δδ = clock arrival at FF2 − arrival at FF1 (skew)
A register-to-register path: FF1 launches, the logic delays the data, FF2 captures; δ is the clock skew at FF2.

3. The hold constraint

At the same clock edge at which FF2 captures its data, FF1 launches new data. If the new data races through a very short path, it can reach FF2 while FF2 is still in its hold window and corrupt the value being captured. With no skew: tccq+tcd≥th. Use the fastest values: minimum clock-to-Q and the shortest path (contamination delay).

Hold slack =tccq+tcd−th.

Key fact: the hold constraint does not contain Tclk. Lowering the clock frequency cannot fix a hold violation. A chip with a hold violation fails at every frequency.

How to fix a hold violation: add delay (buffers) in the short path, without making the long path too slow.

Direct connections: when Q of one flip-flop drives D of the next with no logic (tcd=0), as in a shift register, the condition is tccq≥th. Flip-flops are designed so that this holds when the clock is not skewed.

Setup check Hold check
Path used longest shortest
Delays used maximum minimum
Depends on Tclk yes no
Fix slow clock, shorten path add delay to the path

4. Clock skew

Clock skew δ is the difference in clock arrival times: δ=tclk, capture−tclk, launch. Positive skew means the capturing flip-flop gets the edge later.

With skew the two constraints become Tclk≥tcq+tpd+tsu−δ, tccq+tcd≥th+δ.

Reading the signs:

  • Positive skew gives the data more time to arrive, so it helps setup but hurts hold (the capture edge comes later, so fast new data has more chance to race in).
  • Negative skew does the opposite: it hurts setup and helps hold.

When the sign of skew is not known (it can vary with temperature or design), designers take the worst case for each check: subtract ∣δ∣ from the setup budget and add it to the hold requirement: Tclk≥tcq+tpd+tsu+∣δ∣,tccq+tcd≥th+∣δ∣.

Maximum skew a path can tolerate for hold: δmax=tccq+tcd−th.

Read each question carefully for how it defines skew; some define it as launch minus capture, which flips the signs.

5. Metastability and synchronisers

An asynchronous input (a push button, data from another clock domain) can change at any time, so it will sometimes violate setup or hold. The flip-flop can then become metastable.

Resolution: a metastable flip-flop eventually settles, and the chance that it is still unresolved after a waiting time t falls exponentially, as e−t/τ, where τ is a time constant of the flip-flop.

Mean time between failures (one common model): MTBF=etr/τT0 fclk fdata, with tr the time allowed for resolution, T0 a device constant (related to the aperture), fclk the clock frequency and fdata the rate of input changes. A small increase in tr raises MTBF enormously.

Two-flip-flop synchroniser: pass the asynchronous signal through two flip-flops in series on the destination clock. The first may go metastable, but it has almost a full clock period to resolve before the second samples it. This trades one cycle of latency for a very large MTBF.

A synchroniser does not prevent metastability; it only makes failures extremely rare.

Formulas to remember

Setup constraint
Tclk≥tcq+tpd+tsu
Maximum clock frequency
fmax=1tcq+tpd,max⁡+tsu
Hold constraintIndependent of the clock period
tccq+tcd≥th
Setup with skewδ = capture clock arrival minus launch clock arrival
Tclk≥tcq+tpd+tsu−δ
Hold with skew
tccq+tcd≥th+δ
Setup slack
Tclk−(tcq+tpd+tsu)
Hold slack
tccq+tcd−th
Synchroniser MTBF
MTBF=etr/τT0 fclk fdata

Common mistakes

  • Lowering the clock frequency to fix a hold violation; the hold condition does not contain the clock period.
  • Using the shortest path for setup or the longest for hold; setup uses the slowest path and maximum delays, hold uses the fastest path and minimum delays.
  • Getting the skew sign backwards; positive skew (capture clock later) helps setup and hurts hold.
  • Forgetting t_cq or t_su when finding the clock period; the period must cover clock-to-Q, logic delay and setup time.
  • Adding all pipeline stage delays for the clock period; the slowest single stage sets it.
  • Ignoring the feedback path from a flip-flop's own output to its input when finding the maximum frequency.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Maximum clock frequency

numerical

A flip-flop has tcq=3 ns and tsu=2 ns. The longest combinational path between two such flip-flops is 12 ns. Find the minimum clock period and the maximum frequency (no skew).

  1. Step 1: Add the delays along the path.

    Try it on paper first.

Example 2: A hold violation and its fix

numerical

A path has tccq=1 ns and shortest logic delay tcd=0.5 ns. The capturing flip-flop needs th=2 ns. Is there a hold violation? Will halving the clock frequency help? How much delay must be added?

  1. Step 1: Compute the hold slack.

    Try it on paper first.

Example 3: Effect of clock skew

numerical

For the path of the first example (tcq=3, tpd=12, tsu=2, all in ns), the clock reaches the capturing flip-flop 2 ns later than the launching one. The same path has tccq=1 ns, tcd=4 ns, and th=1.5 ns. Find the new maximum frequency and check hold.

  1. Step 1: Identify the sign of the skew.

    Try it on paper first.

Example 4: Several paths: pick the right one for each check

numerical

Between FF A and FF B there are two paths: an AND gate (2 ns) followed by an XOR gate (3 ns), and a single inverter (1 ns). Take each gate delay as both its maximum and minimum. The flip-flops have tcq=2 ns, tccq=1 ns, tsu=1 ns, th=1.5 ns. Find fmax and the hold slack.

  1. Step 1: Choose the path for setup.

    Try it on paper first.

Previous year questions

1 official GATE EC question on this topic, newest first.

Topic test

9 questions: up to 1 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE EC syllabus; being checked by a reviewer. Updated 2026-11-28. Spotted a mistake? Use Report an issue on any question, or contact us.