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

Clock Loss Recovery Mux

HardLogic CircuitDebug

A failover clock multiplexer switches system operation to a backup clock when the primary clock fails. The circuit selects clk_pri when sel_backup is 0, and cleanly transitions to clk_sec when sel_backup is 1.

Expected behavior:

Normal glitch-free switching occurs when both clocks are running. If clk_pri stops toggling while sel_backup is 0, asserting sel_backup to 1 must asynchronously force the multiplexer to release the primary clock and output clk_sec.

Simulation shows a lockup during the primary clock failure test. The test drives clk_pri to a constant 0, then asserts sel_backup to 1. The output clk_out remains flat at 0 instead of transitioning to clk_sec. The synchronization flip-flops in the primary domain never clear because their clock is dead.

Inspect the circuit and correct the fault.

Constraints

  • Do not use combinational logic on the clock lines outside the dedicated output multiplexer gates.
  • The switch to the backup clock must occur even if the primary clock is completely stopped.
  • The design must remain glitch-free during normal switching when both clocks are active.

Topics

Clock Domain CrossingMultiplexerAsynchronousFailover

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