Setup and hold times are the bottom line that keeps a flip-flop sampling correctly; violating them yields wrong data or metastability. This page defines both windows, gives typical numbers and shows how to stay clear of them.
Setup time t_su is the minimum time the data D must already be stable before the active clock edge. For a 74LS74 it is about 20ns, meaning D may not change during the last 20ns before the edge. If D is still moving inside that window the flip-flop can sample an intermediate level, the output becomes undefined and the device may enter metastability, hanging between high and low.
Hold time t_h is the minimum time D must stay stable after the clock edge, about 5ns on a 74LS74. It guarantees the internal structure has grabbed the data. If D is withdrawn too early after the edge the grab fails and the sample is wrong. t_su guards stability before, t_h after; together they bound the legal sampling window.
How to stay safe: design the clock tree so the skew between flip-flops stays below t_h, otherwise a downstream stage changes before an upstream one has been captured. Combinational delays must satisfy longest path plus t_su less than the clock period. On fast boards run static timing analysis path by path instead of trusting gut feeling; window violations show up as rare wrong numbers or outright lockups.
| Parameter | Definition | Typical | Violation result |
|---|---|---|---|
| t_su | Stable before edge | About 20ns | Metastable or wrong sample |
| t_h | Stable after edge | About 5ns | Grab fails |
| t_pd | Output delay | About 25ns | Timing shift |
| Skew | Clock arrival difference | Below t_h | Hold violation |
| Period | Clock interval | Above path plus t_su | Setup violation |
| STA | Static analysis | Path by path | Finds trouble early |
After routing the board run timing analysis and confirm positive margin on setup and hold for every path. Keep clock skew under t_h, and be extra careful at high speed.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Digital circuit timing per GB/T 4728 and IEC 60748 series. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.