
Written and maintained by the PhDino author · Last reviewed 21 September 2026 · Checked against 1 independent reference calculation · how PhDino checks its numbers
The two timing checks that determine whether a synchronous digital circuit will actually work at a given clock speed.
A flip-flop only reliably captures the data at its input if that data has been stable for a minimum time before the clock edge (setup time) and remains stable for a minimum time after the clock edge (hold time). If either requirement is violated, the flip-flop can enter an unpredictable, unstable state (metastability) instead of cleanly capturing a 0 or a 1 — a real failure mode in synchronous digital design, not just a theoretical concern.
Setup checking asks whether data arrives early enough: starting from one clock edge, data has to travel through a launching flip-flop's own clock-to-Q delay, then through any combinational logic between the two flip-flops, and still arrive with enough time left before the next clock edge to satisfy the receiving flip-flop's setup requirement. Hold checking is different in character: it asks whether data changes too soon after the clock edge that just captured the previous value, which is why hold checks depend on the fastest (not slowest) path delay and don't involve the clock period at all.
Setup margin = clock period − (clock-to-Q delay + combinational delay + setup time) Hold margin = (clock-to-Q delay + combinational delay) − hold time
Checks whether data launched by one flip-flop reaches the next in time. The setup margin is what is left of the clock period after the clock-to-Q delay, the logic delay and the setup time; the hold margin is how long the new data takes to arrive beyond the hold time. Positive means the check passes.
Use it for one register-to-register path at a time, the same check a static timing tool repeats on every path of a design. It is the quickest way to see whether a clock speed is realistic and which delay is eating the budget.
A path in a design clocked every 5 ns (200 MHz). The flip-flops have a clock-to-Q delay of 0.6 ns, a setup time of 0.5 ns and a hold time of 0.3 ns, and the logic between them takes 3.6 ns on its slowest path. Does the path meet timing?
| You enter | Value |
|---|---|
| Clock Period | 5 ns |
| Clock-to-Q Delay | 0.6 ns |
| Combinational Logic Delay | 3.6 ns |
| Flip-Flop Setup Time | 0.5 ns |
| Flip-Flop Hold Time | 0.3 ns |
| The calculator returns | Value |
|---|---|
| Setup Margin | 0.3 ns |
| Hold Margin | 3.900 ns |
Worked by hand:
The path passes setup with 0.30 ns to spare, which is thin: clock jitter and skew between the two flip-flops can easily take a few tenths of a nanosecond, and this calculator does not subtract them. The hold check passes comfortably here, but only because it used the same slow logic delay. A real hold check uses the shortest path; if one flip-flop fed the next through a plain wire, the margin would be just 0.6 − 0.3 = 0.3 ns.
A negative setup margin means the data arrives after the window closes at this clock speed: slow the clock, shorten the logic or add a register stage. A negative hold margin is worse, because slowing the clock does not fix it. The new data races through too fast and spoils the value being captured.
The flip-flop may capture the wrong value or go metastable, hovering between 0 and 1 for an unpredictable time before settling. Either can corrupt data further down the line.
Lower the clock frequency, reduce the logic on the path, use faster parts, or split the logic with an extra register (pipelining), which adds a cycle of latency but shortens each stage.
Add delay to the short path, for example with buffer cells, or reduce the clock skew. Changing the clock frequency does not help.
The reciprocal of its minimum period: clock-to-Q plus logic delay plus setup time, before allowing for skew and jitter. For the path above that is 213 MHz.
PhDino earns a commission on qualifying purchases made through this link, at no extra cost to you.
Code: The Hidden Language of Computer Hardware and Software by Charles Petzold — Builds from switches and logic gates up to a working computer, one clear step at a time. (Bookshop.org UK, UK delivery only)
→ The full PhDino bookshelf on Bookshop.org (UK delivery only)
