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.
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.
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.
Two control signals do all the work — req (request) and ack (acknowledge) — and the data bus just sits still while they talk:
clk_b cycles, so sampling it is completely safe — no synchronizer needed on the data bus itself.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.
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.
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.
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.
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. 👇
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.
Try it yourself — copy this into our Verilog simulator and check the waveform. 👇
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
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
`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