Setup and hold timing calculator

For a single flip-flop to flip-flop path, this calculator applies the same reasoning as static timing analysis (STA) to find the setup and hold slack. Change the delays and skew to see which check fails first. All values are in nanoseconds.

Inputs (ns)

Results

Setup slack
–
Hold slack
–
Maximum frequency
–

Met Violated

The top row checks that the latest data arrives before the setup deadline (dashed line); the bottom row checks that the earliest data arrives after the hold deadline. Negative slack means a violation.

The setup check

The latest time new data can reach the capturing flip-flop is the maximum clock-to-Q delay plus the maximum combinational delay. It must arrive before the next capture edge (period plus skew) minus the setup time and clock uncertainty. Setup slack is the deadline minus the arrival time; if it is negative the period is too short, so you must lower the frequency or shorten the logic.

The hold check

Hold asks whether data launched on the same clock edge arrives so quickly that it corrupts the value the capturing flip-flop is still latching. The earliest arrival, the minimum clock-to-Q delay plus the minimum combinational delay, must come after the skew plus the hold time. The clock period does not appear in the hold check, so slowing the clock never fixes a hold violation; tools insert delay buffers on the short path instead.

How skew shifts both checks

When the capture clock arrives later than the launch clock (positive skew), the setup deadline moves out, which helps setup but hurts hold. Negative skew does the opposite. Designers sometimes add skew on purpose to rescue a critical setup path (useful skew), but must re-check hold. Real STA checks every path at its worst case: setup at the slow corner and hold at the fast corner.

Maximum frequency

The period at which setup slack is exactly zero is the minimum period for the path, and its inverse is the maximum frequency: fmax = 1 / (clock-to-Q + combinational delay + setup + uncertainty − skew). A chip's maximum frequency is set by its slowest path, the critical path. Adding pipeline stages shortens the logic per stage and raises the achievable frequency.

Practice logic design questions

Which correctly describes the setup time of a flip-flop?

  1. AThe minimum time data must be held after the clock edge
  2. BThe minimum time the data input must be stable before the clock edge
  3. CThe time from power-on until it starts operating
Show answer and explanation

Answer: B. The minimum time the data input must be stable before the clock edge

For a flip-flop to capture correctly, data must be stable for a certain time before the clock edge—the setup time. A violation occurs if the data-path delay exceeds the clock period minus the setup time, and it can be fixed by slowing the clock. The time data must remain stable after the edge is the hold time. Violating either can capture wrong values or cause metastability.

Which correctly describes the hold time of a flip-flop?

  1. AThe time the data input must be stable before the active clock edge
  2. BThe time from the clock edge until the output changes
  3. CThe time the data input must remain unchanged after the active clock edge
Show answer and explanation

Answer: C. The time the data input must remain unchanged after the active clock edge

Hold time is the minimum time data must stay stable after the clock edge. If the path from one flip-flop to the next is too short, new data launched by the same edge arrives too early and violates hold. Because it does not depend on the clock period, slowing the clock cannot fix it; the remedy is inserting buffers to add delay. A hold violation found after manufacturing can render the chip unusable, so design-time verification is critical.

FAQ

How do you fix setup and hold violations differently?

Setup violations are fixed by lowering the clock frequency, speeding up or restructuring the logic, or adding pipeline stages. Hold violations do not depend on frequency, so they are fixed by adding buffers to increase delay on the short path.

Does clock skew affect setup or hold?

Both, in opposite directions. Positive skew, where the capture clock arrives later, helps setup and hurts hold; negative skew does the reverse.

What is slack in timing analysis?

Slack is the timing margin: the required time minus the actual arrival time. Positive slack means the check passes; negative slack is a violation.

Related terms

Setup time Hold time Clock skew STA (static timing analysis) Metastability Jitter

Semiconductor Calculators

Die per wafer and yield calculatorGross dies, yield (Poisson, Murphy, negative binomial) and cost per good die, with a wafer mapLithography resolution and depth of focus calculatorResolution (half-pitch), depth of focus and pitch splits from wavelength, NA and k1MOSFET I-V characteristics (ID–VDS)Change Vth, W/L and λ and see the ID–VDS curves and the operating point: region, ID, gm and roQuiz set builderPick topics and a question count to get a shareable quiz link for classes and trainingJunction temperature and thermal resistance calculatorJunction temperature, margin to Tj(max) and maximum power from power dissipation and thermal resistanceMemory bandwidth calculatorPeak and effective bandwidth of DDR, LPDDR, GDDR and HBM from transfer rate and bus widthADC SNR and effective number of bits (ENOB)SNR and effective number of bits of an ADC from resolution, clock jitter and oversamplingAmdahl's law and parallel speedupSpeedup and parallel efficiency from the parallel fraction and processor count, by Amdahl's and Gustafson's lawsCache address breakdown and average memory access timeTag, index and offset bits and average memory access time from cache size, line size and associativityCMOS power consumption (dynamic and static)Dynamic and static power from activity factor, capacitance, voltage, frequency and leakage, plus the power after DVFSPN junction built-in potential and depletion widthBuilt-in potential, depletion width, peak field and junction capacitance of a PN junction from doping and reverse biasThermal oxide thickness (Deal-Grove model)Silicon oxide thickness and consumed silicon from temperature, time, dry or wet ambient and orientation, using the Deal-Grove modelOn-chip interconnect RC delayWire resistance and capacitance, distributed RC delay and delay with driver and load from metal, width, thickness, spacing, dielectric constant and lengthPhase noise to RMS jitter conversionIntegrate a phase-noise profile in dBc/Hz to get a clock's RMS phase error and RMS jitterPDN target impedance and decoupling capacitorsTarget impedance from supply voltage, allowed ripple and current step, plus the self-resonant frequency and effective band of decoupling capacitors