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

Debug: Asynchronous Clear Glitch

HardLogic CircuitDebug

A modulo-5 counter tracks sequences from 0 to 4 and wraps back to 0 on the next clock edge.

Expected behavior:

When the active-high Reset is 0, the counter increments its outputs Q2, Q1, and Q0 on each rising edge of Clk. When the state reaches Q2=1, Q1=0, Q0=0 (decimal 4), the next rising clock edge must transition the state to Q2=0, Q1=0, Q0=0.

Simulation shows that the counter increments correctly up to state 3. On the next rising edge, it transitions to state 4 but immediately drops to state 0 before the next clock cycle begins. The test case for holding state 4 fails because Q2, Q1, and Q0 evaluate to 0, 0, and 0 prematurely. Inspect the circuit and correct the fault.

Constraints

  • Do not add any new flip-flops to the circuit
  • The reset mechanism must be purely synchronous
  • All state transitions must occur only on the rising edge of Clk

Topics

DebugSequential LogicAsynchronous ResetGlitchesCounters

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
  • Reconvergence of Individually Synchronized BitsHard
  • FIFO Empty Logic Evaluated in Wrong DomainMedium
  • T Flip-Flop: Propagation Delay Accumulation in 3-Stage Ripple CounterMedium
  • Handshake Deadlock Due to Early ResetHard

Browse all problems · Learning tracks