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

Counter Wrapping at Wrong Value

EasyLogic CircuitDebug

Modulo counters provide exact division for digital clocks and frequency dividers. A modulo 10 counter increments its output Q from 0 to 9 on each active clock edge when en is high, and wraps back to 0.

Expected behavior:

| rst | en | Current Q | Next Q | |-------|------|-------------|----------| | 1 | X | X | 0 | | 0 | 0 | Q | Q | | 0 | 1 | 0 | 1 | | 0 | 1 | 8 | 9 | | 0 | 1 | 9 | 0 |

Simulation shows an incorrect state sequence. After reaching Q = 9 with en = 1, the next clock edge produces Q = 10 instead of wrapping to 0. The counter resets on the following cycle, creating an 11-state sequence. Inspect the circuit and correct the fault.

Constraints

  • The circuit must use synchronous reset logic.
  • Do not modify the clock distribution network.

Topics

sequentialcountermodulodebug

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