Setup and Hold in 60 Seconds
Every flip-flop makes a promise: show me stable data around the clock edge and I will capture it correctly. Setup and hold are the fine print.
1 Slide the data through the window
The 3D scene is a clock edge (yellow wall) with a setup zone before it and a hold zone after it. Move the data marker and watch the flop’s output.
2 What happens inside the window
Inside the setup or hold window the flop’s internal nodes are caught mid-change. The output can hover between 0 and 1 for a while (metastability) and then fall to either value. You cannot predict which. A real chip may work on one die and fail on another.
Why two checks?: Setup protects against data that is late. Hold protects against data that is too early: the next value racing through before the current one has been captured.
3 Check a real path
One flop launches data, logic delays it, and a second flop captures it. Change the numbers and see both slacks. A negative slack is a violation.
- Setup:
T + skew ≥ Tcq + Tlogic(max) + Tsetup - Hold:
Tcq + Tlogic(min) ≥ skew + Thold - Setup uses the longest path, hold uses the shortest. Setup depends on the period T, hold does not.
4 Check yourself
1. A path has a hold violation. Which change helps?
2. Which change fixes a setup violation?
3. Positive skew (capture clock later than launch clock) does what?
Cheat sheet
Keep going: STA & Setup/Hold quiz · Timing Diagram Editor · the async FIFO read