CDC Course / Module 3: Synchronization Techniques
Lesson 3.2

The Handshake-Based Synchronizer

The two-flop synchronizer from Lesson 3.1 has a hard limit: it only trusts a single bit. Put a multi-bit bus through independent two-flop synchronizers and different bits can resolve on different clock edges — the receiver briefly sees a value that was never actually driven. To move a whole multi-bit value safely, you need a way for the receiver to say "got it" back to the sender. That's a handshake.

1

The problem two flops can't solve

Imagine domain A wants to send the 8-bit value 10110010 to domain B. If every bit gets its own two-flop synchronizer, each bit resolves independently — some bits might land on this clk_b edge, others on the next one. For one brief cycle, domain B could sample 10111010 — a value that never existed anywhere. This is exactly why Lesson 3.1 called multi-bit buses out as a real bug class.

The fix isn't a smarter flop. It's a protocol: hold the data rock-steady, and don't let the receiver read it until the receiver has actually had time to notice it's there — and don't let the sender change it until the receiver confirms it's done reading.

✋ The relay-baton handshake

A relay runner doesn't just fling the baton and hope. They hold it out, wait until the next runner's hand actually closes around it, and only then let go. The handshake synchronizer is that same discipline, built out of two control wires instead of two hands.

2

The four-phase handshake, in words

Two control signals do all the work — req (request) and ack (acknowledge) — and the data bus just sits still while they talk:

  1. SRC drives DATA, then raises REQ. Data is stable before REQ ever moves.
  2. REQ crosses into domain B through its own two-flop synchronizer — same circuit as Lesson 3.1, just carrying a control signal instead of raw data.
  3. DST sees REQ_SYNC go high, captures DATA, raises ACK. By now DATA has been stable for multiple clk_b cycles, so sampling it is completely safe — no synchronizer needed on the data bus itself.
  4. ACK crosses back into domain A through its own two-flop synchronizer.
  5. SRC sees ACK_SYNC go high — the transfer is confirmed — and drops REQ. Only now is SRC allowed to change DATA.
  6. REQ=0 and ACK=0 each cross back through the same synchronizers, returning both domains to idle before the next transfer can start.
Why it's called "four-phase"

REQ rises, ACK rises, REQ falls, ACK falls — four distinct level changes, each one triggering the next. Every single-bit crossing in that chain is exactly the two-flop synchronizer you already know.

3

The complete circuit

Three lanes, flowing left-to-right and right-to-left, that never need to cross: DATA passes straight through (held steady, no synchronizer). REQ crosses A→B through its own two-flop pair. ACK crosses B→A through a second, independent two-flop pair.

DOMAIN A (clk_a) DOMAIN B (clk_b) SRC FSM (domain A) DST FSM (domain B) DATA (held stable — no sync needed) SYNC_REQ 2 flops · clk_b SYNC_ACK 2 flops · clk_a clk_a clk_b
Three lanes, three jobs. DATA never needs synchronizing because it's already sat still for cycles by the time anyone reads it. REQ and ACK are each just a Lesson-3.1 two-flop synchronizer, aimed in opposite directions.
The one rule that makes this all work

SRC is not allowed to change DATA until it has seen ACK_SYNC go high. That's the entire safety guarantee — everything else in the protocol exists to make that one promise enforceable.

4

What it costs — and when to reach for it

A full transfer touches four independent two-flop crossings (REQ up, ACK up, REQ down, ACK down) — call it roughly 8-10 clock cycles round trip, depending on both clocks' speeds. That's dramatically slower than a continuous bit stream.

🐢
Low throughput, by design
Good for occasional, multi-bit control/status transfers — a configuration register, a command word, a one-shot event. Not for streaming data continuously.
✅
Bulletproof correctness
Every bit of DATA is guaranteed stable and fully sampled before anything moves on — no partial or torn values are possible, ever.
📦
Need continuous throughput instead?
That's what the asynchronous FIFO (Module 4) is for — it reuses this same two-flop building block, arranged to keep data streaming instead of stopping to shake hands every word.
5

The bug this protocol exists to prevent

The single most common mistake implementing this circuit: the sender changes DATA (or de-asserts REQ) the instant it thinks the transfer is "probably done," instead of strictly waiting for ACK_SYNC.

Never advance SRC's state on a guess. If SRC drops REQ or changes DATA before ACK_SYNC has actually arrived, the receiver's synchronized REQ might still be settling — the "got it" promise gets broken, and you're back to the exact torn-data problem this whole protocol was built to avoid. The FSM must gate every transition strictly on the synchronized control signal, never on a timer or an assumption.

Step through a full transfer yourself, one phase at a time. 👇

🧪

Interactive Lab: Step Through a Handshake

Click Next to advance one phase at a time through a complete REQ/ACK transfer. Watch which lane lights up in the diagram, and how the waveform below builds up column by column. Dashed segments mean a signal is mid-flight through a synchronizer — not yet resolved.

DOMAIN A (clk_a) DOMAIN B (clk_b) SRC FSM (domain A) DST FSM (domain B) DATA SYNC_REQ 2 flops · clk_b SYNC_ACK 2 flops · clk_a
Step 1 of 10 SRC: IDLE DST: IDLE
logic 1 logic 0 in flight (syncing)

Try it yourself — copy this into our Verilog simulator and check the waveform. 👇

