Codiode

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.

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.

Part of Interview Circuit

Problem 14 of 29 in the Interview Circuit track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.