56. Safe Dual-Clock Selector

Loading simulator…

What is already provided

  • Clock_A and Clock_B are connected to their clock gates and LOW-phase latch controls.
  • LATCH_A and LATCH_B already feed the enable outputs, source clock gates, and opposite-enable inverters.
  • REQ_A and REQ_B outputs already connect to the corresponding latch D inputs.
  • CLK_MERGE, STATE_FF, VCC, and nReset are fully connected. Leave these unchanged.

What is missing

Both request AND gates have two unconnected input pins. Each gate needs one selection signal and one opposite-enable check to prevent both clock paths from being enabled together.

Complete the missing connections

  1. Allow Clock A to be selected.
    • Connect: NOT_SEL.out (Not Gate-3) → REQ_A.in0 (And Gate-1).
    • Why: NOT_SEL supplies SEL'. Clock A can be requested only when SEL = 0.
  2. Ensure Clock B is disabled before enabling A.
    • Connect: NOT_EN_B.out (Not Gate-5) → REQ_A.in1 (And Gate-1).
    • Why: Enable_B' allows REQ_A only after B's stored enable becomes 0.
  3. Allow Clock B to be selected.
    • Connect: SEL junction (Node-3) → REQ_B.in1 (And Gate-2).
    • Why: The direct SEL signal allows Clock B to be requested only when SEL = 1.
  4. Ensure Clock A is disabled before enabling B.
    • Connect: NOT_EN_A.out (Not Gate-4) → REQ_B.in0 (And Gate-2).
    • Why: Enable_A' allows REQ_B only after A's stored enable becomes 0.

How the completed circuit works

  • REQ_A = SEL' · Enable_B'; REQ_B = SEL · Enable_A'.
  • Each latch updates during its source clock's LOW phase and holds its enable during HIGH. A HIGH pulse already in progress is therefore not cut short by a change in SEL.
  • On a switch request, the old path turns off at its LOW phase before the new path turns on. The temporary Enable_A = Enable_B = 0 interval is the intended break-before-make gap.
  • GATE_A, GATE_B, and CLK_MERGE produce Clock_Out. The already-connected STATE_FF toggles on each rising edge that reaches this output.