Choosing CDC Techniques for Multi-Clock Digital Systems
System DesignModel answerLast updated
Explain the failure modes at clock domain crossings and select the right synchronization technique for single-bit signals, events, and multi-bit data transfers.
Background
Modern digital systems often contain subsystems clocked at different frequencies with no fixed phase relationship — a high-speed processor core, a low-speed peripheral bus, an audio interface, and an image sensor might all share the same chip. Any time a signal travels from one clock domain to another, a straightforward register transfer is not safe.
You have four CDC mechanisms available:
- Two-stage flip-flop synchronizer — two (or more) back-to-back registers clocked in the destination domain
- Toggle/edge-detect synchronizer — converts a source-domain pulse into a level crossing, then regenerates a pulse in the destination domain
- Request/acknowledge handshake — the source holds data stable while a control signal makes a round trip through both domains
- Asynchronous FIFO — a dual-port memory with independently clocked read and write sides, coupled through Gray-coded pointer synchronization
What you are asked to explain
-
Why crossings are dangerous. What failure modes exist when a signal crosses an unsynchronized clock boundary? Name at least two distinct problems and explain the mechanism behind each.
-
When to reach for each technique. For each of the four options above, describe the type of signal or traffic pattern it is designed for. Use concrete scenarios — for example, a one-bit control flag, a "transfer complete" interrupt, a configuration register write, or a pixel stream — to anchor your answer.
-
The cost of each choice. Compare the four techniques across reliability, latency, throughput, and logic area. Identify which technique is the cheapest acceptable option for each scenario, and explain what goes wrong if you pick the wrong one.
A strong answer is structured, uses numbers where they help (cycle counts, FIFO depth formulas, MTBF intuition), and calls out the pitfalls that a design would silently pass simulation but fail in silicon.
Hints
Hint 1
Before picking a technique, separate the problem into three distinct failure modes: metastability, missed or duplicated pulses, and multi-bit incoherence. Each failure mode points to a different solution.
Hint 2
Ask yourself two questions about every signal: Is it one bit or many? Is it a level (persists until changed) or an event (a momentary pulse)? Those two axes — width and duration — narrow the choice to one or two candidates.
Hint 3
For the async FIFO, think through how the read and write pointers cross domains safely. Why Gray code? What does 'pessimistic full/empty' mean, and why is pessimism the safe direction? What determines the minimum depth for a bursty source into a slower reader?
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Why clock domain crossings fail
Three distinct failure modes show up at clock boundaries, and they require different fixes.
Metastability. Every flip-flop has a setup-and-hold window around its clock edge. If the input changes inside that window, the output can sit between logic 0 and logic 1 for an unbounded time before resolving. You cannot prevent this from ever happening — with independent clocks, every phase relationship eventually occurs. What you can do is give the output time to settle before any downstream logic samples it. The metric is mean time between failures:
MTBF = e^(t_r / τ) / (T0 · f_clk · f_data)
Each additional synchronizer stage donates roughly one destination clock period to the resolution time t_r, and because t_r appears in an exponent, MTBF grows exponentially with stage count. Two stages is the minimum; three is common for fast clocks.
Missed or duplicated pulses. A pulse that lasts one source clock cycle may be completely invisible to a slower destination clock — there are no destination edges while the pulse is high. Conversely, a short level held across many destination cycles can look like multiple events if the consumer expects a single pulse. The synchronizer must convert short events into a form that cannot be missed.
Multi-bit incoherence. If you run each bit of a bus through its own 2-FF synchronizer, routing delay and per-bit metastability resolution times differ. A transition from 0111 to 1000 can be captured as 1111, 0000, or any other spurious value. Any multi-bit transfer needs a scheme that guarantees the captured word was a legal, self-consistent value.
When to use each technique
Two-stage flip-flop synchronizer
Best for a single-bit level signal that changes slowly relative to the destination clock. The source flip-flop must be driven from registered logic — not combinational — so the signal is glitch-free. The signal must also remain stable long enough to be seen: a practical rule is at least 1.5 destination clock periods, often stated as "visible for at least three destination edges."
Concrete example: a software-controlled dma_enable bit written in a 100 MHz APB domain, consumed by a 1 GHz core. Two destination-domain flops in series. Add a third if the process has a large metastability time constant τ.
Wrong use: applying this per-bit to a multi-bit bus, which produces incoherent captures.
Toggle/edge-detect synchronizer
Best for single-bit events — something happened, and the destination domain needs to know about it exactly once. The mechanism: the source toggles a flip-flop on each event (storing the event as a level change rather than a pulse), that level crosses via a 2-FF synchronizer, and an XOR between the synchronized value and a one-cycle-delayed copy regenerates a single pulse in the destination.
This works from fast-to-slow domains because the toggle persists until seen. The constraint is that two events must be separated by at least two to three destination clock cycles; if events can arrive back-to-back faster than that, the scheme silently drops one.
Concrete example: a 500 MHz sensor signaling "line capture complete" once every several thousand cycles to a 100 MHz image processor.
Request/acknowledge handshake
Best for occasional multi-bit transfers where you need guaranteed delivery and flow control. The source places data on a held bus and asserts req. The destination synchronizes req, captures the (now stable) bus, then asserts ack back. The source deasserts req only after seeing the synchronized ack.
The bus itself is not synchronized — it is sampled only after the synchronized req has been stable, so the bus has been settled for multiple cycles by then. This is safe. Round-trip latency is roughly four to ten destination cycles, which is fine for rare transfers. A 2-phase (toggle) variant halves the round trip versus the 4-phase (level) variant.
Concrete example: a 1.2 GHz CPU writing a new gain coefficient into a 24.576 MHz audio block once per audio frame.
Wrong use: streaming data — one word per round trip is far too slow for anything resembling a pipeline.
Asynchronous FIFO
Best for sustained or bursty multi-bit streams where the two sides operate at different average rates. The dual-port RAM is written in the source domain and read in the destination domain. Read and write pointers are encoded in Gray code (only one bit changes per increment) before each is 2-FF synchronized into the opposite domain. Full and empty flags are derived from these synchronized, slightly stale pointers, which makes them pessimistic: the FIFO may briefly think it is full or empty when it is not, but it will never overflow or underflow — the safe failure direction.
The required depth for a burst of B words written at rate f_w and drained at rate f_r is at least:
depth ≥ B · (1 − f_r / f_w) + synchronizer_latency_entries
If the average write rate exceeds the average read rate permanently, no depth helps — you need upstream backpressure. Depth must be a power of two for Gray-code wrap-around to work correctly.
Concrete example: a camera interface writing 64-bit pixels at 150 MHz in bursts of 1024 words into an image processor reading at 100 MHz.
Comparing the four options
| Technique | Reliability | Latency | Throughput | Area |
|---|---|---|---|---|
| 2-FF synchronizer | High MTBF for 1-bit levels; broken for buses | 2–3 dest cycles | Slow-changing only | 2–3 flops |
| Toggle/edge-detect | Safe if inter-event gap ≥ ~3 dest cycles; silently drops events otherwise | 2–3 dest cycles | ~1 event per 3 dest cycles | ~4 flops + XOR |
| Req/ack handshake | Guaranteed delivery; any frequency ratio | ~4–10 cycles per word | 1 word per round trip | Data hold reg + ~6–8 flops |
| Async FIFO | Coherent multi-bit, full flow control | ~3–5 cycles (pointer sync) | Up to 1 word/cycle per side | Largest: RAM + Gray logic |
The governing principle is cheapest correct choice. A FIFO on a mode bit wastes area; a per-bit 2-FF synchronizer on a data bus is functionally wrong. The handshake vs. FIFO decision is purely about throughput: if data arrives far less often than one round trip, use the handshake; if it is streaming, use the FIFO.
Common mistakes to name explicitly
- Synchronizing a bus bit-by-bit — passes RTL simulation because simulators have zero routing skew, fails in silicon.
- Driving a synchronizer from combinational logic — any glitch on the combinational path can propagate as a false metastability event or a phantom edge.
- Assuming a 2-FF synchronizer handles fast pulses — a pulse shorter than ~1.5 destination periods is invisible; use a toggle synchronizer instead.
- Sizing FIFO depth for average rate only — burst behavior, not average throughput, sets the required depth.
- Forgetting reconvergence — two separately synchronized signals that feed the same downstream logic can arrive one cycle apart, creating illegal intermediate states that look correct in isolation.