Setup / Hold Timing Calculator

Check the setup and hold margins of a register-to-register path from the clock period, clock-to-out time, logic delay, setup and hold requirements and clock skew, and find the fastest clock it can run at.

Calculator Electronics Updated Oct 15, 2026
How to Use
  1. Enter the clock period (for example 10ns for 100 MHz).
  2. Enter the launching flip-flop's clock-to-output time tCO and the logic and routing delay tdata to the next flip-flop.
  3. Enter the receiving flip-flop's setup time tSU and hold time tH.
  4. Enter the clock skew: positive if the clock reaches the receiving flip-flop later than the launching one.
  5. Read the setup and hold slack (both must be zero or more) and the maximum clock frequency for this path.
Input
Presets
Timing
Setup margin
—
Hold margin
—
Max fclk
—
Status
—

Worked Example

A path runs at 100 MHz (10 ns period): clock-to-out 2 ns, logic 5 ns, setup 1 ns, hold 0.5 ns, and the receiving clock arrives 0.2 ns late. Setup slack = 10 − 2 − 5 − 1 + 0.2 = 2.2 ns. Hold slack = 2 + 5 − 0.5 − 0.2 = 6.3 ns. Both are positive, so the path passes.

Maximum clock: the path needs 2 + 5 + 1 − 0.2 = 7.8 ns, so fmax = 1 ÷ 7.8 ns = 128 MHz. At 150 MHz (6.67 ns) the setup slack goes to −1.1 ns and it fails.

The common mistake: treating every timing failure the same way. A setup failure can be fixed by slowing the clock; a hold failure cannot, because the clock period is not in the hold equation. Adding skew to rescue setup takes the same time away from hold.

Show Work

Enter values to see the timing margin calculation.

Formulas

Setup Margin
T − tCO − tDat − tSU + skew ≥ 0
Data path must settle before next edge.
Hold Margin
tCO + tDat − tH − skew ≥ 0
Data must stay stable after edge.
Max Clock Frequency
fmax = 1 / (tCO + tDat + tSU − skew)
Limit imposed by longest path.
Positive Skew
Helps setup, hurts hold
Destination clock arrives later.
Negative Skew
Helps hold, hurts setup
Destination clock arrives earlier.
Metastability MTBF
e(tr/τ) / (fclk·fdata·τ)
Rises exponentially with resolution time.

History of Setup/Hold Timing Analysis

The concepts of setup time (tSU) and hold time (tH) emerged from flip-flop datasheets in the late 1960s as TTL logic became fast enough that timing violations became practical concerns. Thomas Chaney and Charles Molnar's 1973 paper "Anomalous behavior of synchronizer and arbiter circuits" demonstrated metastability experimentally — what happens when setup/hold times are violated and the flip-flop enters an indeterminate state.

Static timing analysis (STA) as a formal method was developed at IBM by Robert Hitchcock and colleagues around 1980. Their algorithms propagated earliest-arrival and latest-arrival times through combinational logic and flagged any register-to-register path where tCO + tDat + tSU exceeded the clock period. This became the standard timing closure methodology for custom ASICs and later FPGAs; every modern chip and FPGA design flow runs exhaustive STA as part of the build.

Clock skew — the difference in clock arrival times between source and destination flip-flops — was originally a bug to minimize, but it turned out to be usefully manipulable. "Clock skew scheduling" techniques deliberately introduce calculated skew to balance setup and hold margins on critical paths, effectively time-borrowing between pipeline stages. Modern high-performance CPUs exploit this aggressively.

About This Calculator

Enter clock period T, clock-to-output delay tCO, combinational data path delay tDat, destination register setup/hold times tSU/tH, and clock skew. The tool computes setup margin, hold margin, maximum achievable clock frequency, and pass/fail status.

Positive margins = safe design; negative margins = timing violation that will cause metastability or outright functional failure. For mission-critical designs, add 10–20% margin to cover PVT (process, voltage, temperature) variation — the datasheet values are nominal, and corner-case silicon at worst-case voltage and hottest operating temperature can add 20–30% to all delays. All math runs client-side.

Frequently Asked Questions

What are setup and hold times?

Setup time is how long the data must be stable before the clock edge; hold time is how long it must stay stable after it. If the data changes inside that window, the flip-flop may capture the wrong value or go metastable.

What is metastability?

When setup or hold is violated, a flip-flop can hang between 0 and 1 for an unpredictable time before settling. Circuits that sample signals from another clock domain use two or more flip-flops in a row (a synchronizer) to give it time to resolve.

Which way does skew count?

Skew here is the receiving clock's arrival minus the launching clock's. Positive skew gives the data more time, helping setup, but by the same amount it eats into hold. That trade is why skew is never a free fix.

Can I fix a hold violation by slowing the clock?

No. Hold slack does not depend on the clock period at all: it is a race between the fastest data path and the clock arriving at the next flip-flop. Hold problems are fixed by adding delay to the short path or reducing skew; setup problems by shortening the logic or slowing the clock.

How is the maximum frequency worked out?

The path needs tCO + tdata + tSU − skew per cycle, so fmax = 1 ÷ that sum. The slowest such path in the whole design sets the chip's clock limit.

How do I use the Setup / Hold Timing Calculator?

Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Does it cost anything or need an account?

No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.

Is anything I type uploaded?

No. The tool works entirely on your device, so the values you enter never leave your browser.

Common Use Cases

FPGA Timing Closure

Check a critical path by hand when the timing report fails, to see whether the logic, the routing or the clock skew is the problem.

Discrete Logic and Board-Level Buses

Chips on different parts of a board see different clock arrival times; include the trace delay of the clock and data in skew and tdata.

Choosing a Clock Frequency

The fmax result shows how fast a pipeline stage can run, and how much faster it could go if one stage is split.

Teaching Synchronous Design

Change one delay at a time to see why setup depends on the clock period and hold does not.

Last updated: