Clock Domain Crossing Interview Questions: CDC, Synchronizers, and Metastability
In-depth clock domain crossing interview questions and answers covering metastability, two-flop synchronizers, multi-bit CDC, async FIFOs, Gray-code pointers, and common CDC bugs.
Clock domain crossing (CDC) is the single most common cause of silicon bugs that make it past simulation. Every mid-to-senior hardware interview — ASIC, FPGA, or SoC — will ask about it. This guide walks through the questions that actually get asked, with answers that distinguish between a surface-level recitation and a real understanding of the physics and the design patterns.
If you want a broader interview overview first, see our 50 VLSI interview questions guide and the STA companion piece that covers setup/hold timing in detail.
Why CDC comes up in every interview
Modern SoCs routinely contain dozens of asynchronous clock domains — CPU, DDR, PCIe, Ethernet, SPI, debug, always-on. Any time two unrelated clocks share a signal, metastability is a physical inevitability unless the design explicitly handles it. Interviewers use CDC questions to tell apart candidates who have built an async FIFO from candidates who have only read about one.
Beginner-level CDC questions
Q1. What is metastability and why does it happen?
Metastability occurs when a flip-flop samples a data input that violates its setup or hold window. The internal node — typically the output of the master latch — settles toward neither a clean logic 0 nor a clean logic 1. It balances at an intermediate voltage, where it can remain for a non-deterministic time before resolving in either direction.
The physical mechanism is simple: a flip-flop is a bistable storage cell with two stable energy minima. Between them is a saddle point. If the input is still in transition when the clock edge arrives, the cell gets pushed onto the saddle rather than into one of the wells. Noise eventually knocks it off — but when is governed by an exponential distribution.
The relevant number is the resolution time constant τ. Modern flip-flops have τ in the low picoseconds (often 20 – 50 ps). The probability that a metastable event has not resolved after time t is proportional to e^(−t/τ).
Q2. What is a two-flop synchronizer and when is it sufficient?
A two-flop synchronizer places two back-to-back flip-flops in the destination clock domain. The incoming asynchronous signal is sampled by the first; its output feeds the second. The second stage's output is what downstream logic consumes.
It is sufficient for a single-bit control signal whose value may be sampled one cycle later than the source generated it. Classic uses: interrupt request lines, reset release, single-bit enables, status flags.
It is not sufficient for:
- Multi-bit buses — different bits may cross on different cycles, giving a transient "impossible" value
- Pulse signals that must be reconstructed exactly in the destination domain (use a toggle encoding instead)
- Any signal where the source domain expects an acknowledgment
Q3. How is MTBF for a synchronizer calculated?
The mean time between metastability failures is:
MTBF = e^(T_r / τ) / (f_clk × f_data × T_w)Where:
T_r— resolution time budget (slack from end of first synchronizer flop to next clock edge)τ— resolution time constant of the flop (library spec)f_clk— destination clock frequencyf_data— frequency of input transitionsT_w— metastability window (also a library spec, often ~10 – 100 ps)
Typical modern libraries at 1 GHz with proper τ give MTBF numbers measured in centuries to the age of the universe. The second flop in a two-flop synchronizer is what buys you those extra decades of MTBF per added stage.
Q4. Why not just add many more synchronizer stages?
Each extra stage adds one cycle of latency on the control path. For a request/acknowledge handshake running at 500 MHz, each extra stage adds 2 ns of round-trip time — significant for short interactions. Three stages is the usual maximum unless the MTBF math forces more (aggressive process nodes, or tiny τ margins).
More importantly, the two-stage choice reflects the fact that MTBF is already astronomical by the second stage for well-designed flops. Adding a third stage is defensive engineering, not required by physics.
Medium-difficulty CDC questions
Q5. How do you safely pass a multi-bit value across clock domains?
Three standard patterns:
(a) Bus with handshake. The source asserts data_valid alongside the stable bus; the destination synchronizes data_valid, captures the bus when valid is high, and asserts data_ack back through its own synchronizer. The source holds the bus stable until it sees the acknowledgment. This handles arbitrary clock-frequency ratios but adds 4 – 6 cycles of latency per transfer.
(b) Gray-code pointer. Used inside async FIFOs. Successive values differ in exactly one bit, so a sampling edge during the transition captures either the old or the new value — never an invalid in-between. Ideal for pointers and monotonic counters.
(c) MUX-synchronized bus. The source latches the bus and generates a toggle signal. The destination synchronizes the toggle, detects its edge, and on that edge samples the (now-stable) bus directly. Lower latency than a handshake but requires the source to hold the bus stable until the destination acknowledges, usually through a return handshake or a known timing budget.
Q6. Why does an async FIFO use Gray-coded pointers?
Inside an async FIFO, the write pointer is generated in the write clock domain and must be sampled in the read clock domain to produce the empty flag, and vice versa for full. If the pointers were binary-coded, a sampling edge during a multi-bit transition (say 0111 → 1000) could capture an intermediate value like 0101 or 1111 — not an adjacent count. The empty/full flags would briefly report a wildly wrong depth.
Gray code guarantees only one bit changes per increment, so any sampling edge captures either the pre-transition value or the post-transition value — both of which are legal pointers that differ by exactly one count.
Q7. How does the empty/full flag logic handle the extra bit in async FIFO pointers?
The pointers are one bit wider than log₂(depth). For a 16-entry FIFO, pointers are 5 bits. The lower 4 bits address the memory; the extra MSB acts as a wrap flag.
For binary-coded pointers (used internally in the same clock domain for address arithmetic):
emptywhen the two pointers are fully equal (same index, same wrap bit)fullwhen the indices match but the wrap bits differ (writer has lapped the reader)
For Gray-coded pointers crossing between the write and read clock domains — the actual production FIFO pattern — the comparison is modified because Gray-coded (depth) is not the simple binary-bitflip of Gray-coded 0. The standard Cliff Cummings pattern is:
emptyon the read side:rptr_gray == wptr_gray_synced(fully equal)fullon the write side:wptr_gray == { ~rptr_gray_synced[N-1:N-2], rptr_gray_synced[N-3:0] }— the top two bits of the synchronized read pointer are inverted, not just one
The two-bit inversion is a quirk of how Gray coding wraps around: in binary, the full/empty distinction is "wrap bit differs"; in Gray, the two most-significant bits must differ to encode the same "half-cycle-ahead" relationship.
Without the wrap bit, full and empty would be indistinguishable — both would just be "pointers equal."
Q8. What is a pulse synchronizer and when do you need one?
A pulse synchronizer converts a single-cycle pulse in a fast clock domain into a reliable one-cycle pulse in a slower (or unrelated) domain. The challenge: a two-flop synchronizer on the raw pulse may miss it entirely if the destination clock is slower, because the pulse is gone before the destination edge arrives.
The standard pattern:
- In the source domain, use the pulse to toggle a flip-flop, producing a level signal that persists.
- Pass that toggle through a two-flop synchronizer into the destination domain.
- In the destination domain, detect the edge (XOR with a one-cycle delayed copy) to regenerate a one-cycle pulse.
This works for arbitrary source/destination frequency ratios as long as the source pulses are far enough apart that the destination has time to see the toggle resolve.
Advanced CDC questions
Q9. What is the CDC-related failure mode of a reset release, and how do you fix it?
The failure: the reset signal is driven by an external pin or by a different domain; when it de-asserts, that de-assertion edge may violate the recovery or removal window of flops in the local domain. One or two flops in the design come out of reset one cycle later (or metastable, in rare cases), leaving the state machine in a nonsense initial state.
The standard fix is asynchronous assertion with synchronous de-assertion: the reset is asserted immediately (asynchronously, often through the flop's async reset pin), but its de-assertion edge is routed through a two-flop synchronizer on the destination clock. The de-assertion becomes synchronous to the local clock and no longer violates recovery/removal.
Every clock domain needs its own synchronized reset tree.
Q10. What CDC bug does the following code exhibit?
always @(posedge clk_fast) begin
if (req_fast)
data_latched <= data_fast;
end
always @(posedge clk_slow) begin
data_out <= data_latched; // single-flop sample across domains
endThree bugs:
- Single-flop synchronization on
data_latchedprovides essentially no metastability protection. - No handshake —
clk_slowmay sampledata_latchedwhileclk_fastis in the middle of writing it (setup/hold violation on a multi-bit latch). - Multi-bit CDC without Gray code or handshake — the slow domain may see a mix of old and new bits.
The correct approach: either implement a full req/ack handshake with single-bit synchronizers on req and ack, or route the data through a proper async FIFO. The source must not update data_latched between request-issued and acknowledgment-received.
Q11. Your CDC lint tool flags a "pre-synchronizer combinational logic" warning. What is it complaining about?
CDC lint tools require that the signal entering the first synchronizer flop come from a single source flip-flop in the source domain with no glitch-generating combinational logic in between. Pure fanout buffers are usually allowed; any multi-input combinational node — a gate, a mux, an XOR — is flagged.
The hazard: multi-input combinational logic can glitch during data transitions because each input arrives with slightly different timing. A glitch on the synchronizer's D input that happens close enough to the destination clock edge can be captured as a spurious pulse. Once captured, the two-flop synchronizer propagates it faithfully — the downstream logic has no way to distinguish it from a real transition.
The fix: register the combined signal in the source domain first, so the synchronizer input comes from a single stable flop-Q output. No multi-input combinational logic between the source flop and the synchronizer flop.
Q12. How do you verify CDC in simulation?
Static CDC checking is mandatory — tools like Spyglass CDC, Questa CDC, or JasperGold CDC analyze the netlist and flag unsafe crossings without needing simulation. But static checks aren't sufficient for functional verification of the synchronizer behavior.
For dynamic verification:
- Metastability injection — a simulation plug-in that randomly delays the resolution of flops on the synchronizer path, forcing the testbench to tolerate non-determinism on the exact cycle the synchronized signal appears
- Jitter on the asynchronous clock — makes the sampling edges non-deterministic relative to the source data
- Protocol checkers on the handshake — e.g., SVA assertions that
reqis held untilack, thatackonly follows areq, that pointers only differ by one bit per cycle
A verification plan that only tests CDC at the designer's hand-picked frequency ratios misses the real failure mode, which is at random phase relationships.
Common mistakes to avoid in interviews
-
Confusing "glitch filtering" with "CDC." A two-flop synchronizer does not filter glitches — it filters metastability. Glitches on the input signal pre-sample must be eliminated structurally, by not having combinational logic before the synchronizer.
-
Claiming synchronizers "solve metastability." They reduce its probability to astronomically small values. They do not eliminate it. Interviewers want you to say "MTBF" and quote a number.
-
Using a two-flop synchronizer on a bus. This is the most common whiteboard error. If an interviewer draws
data_bus[7:0]into a two-flop synchronizer, that is a trap question — point out the multi-bit sampling hazard. -
Forgetting the wrap bit on async FIFO pointers. Without it, full and empty are indistinguishable, and the depth logic is broken.
-
Thinking SRLs or shift registers can replace proper CDC flops. SRL primitives in some FPGA libraries do not meet the metastability spec of dedicated DFF synchronizer cells. Always use the vendor-blessed synchronizer macro or library cell.
Practice these topics
Build CDC and synchronizer intuition
ChipPrep has hands-on CDC design questions, waveform-reading problems, and async FIFO architecture challenges — all with graded solutions.
Related reading
- RTL design interview questions — sequential logic, pipelining, and the RTL anti-patterns that break CDC
- ASIC verification interview questions — SVA and CDC coverage
- FPGA engineer interview questions — CDC on FPGA fabric
- STA interview questions: setup time, hold time, and clock skew
- 50 VLSI interview questions
- SystemVerilog interview questions