58. Toggle Event Synchronizer

Loading simulator…

What is already provided

  • Clock_A, Clock_B, Event_A, nReset, VCC, and the Pulse_B output are present.
  • TOGGLE_XOR, PULSE_XOR, SRC_TOGGLE, SYNC1_FF, SYNC2_FF, and HISTORY_FF are placed and configured. Keep their settings and positions unchanged.
  • The four asynchronous resets, inactive presets, and PULSE_XOR output are connected. The source-toggle and synchronized-value branch nodes are also provided.

What is missing

Complete the source-toggle loop, connect each register to its correct clock domain, build the two-stage synchronization and history paths, and finish the pulse detector. The existing clock, reset, and preset infrastructure must not be altered.

Complete the missing connections

  1. Provide the source event to the toggle XOR.
    • Connect: Event_A.outnod (DigitalInput-1) → TOGGLE_XOR.in1 (Xor Gate-1).
    • Why: This input requests a toggle when sampled on a source-clock rising edge.
  2. Return the stored toggle to the XOR.
    • Connect: Node-1-1 (existing SRC_TOGGLE.Q branch) → TOGGLE_XOR.in0 (Xor Gate-1).
    • Why: The next toggle value must be Toggle_A ⊕ Event_A.
  3. Store the XOR result.
    • Connect: TOGGLE_XOR.out (Xor Gate-1) → SRC_TOGGLE.in0 (FlipFlopD-1, D).
    • Why: The source DFF holds the event as a persistent toggle after Event_A falls.
  4. Apply the source clock.
    • Connect: Clock_A.outnod (Clock-1) → SRC_TOGGLE.in3 (FlipFlopD-1, CLK).
    • Why: Only rising Clock_A edges may update the source toggle.
  5. Feed the first destination stage.
    • Connect: Node-1-2 (source-toggle Q branch) → SYNC1_FF.in0 (FlipFlopD-2, D).
    • Why: This is the single-bit signal crossing into the destination domain.
  6. Clock the first destination stage.
    • Connect: Node-6-1 (Clock_B branch) → SYNC1_FF.in3 (FlipFlopD-2, CLK).
    • Why: SYNC1_FF must capture the toggle on rising Clock_B edges.
  7. Feed the second destination stage.
    • Connect: SYNC1_FF.out0 (FlipFlopD-2, Q) → SYNC2_FF.in0 (FlipFlopD-3, D).
    • Why: The second stage receives the preceding first-stage value, not the raw source signal.
  8. Clock the second destination stage.
    • Connect: Node-7-1 (Clock_B branch) → SYNC2_FF.in3 (FlipFlopD-3, CLK).
    • Why: Both synchronization registers operate in the same destination domain.
  9. Save the previous synchronized value.
    • Connect: Node-2-1 (SYNC2_FF.Q branch) → HISTORY_FF.in0 (FlipFlopD-4, D).
    • Why: The history DFF stores the prior value of Sync2 for change detection.
  10. Clock the history register.
    • Connect: Node-7-2 (Clock_B branch) → HISTORY_FF.in3 (FlipFlopD-4, CLK).
    • Why: History must update on each destination rising edge alongside the synchronizer.
  11. Connect the current synchronized value to the detector.
    • Connect: Node-2-2 (SYNC2_FF.Q branch) → PULSE_XOR.in0 (Xor Gate-2).
    • Why: The detector needs the current synchronized toggle.
  12. Connect the stored previous value to the detector.
    • Connect: HISTORY_FF.out0 (FlipFlopD-4, Q) → PULSE_XOR.in1 (Xor Gate-2).
    • Why: XOR is HIGH only when Sync2 differs from its previous value.

How the completed circuit works

  • On a rising Clock_A edge, SRC_TOGGLE updates as Toggle_A_next = Toggle_A ⊕ Event_A.
  • SYNC1_FF samples Toggle_A; SYNC2_FF samples the previous Sync1; and HISTORY_FF samples the previous Sync2 on each rising Clock_B edge.
  • Pulse_B = Sync2 ⊕ History. With the source toggle stable before destination sampling, the pulse begins after the second rising Clock_B edge and ends after the third.
  • nReset = 0 asynchronously clears all four DFFs, cancels pending events, and returns Pulse_B LOW after propagation. New events must be spaced until the prior pulse has appeared and ended; this is not a lossless arbitrary-rate handshake.