Timing Analysis
Every flip-flop needs data to be stable around the clock edge — not just at the exact instant, but for a small window before and after. Violate that window and the output becomes unpredictable.
Why? A flip-flop is a physical circuit that needs time to reliably decide whether the input is 0 or 1. If the input is still changing when the flip-flop tries to sample it, the internal voltage can get stuck between the two valid levels — a dangerous condition called metastability.
1. Propagation Delay ()
After the clock edge captures D, Q does not change instantly — it takes a small delay for the signal to propagate through the flip-flop's internal gates.
- is the clock-to-Q delay — typically 5–15 ns for standard logic families.
- A 74HC74 has .
Worked example
If and the clock period is 100 ns, Q settles just 10 ns after the edge — leaving 90 ns of margin before the next edge.
2. Setup Time ()
Data must be stable before the clock edge arrives — the flip-flop needs time to "read" the input before it latches.
- D must not change during .
- Typical: for a 74HC74.
Setup time defines the deadline: data must arrive and settle before the clock edge by at least .
What happens when setup time is violated?
When D changes too close to the clock edge, the flip-flop cannot reliably resolve whether D was 0 or 1 — the output wobbles before eventually settling to a random value.
3. Hold Time ()
Data must also remain stable after the clock edge — the flip-flop needs a brief moment to finish latching the value.
- D must not change during .
- Typical: . Many modern FFs have , but never assume this without checking the datasheet.
Hold violation
4. Maximum Clock Frequency
The clock period must be long enough for Q to settle (propagation delay) and for the next flip-flop to see stable data (setup time).
Worked example
, :
Pipeline timing
When combinational logic sits between two flip-flops:
Example: FF1 ( ns) → adder ( ns) → FF2 ( ns):
→
5. Metastability — Why Timing Matters Physically
A flip-flop is built from cross-coupled gates that have two stable states (0 and 1). When setup or hold time is violated, the internal voltage gets stuck between these states — like a ball balanced on the top of a hill.
Eventually it will fall to one side, but how long it takes is unpredictable — it could be nanoseconds or microseconds. During this time, the output is neither a valid 0 nor a valid 1, and downstream logic may interpret it differently, causing cascading errors.
- Metastability can cause intermittent, hard-to-debug failures in digital systems.
- Synchronizer circuits (two flip-flops in series) reduce the probability but never eliminate it entirely.
- This is why every signal crossing between clock domains must pass through a synchronizer.