Search This Blog

Monday, 3 August 2026

Understanding Metastability and Clock Domain Crossing (CDC)

If you’ve taken a digital logic class, you know the golden rule: everything happens on the clock edge. Your flip-flops read the input, store the state, and pass it to the next logic gate in perfect synchronization.

But what happens when your design has more than one clock?

In modern ASICs and FPGAs, a single chip might have a 1GHz processor, a 400MHz memory controller, and a 50MHz UART interface. When data needs to move between these independent clock domains—a process known as Clock Domain Crossing (CDC)—the perfect synchronization of the classroom goes out the window, and you enter the dangerous territory of Metastability. 

The Setup and Hold Violation 

To understand metastability, we have to look at the physical physics of a flip-flop. For a flip-flop to reliably capture a 1 or a 0, the data signal must be stable for a specific amount of time before the clock edge (Setup Time) and remain stable for a specific amount of time after the clock edge (Hold Time).

When data crosses from Domain A (e.g., 100MHz) to Domain B (e.g., 33MHz), Domain B's clock has no idea when Domain A's data is changing. It is almost guaranteed that eventually, Domain B's clock will tick exactly at the moment Domain A's data is transitioning between a 0 and a 1.

This violates setup and hold times, causing the flip-flop to go metastable.