CDC Course / Module 3: Synchronization Techniques
Lesson 3.3

The Pulse Synchronizer

One more shape of signal doesn't survive the two-flop synchronizer untouched: a single-cycle pulse. It's not about metastability this time โ€” it's simpler and sneakier than that. A pulse can be completely, cleanly, silently missed, with no violation, no X, no warning. Here's why, and the neat trick that fixes it.

1

How a perfectly clean pulse just disappears

A two-flop synchronizer only ever reports whatever data_a happens to be at the instant of a clk_b rising edge. That's fine for a level that stays put. But a pulse, by definition, comes and goes โ€” and if it comes and goes entirely between two clk_b edges, no edge ever sees it. FF1's D input was 1 for a while and 0 again, and FF1 never sampled anything but 0.

CLK B data_a pulse โ†‘ squeezed entirely between two clk_b edges FF1 never samples a 1 โ€” the pulse is gone. No error, no trace.
This isn't a rare edge case โ€” it's guaranteed to happen whenever the pulse is narrower than one clk_b period and its timing is unrelated to clk_b, which is exactly the situation CDC exists to handle.

Making the pulse wider doesn't fully solve it either. Even a pulse as wide as one full clk_b period can still land with unlucky phase and get missed by one sample, and if clk_b is much slower than clk_a โ€” or their ratio isn't known at design time โ€” there's no width you can pick that's always safe. You need a technique that works regardless of the frequency relationship.

2

The fix: stop sending a pulse โ€” send a level change

A level can't be squeezed out of existence โ€” it just sits there until something changes it, and the two-flop synchronizer is built exactly for levels. So: don't synchronize the pulse. Toggle a flip-flop in domain A every time the pulse fires, synchronize that (a level, immune to width), and then rebuild a clean one-cycle pulse on the other side.

๐Ÿ’ก The light-switch analogy

Flicking a light switch is a brief action, easy to miss if you glance away at the wrong moment. But whether the light is currently ON or OFF is a state you can check any time and always get the right answer. Toggling turns a "did something just happen?" question (easy to miss) into an "is it currently different than before?" question (impossible to miss).

3

The complete circuit

One straight chain, three stages, nothing crossing back on itself:

DOMAIN A (clk_a) DOMAIN B (clk_b) pulse_a TOGGLE FF T ยท clk_a SYNC_2FF 2 flops ยท clk_b DELAY + XOR edge detector clk_b pulse_out toggle_a toggle_sync clk_a clk_b
TOGGLE FF turns the pulse into a level flip. SYNC_2FF is exactly Lesson 3.1's circuit โ€” it can't lose a level. DELAY+XOR compares the synchronized toggle to a 1-cycle-older copy of itself: whenever they differ, exactly one clk_b-wide pulse comes out.
4

Walking through it

  1. pulse_a fires. The TOGGLE FF flips โ€” toggle_a changes level and, critically, stays at the new level indefinitely, however narrow the original pulse was.
  2. toggle_a crosses through SYNC_2FF โ€” the exact same two-flop synchronizer from Lesson 3.1. Because it's a level, not a pulse, it cannot be missed the way the raw pulse could.
  3. The DELAY+XOR stage compares the freshly synchronized toggle against a copy of itself delayed by one more clk_b cycle. For exactly one cycle after the toggle changes, the two disagree โ€” and that disagreement is pulse_out: a clean, single-clk_b-cycle pulse.
Why this is immune to pulse width

The only thing that has to survive is a level change reaching the toggle flop โ€” and levels don't have a "width" to be too narrow. It doesn't matter if clk_b is faster, slower, or completely unrelated to clk_a.

5

The constraint this doesn't remove: pulse rate

Immunity to width is not immunity to rate. If a second source pulse fires before the first toggle has finished making its way through SYNC_2FF and the edge detector, the two toggles can blur together โ€” the receiver sees one level change instead of two, and a pulse is lost anyway, this time for a completely different reason: it never even reached the point of being "too narrow."

