CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Combinational Logic

Glitchless Clock Multiplexer

HardLogic CircuitBuild

Dynamic clock scaling in modern SoCs requires switching between asynchronous frequency domains on the fly. A naive multiplexer produces runt pulses or glitches during the transition, causing instant system crashes.

The glitchless clock multiplexer safely routes one of two free-running, asynchronous clocks to a single output. When sel changes, the circuit must wait for the currently active clock to go low before disabling it. It then waits for the newly selected clock to go low before enabling it. This guarantees that clk_out never experiences a shortened high or low pulse.

Steady-state behavior:

| sel | clk_0 | clk_1 | clk_out | |-------|---------|---------|-----------| | 0 | 0 | 0 | 0 | | 0 | 0 | 1 | 0 | | 0 | 1 | 0 | 1 | | 0 | 1 | 1 | 1 | | 1 | 0 | 0 | 0 | | 1 | 1 | 0 | 0 | | 1 | 0 | 1 | 1 | | 1 | 1 | 1 | 1 |

Constraints

  • Use negative edge-triggered D flip-flops for all synchronization logic.
  • Implement cross-coupled feedback to prevent both clock enables from being active simultaneously.
  • Gate the final clock outputs using AND gates before combining them with an OR gate.

Topics

asynchronousclockingsynchronization

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • Binary to HexEasy
  • 1-to-4 Demultiplexer from AND and NOT GatesEasy
  • 2-to-4 Line Decoder with Active-High EnableEasy
  • Hex Nibble to BinaryEasy
  • Odd Parity Bit Generator for 3-bit DataEasy
  • Full Adder from Half AddersEasy
  • Modulo ArithmeticMedium
  • Two's Complement: Encode a Negative DecimalEasy

Browse all problems · Learning tracks