The setup time (tsu) is how long before a clock edge a flip flop's data input must already be steady.
Why it exists: a flip-flop is not an ideal camera. Inside, it takes a little time for the new value to settle into its internal feedback loop. If D is still changing just before the edge, the flip-flop may capture the old value, the new value, or neither cleanly.
Setup time pairs with hold time, the time D must stay steady after the edge. Together they form a small window around each edge:
- from (edge − tsu) to (edge + th), D must not change.
If D changes inside that window, the flip-flop may capture the wrong value or enter metastability, hovering between 0 and 1 before settling unpredictably.
What it means for design: the logic feeding D must finish its work at least tsu before the next edge. That sets the fastest safe clock. The setup constraint in the timing topic turns this into a formula for the minimum clock period.
Typical values are tens to hundreds of picoseconds inside a chip, and a few nanoseconds for discrete logic parts.