Setup Time vs Hold Time: Key Differences Explained
Both are timing conditions for a flip-flop to capture data correctly, but they guard in opposite directions. Setup time is how long data must be stable before the clock edge, and checks that data is not too slow. Hold time is how long data must stay unchanged after the edge, and checks that data is not too fast. The setup condition includes the clock period, so slowing the clock fixes it, but hold compares the same edge, so lowering the frequency does not fix it.
| Aspect | Setup time | Hold time |
|---|---|---|
| Definition | The minimum time data must be stable before the active clock edge | The minimum time data must stay unchanged after the active clock edge |
| What it checks | Whether data is too slow: does it arrive in time for the next edge | Whether data is too fast: does new data slip in at the same edge |
| Edges compared | The launch edge and the capture edge one period later | The same edge at launch and capture |
| Delay used for the check | Maximum (max) delay: the slowest path | Minimum (min) delay: the fastest path |
| Condition (rough) | tcq(max) + tlogic(max) + tsu ≤ T + tskew | tcq(min) + tlogic(min) ≥ th + tskew (tskew is positive when the capture clock is late) |
| Relation to clock frequency | The period T appears in the equation. It sets the maximum operating frequency | The period does not appear in the equation. Independent of frequency |
| Effect of clock skew | A late capture clock increases the margin | A late capture clock reduces the margin |
| How to fix violations | Reduce logic levels, switch to stronger or faster low-threshold cells, place cells closer, split the path with pipelining, slow the clock | Insert delay buffers in the data path, switch to slower high-threshold cells, adjust clock skew |
| Corners where violations are likely | Slow conditions: slow process, low voltage, high temperature (in advanced processes, low temperature may be slower) | Fast conditions: fast process, high voltage, low temperature, etc. |
| If found after the chip is made | The chip works if the clock is slowed, at lower performance | Lowering the frequency does not fix it, and the chip does not work correctly. A fix often requires a design change |
Figures are typical orders of magnitude and vary by process generation and product.