Skip to main content...
S2 · Verilog RTL Design
30 min

Day 78: The 2-FF synchronizer and the CDC rules you can recite

The 2-FF synchronizer and a short list of CDC rules are the toolkit. Recite them and you'll never ship a CDC bug.

The 2-FF synchronizer and CDC rules

The workhorse is the 2-flip-flop synchronizer: two flip-flops in the destination clock domain, the first absorbing metastability, the second delivering a resolved bit (Stage 0). Around it sits a set of CDC rules — from the Cummings papers — that you should be able to recite and point to in your own design.

The canonical 2-FF synchronizer
module sync2 (
    input  clk_dst, rst_n,
    input  d_async,          // from another clock domain
    output q_sync
);
    reg s1, s2;
    always @(posedge clk_dst or negedge rst_n)
        if (!rst_n) {s2, s1} <= 2'b00;
        else        {s2, s1} <= {s1, d_async};
    assign q_sync = s2;      // metastability-resolved
endmodule
  1. Synchronize every single-bit control signal crossing domains with a 2-FF synchronizer
  2. Never synchronize a multi-bit bus bit-by-bit — use gray code or a handshake
  3. Never let a synchronized signal fan out to two synchronizers (they may disagree)
  4. Pass multi-bit data via an async FIFO (gray pointers) or a req/ack handshake with stable data
  5. Keep synchronizer flip-flops physically close (a Stage-6 constraint) to maximize resolution time

Recite them in the interview

'Explain every Cummings CDC rule and where your design applies it' is a named Stage-2 exit criterion. Being able to *point at your async FIFO and say why the pointers are gray-coded*, or *at your control synchronizer and say why it's 2-FF* is exactly the concrete, applied knowledge that lands DV and RTL offers.

Before moving on, you should be able to

Why must you avoid letting one asynchronous signal feed two separate synchronizers?

We use cookies

We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Learn more

    Day 78: The 2-FF synchronizer and the CDC rules you can recite | RBTechIconX