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

Glitch Free Switch Unrelated Clocks

HardLogic CircuitBuild

Changing operating frequencies on the fly requires switching between independent oscillators without generating runt pulses or glitches. The glitch-free clock multiplexer is the industry standard mechanism for safely transitioning between asynchronous clock domains in modern system-on-chips.

The circuit must route either clk0 or clk1 to clk_out based on the state of the sel signal.

| sel | clk_out (steady state) | |-------|--------------------------| | 0 | clk0 | | 1 | clk1 |

When sel transitions, the currently active clock must be cleanly disabled before the new clock is enabled. The enable signal for each clock domain must only change when its respective clock is low. This ensures the output clock is never truncated during a high phase. The two clock domains must be cross-coupled so that a new clock is never enabled until the previous clock has been fully disabled.

Constraints

  • Use negative-edge triggered flip-flops to sample the select and feedback signals.
  • Implement cross-coupled feedback to ensure mutual exclusion of the clock enable signals.
  • Do not use any positive-edge triggered sequential logic.

Topics

multiplexerclockingsynchronization

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

  • 3-bit Ripple Counter from Toggle Flip-FlopsEasy
  • D Latch from a 2:1 MUXEasy
  • 2-bit Ring CounterEasy
  • T Flip-Flop from a D Flip-FlopEasy
  • Handshake Deadlock Due to Early ResetHard
  • Reconvergence of Individually Synchronized BitsHard
  • Debug: Asynchronous Clear GlitchHard
  • Clock Gate Enable Crossing DomainsHard

Browse all problems · Learning tracks