Rule of thumb: keep source pulses spaced at least 3 receiving-clock periods apart. That gives the two-flop synchronizer its full settling time and the edge detector a clean, separate cycle to register each toggle. If your source needs to fire faster than that, a pulse synchronizer is the wrong tool โ€” reach for the handshake synchronizer (Lesson 3.2) or a FIFO (Module 4) instead, both of which have built-in back-pressure.

Race the two methods head-to-head โ€” same pulse train, same clock, two different synchronizers. ๐Ÿ‘‡

๐Ÿงช

Interactive Lab: Toggle-Sync vs. Naive-Sync

The same pulse_a train feeds two synchronizers at once: the toggle-and-detect circuit from this lesson, and a naive direct two-flop synchronizer applied straight to the pulse. Drag the sliders and watch which one actually gets every pulse through.

Toggle method: โ€”
Naive direct-sync method: โ€”

Try it yourself โ€” copy this into our Verilog simulator and check the waveform. ๐Ÿ‘‡

pulse_sync.v
module pulse_sync (
    input  wire clk_a,
    input  wire rst_a_n,
    input  wire pulse_a,        // single-cycle pulse, domain A

    input  wire clk_b,
    input  wire rst_b_n,
    output wire pulse_b         // single-cycle pulse, domain B
);

    // ---- Domain A: pulse -> toggle ----
    reg toggle_a;
    always @(posedge clk_a or negedge rst_a_n) begin
        if (!rst_a_n)      toggle_a <= 1'b0;
        else if (pulse_a)  toggle_a <= ~toggle_a;
    end

    // ---- Domain B: 2-flop synchronizer for the toggle ----
    (* ASYNC_REG = "TRUE" *) reg sync_stage1;
    (* ASYNC_REG = "TRUE" *) reg toggle_sync_b;

    always @(posedge clk_b or negedge rst_b_n) begin
        if (!rst_b_n) begin
            sync_stage1   <= 1'b0;
            toggle_sync_b <= 1'b0;
        end else begin
            sync_stage1   <= toggle_a;
            toggle_sync_b <= sync_stage1;
        end
    end

    // ---- Domain B: edge detector (delay + XOR) ----
    reg toggle_sync_b_d1;
    always @(posedge clk_b or negedge rst_b_n) begin
        if (!rst_b_n) toggle_sync_b_d1 <= 1'b0;
        else          toggle_sync_b_d1 <= toggle_sync_b;
    end

    assign pulse_b = toggle_sync_b ^ toggle_sync_b_d1;

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

    reg clk_a = 0, clk_b = 0;
    reg rst_a_n = 0, rst_b_n = 0;
    reg pulse_a = 0;
    wire pulse_b;

    // Two unrelated clocks
    always #5   clk_a = ~clk_a;   // 100 MHz
    always #3.5 clk_b = ~clk_b;   // ~143 MHz

    pulse_sync dut (
        .clk_a(clk_a), .rst_a_n(rst_a_n), .pulse_a(pulse_a),
        .clk_b(clk_b), .rst_b_n(rst_b_n), .pulse_b(pulse_b)
    );

    initial begin
        $dumpfile("pulse_sync.vcd");
        $dumpvars(0, tb_pulse_sync);

        #20 rst_a_n = 1; rst_b_n = 1;

        // Fire a single-cycle pulse a few times, spaced safely apart
        repeat (4) begin
            #23 pulse_a = 1;
            #5  pulse_a = 0;   // exactly 1 clk_a cycle wide
        end

        #60 $finish;
    end

endmodule

๐ŸŽฏ What to remember

  • A two-flop synchronizer can silently drop a pulse that's narrower than the receiving clock period โ€” no error, no warning, it just never gets sampled.
  • The fix: toggle a flip-flop on every source pulse (turning it into a level change), synchronize that level with a normal two-flop synchronizer, then regenerate a clean pulse with a delay register + XOR edge detector.
  • This makes the crossing immune to pulse width and immune to the clk_a/clk_b frequency ratio โ€” but not immune to pulse rate.
  • Keep source pulses spaced at least ~3 receiving-clock periods apart. Faster than that, use the handshake synchronizer or a FIFO instead.
Advertisement