TDEB Top Bar

Trending
Semiconductor Industry News — The Digital Electronics Blog
Follow Us

TDEB Masthead

The Semiconductor Hub

Semiconductors.  Chips and Systems.  Innovation.

Indexed by leading Search Engines, AI and referenced by Engineers worldwide 500+ Articles 10M+ Pageviews 30+ Reports 50+ Citations

Setup and Hold Times Explained with Formulas

The Editor's Desk
by
0
Share Facebook X LinkedIn WhatsApp Email

The setup time is the time the data inputs must be valid before the clock or strobe signal. The hold time is the time the data must remain valid after the clock or strobe signal. Together they define a small window around each clock edge in which the data must not change.

Setup and hold in plain words

A flip-flop takes a snapshot of its input at the clock edge. Like a camera, it needs the subject to keep still for a moment: a little before the edge (setup) and a little after it (hold). If the data changes inside that window, the flip-flop may capture the old value, the new value, or go metastable and settle late to either one.

  • Setup problems come from data that arrives too late, usually through a long, slow logic path. They get worse as the clock gets faster, and they can be fixed by slowing the clock.
  • Hold problems come from data that arrives too early, usually through a very short path, so the next value races through and overwrites the one being captured. They do not depend on the clock period, so slowing the clock does not fix them. A hold failure on silicon cannot be fixed by changing the frequency.

Zero and negative setup and hold times

Setup and hold times are measured at the pins of a component, but the real storage element sits inside it, behind its own internal data and clock paths. The numbers at the pins depend on how those internal paths compare.

A zero setup time means that the time for the data to propagate within the component and load into the latch is less than the time for the clock to propagate and trigger the latch.

A zero hold time means either that the moment the clock is asserted, the latch no longer looks at its inputs, or that the clock path delay is shorter than the data path delay.

A negative setup or hold time means that there is an even larger difference in path delays, so that even if the data is sent later than the clock (for setup time), it still arrives at the latch first.

Manufacturers avoid specifying negative values since this restricts later design and manufacturing decisions, but they often specify zero values since this simplifies usage in a system.

Where these numbers are used

  • Inside a chip, static timing analysis checks every flip-flop to flip-flop path against both limits at every corner.
  • At chip pins, the data sheet gives setup and hold relative to the input clock pin, which the board designer must meet.
  • In interviews, setup and hold equations with clock skew are among the most common questions for digital design roles.

Common mistakes

  • Trying to fix a hold violation by lowering the clock frequency.
  • Using maximum delays for hold checks or minimum delays for setup checks. Setup uses the slowest data and fastest clock; hold uses the fastest data and slowest clock.
  • Getting the sign of skew wrong. Write down which flop is the launch and which is the capture before adding numbers.
  • Treating a negative hold time on a data sheet as an error. It is legal and means the data may change slightly before the clock edge.

Deep dive: the numbers and details

This part holds the equations, corrected formulas from the original post and worked examples. Skip it if the overview is all you need.

Setup and hold seen from a chip pin

Inside a component, data travels from the data pin to the flip-flop and the clock travels from the clock pin to the same flip-flop. For the pin-level limits, the worst case for setup is slow data and fast clock; for hold it is fast data and slow clock:

  • tSU(chip-pin) = tSU(FF) - Tdelay_clk_min(chip-pin to FF-pin) + Tdelay_data_max(chip-pin to FF-pin)
  • tH(chip-pin) = tH(FF) + Tdelay_clk_max(chip-pin to FF-pin) - Tdelay_data_min(chip-pin to FF-pin)

The setup formula is as in the original post. The hold formula has been corrected: the original used the minimum clock delay and the maximum data delay, which is the setup combination. For hold, a slow clock and fast data make the requirement worst.

Setup and hold between two flip-flops

For a path from a source flop to a destination flop, let clk2Q be the source clock-to-Q delay and Tcomb the logic delay between them. If the source sees the clock at time X and the destination at time Y, define T(clk-skew) = Y - X. With clock period T:

  • Setup check: clk2Q + Tcomb(max) + tSU(FF) <= T + T(clk-skew)
  • Hold check: clk2Q + Tcomb(min) >= tH(FF) + T(clk-skew)

The original post wrote the hold relation as tH(FF) = clk2Q + Tcomb + T(clk-skew). That mixes up the flop's hold time with the path's arrival time and puts the skew on the wrong side. The hold time is a property of the destination flop; the inequality above is the condition the path must meet, with the minimum logic delay, and positive skew makes it harder to meet.

Worked example: register to register

Illustrative values: T = 2.0 ns, clk2Q = 0.15 ns, Tcomb(max) = 1.5 ns, Tcomb(min) = 0.2 ns, tSU = 0.10 ns, tH = 0.05 ns, skew = +0.10 ns (destination clock later).

CheckArithmeticResult
Setup slack(2.0 + 0.10) - (0.15 + 1.5 + 0.10) = 2.10 - 1.75+0.35 ns, met
Hold slack(0.15 + 0.2) - (0.05 + 0.10) = 0.35 - 0.15+0.20 ns, met
Minimum period0.15 + 1.5 + 0.10 - 0.101.65 ns, about 606 MHz

Note that the hold row does not contain T at all, which is why frequency cannot fix hold.

Worked example: pin-level numbers

Suppose inside a chip tSU(FF) = 0.10 ns and tH(FF) = 0.05 ns. The data path from pin to flop is 0.8 ns minimum and 1.2 ns maximum; the clock path is 1.0 ns minimum and 1.4 ns maximum.

  • tSU(pin) = 0.10 - 1.0 + 1.2 = 0.30 ns
  • tH(pin) = 0.05 + 1.4 - 0.8 = 0.65 ns

Now make the data path much shorter than the clock path, 0.3 ns minimum and 0.4 ns maximum, with the clock path at 1.0 to 1.2 ns:

  • tSU(pin) = 0.10 - 1.0 + 0.4 = -0.50 ns, a negative setup time: data may arrive up to 0.5 ns after the clock pin edge and still be captured.
  • tH(pin) = 0.05 + 1.2 - 0.3 = 0.95 ns, a long hold time: the data must be held almost a nanosecond after the clock edge.

The total window, setup plus hold, is 0.95 ns in the first case and 0.45 ns in the second; delaying the clock relative to data only moves the window, it does not remove it. The difference in width comes from the spread between minimum and maximum delays in the two cases, which is why designers keep internal pin-to-flop paths tightly controlled.

Interview angle

  • Expect to be given a path with clock skew and asked whether it meets setup and hold, and what the maximum frequency is. Write the two inequalities first, then substitute.
  • Expect the follow-up "how do you fix a hold violation?": add delay to the data path (buffers or slower cells), or reduce the skew, never by changing frequency.
  • Expect "can setup or hold time be negative?": yes, as shown above, because of internal path differences.

Further reading

The Editor's Desk
About the Author
The Editor's Desk
Share Facebook X LinkedIn WhatsApp Email

Post a Comment

0 Comments

Your comments will be moderated before it appears here.

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn more
Ok, Go it!