Verifying EcrioniX Premium Access...
Multi-bit crossing fundamentals — why independently synchronizing every bit of a bus is a cardinal CDC sin.
As a silicon architect, you already know how to safely pass a single boolean signal across an asynchronous clock boundary: you use a 2-stage (or 3-stage) flip-flop synchronizer. However, one of the most devastating mistakes a junior designer can make is assuming that a multi-bit bus can be safely crossed by simply instantiating a synchronizer for every bit independently.
When multiple signals transition at exactly the same time in Clock Domain A (the transmitter), they must travel across physical wires to reach the synchronizers in Clock Domain B (the receiver). In the physical world of silicon, these wires are never perfectly identical.
Differences in routing lengths, coupling capacitance, and buffer delays introduce a physical phenomenon called skew. This means that mathematically simultaneous transitions in Domain A will arrive at the inputs of Domain B's flip-flops at slightly different times.
Because the receiver's clock is entirely asynchronous to the transmitter's data, there is a statistical guarantee that eventually, the receiver's clock edge will land exactly in the middle of this skewed arrival window. When this happens, some bits of the bus will be captured as their "old" values, while other bits are captured as their "new" values. The result is a corrupted intermediate state that was never actually driven by the sender.
Let's look at a concrete example: a simple 2-bit counter traversing from a 100MHz domain to a 133MHz domain. The design incorrectly uses a 2-flip-flop synchronizer per bit.
// BAD PRACTICE - NEVER DO THIS FOR A BUS!
module bad_multibit_sync (
input wire clk_tx,
input wire [1:0] count_in,
input wire clk_rx,
output reg [1:0] count_out
);
// Two independent synchronizer chains
reg [1:0] sync_stg1;
always @(posedge clk_rx) begin
sync_stg1 <= count_in; // Danger! Independent sampling
count_out <= sync_stg1;
end
endmoduleThe transmitter updates the bus from 01 to 10. This requires bit 1 to flip from 0 to 1, and bit 0 to flip from 1 to 0.
Due to physical placement, the wire for bit[1] is slightly shorter, meaning its transition arrives at the receiver's synchronizer 150ps earlier than the transition for bit[0].
| Time | Transmitter Intended State | Physical Signal at RX FFs | Sampled RX Value (clk_rx edge fires!) |
|---|---|---|---|
| t = 0ps | 01 | 01 | 01 (Safe) |
| t = 800ps | 10 (Launch Edge) | 01 (In Transit) | 01 (Safe) |
| t = 1200ps | 10 | 11 (Bit 1 arrived, Bit 0 late) | 11 (ERROR - Illegal State) |
| t = 1350ps | 10 | 10 (Bit 0 finally arrived) | 10 (Safe again) |
Because the receiver clocked at exactly t = 1200ps, the synchronized output briefly reads 11 (Decimal 3). The counter sequence seen by the receiver was 1 → 3 → 2. This phantom state will crash downstream logic (e.g., FSMs, memory address calculations).
The most dangerous aspect of skewed sampling is that RTL simulations will never catch it. Standard digital simulation assumes ideal, zero-delay wires. In a testbench, all bits of a bus arrive simultaneously, and your logic will simulate perfectly. This bug will lay dormant until the chip is manufactured, tested under specific PVT (Process, Voltage, Temperature) corners, and suddenly starts corrupting data in the field in a non-deterministic, irreproducible manner.
You might be wondering: "If the issue is multiple bits changing simultaneously and arriving at different times, what if we guarantee only one bit changes at a time?"
This is exactly why Gray Code is utilized. In a Gray Code sequence, every valid transition involves strictly one bit flip. If a counter uses Gray Code (e.g., 00 → 01 → 11 → 10), and the clock edge lands precisely when that single bit is in transit, the receiver will either sample the old valid state or the new valid state. There is no intermediate corrupted state.
However, Gray code only solves the skew problem for predictable, monotonic sequences (like counters). You cannot encode arbitrary payload data (like a 32-bit memory address or a network packet) into Gray code, because arbitrary data jumps randomly from value to value, violating the one-bit-transition rule.
Because you cannot sync bits of a bus independently, how do we safely pass multi-bit arbitrary data across a clock domain boundary? In the upcoming lessons, we will master three architectural solutions:
Never instantiate an array of flip-flop synchronizers for a multi-bit bus. Physical skew guarantees that bits will arrive at different times, inevitably leading to catastrophic phantom data states at the receiver.