KatInterview

Choosing CDC Techniques for Multi-Clock Digital Systems

System DesignModel answer
MediumModel answerSystem Designdigital-designclock-domain-crossingmetastability

Last 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

  1. 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.

  2. 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.

  3. 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?