sync_2ff.v (reused for both REQ and ACK)
module sync_2ff (
    input  wire clk,
    input  wire rst_n,
    input  wire d_in,
    (* ASYNC_REG = "TRUE" *) output reg d_out
);

    (* ASYNC_REG = "TRUE" *) reg stage1;

    always @(posedge clk or negedge rst_n) begin
        if (!rst_n) begin
            stage1 <= 1'b0;
            d_out  <= 1'b0;
        end else begin
            stage1 <= d_in;
            d_out  <= stage1;
        end
    end

endmodule
handshake_sync_top.v
module handshake_sync_top #(
    parameter WIDTH = 8
) (
    // Domain A (sender)
    input  wire             clk_a,
    input  wire             rst_a_n,
    input  wire             send,               // pulse: "start a transfer"
    input  wire [WIDTH-1:0] data_in,
    output reg              src_busy,

    // Domain B (receiver)
    input  wire             clk_b,
    input  wire             rst_b_n,
    output reg  [WIDTH-1:0] data_out,
    output reg              data_valid          // pulses when data_out updates
);

    // ---- Domain A: SRC FSM ----
    localparam A_IDLE = 1'b0, A_WAIT_ACK = 1'b1;
    reg a_state;
    reg [WIDTH-1:0] data_hold;
    reg req;
    wire ack_sync;

    always @(posedge clk_a or negedge rst_a_n) begin
        if (!rst_a_n) begin
            a_state   <= A_IDLE;
            req       <= 1'b0;
            src_busy  <= 1'b0;
            data_hold <= {WIDTH{1'b0}};
        end else begin
            case (a_state)
                A_IDLE: begin
                    if (send) begin
                        data_hold <= data_in;   // DATA locked in before REQ ever moves
                        req       <= 1'b1;
                        src_busy  <= 1'b1;
                        a_state   <= A_WAIT_ACK;
                    end
                end
                A_WAIT_ACK: begin
                    if (ack_sync) begin        // only react to the SYNCHRONIZED ack
                        req      <= 1'b0;
                        src_busy <= 1'b0;
                        a_state  <= A_IDLE;
                    end
                end
            endcase
        end
    end

    // ---- Domain B: DST FSM ----
    localparam B_IDLE = 1'b0, B_ACK_HIGH = 1'b1;
    reg b_state;
    reg ack;
    wire req_sync;

    always @(posedge clk_b or negedge rst_b_n) begin
        if (!rst_b_n) begin
            b_state    <= B_IDLE;
            ack        <= 1'b0;
            data_out   <= {WIDTH{1'b0}};
            data_valid <= 1'b0;
        end else begin
            data_valid <= 1'b0;
            case (b_state)
                B_IDLE: begin
                    if (req_sync) begin        // DATA has been stable for cycles by now
                        data_out   <= data_hold;
                        data_valid <= 1'b1;
                        ack        <= 1'b1;
                        b_state    <= B_ACK_HIGH;
                    end
                end
                B_ACK_HIGH: begin
                    if (!req_sync) begin
                        ack     <= 1'b0;
                        b_state <= B_IDLE;
                    end
                end
            endcase
        end
    end

    // ---- Control-signal synchronizers ----
    sync_2ff sync_req (.clk(clk_b), .rst_n(rst_b_n), .d_in(req), .d_out(req_sync));
    sync_2ff sync_ack (.clk(clk_a), .rst_n(rst_a_n), .d_in(ack), .d_out(ack_sync));

endmodule
tb_handshake_sync.v
`timescale 1ns/1ps
module tb_handshake_sync;

    reg clk_a = 0, clk_b = 0;
    reg rst_a_n = 0, rst_b_n = 0;
    reg send = 0;
    reg [7:0] data_in = 8'h00;
    wire src_busy, data_valid;
    wire [7:0] data_out;

    // Two unrelated clocks -- 10ns and 7ns periods
    always #5   clk_a = ~clk_a;
    always #3.5 clk_b = ~clk_b;

    handshake_sync_top #(.WIDTH(8)) dut (
        .clk_a(clk_a), .rst_a_n(rst_a_n), .send(send), .data_in(data_in), .src_busy(src_busy),
        .clk_b(clk_b), .rst_b_n(rst_b_n), .data_out(data_out), .data_valid(data_valid)
    );

    initial begin
        $dumpfile("handshake_sync.vcd");
        $dumpvars(0, tb_handshake_sync);

        #20 rst_a_n = 1; rst_b_n = 1;

        #15 data_in = 8'hB6;
        send = 1;
        #10 send = 0;

        wait (!src_busy);   // wait for the full 4-phase handshake to complete

        #40 $finish;
    end

endmodule

🎯 What to remember

  • REQ/ACK moves a whole multi-bit value safely by holding DATA still and letting two independent two-flop synchronizers (one per direction) carry the control signals.
  • DATA itself never needs its own synchronizer — by the time REQ_SYNC arrives, it's already been stable for multiple receiving-clock cycles.
  • The four phases — REQ up, ACK up, REQ down, ACK down — must each fully complete before the next transfer starts.
  • It costs roughly 8-10 cycles of round-trip latency per transfer — fine for occasional control/status words, wrong tool for continuous streaming (that's the async FIFO, coming in Module 4).
  • The one rule that must never be broken: SRC only changes DATA after seeing the synchronized ACK — never on a guess or a timer.
Advertisement