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

Debug: Off By One Reset Condition

MediumLogic CircuitDebug

A modulo-5 counter tracks active cycles and wraps back to zero to manage repetitive timing events.

Expected behavior:

When Rst is 1, Q becomes 0 on the next clock edge. When En is 1, Q increments by 1. When Q reaches 4 and En is 1, Q must wrap around to 0 on the next clock edge.

Simulation shows Q = 5 after five consecutive cycles where En = 1. The output wrap condition triggers one cycle too late. Inspect the circuit and correct the fault.

Constraints

  • The output port Q must remain 3 bits wide.
  • The counter must reset synchronously on the clock edge.
  • The design must not use asynchronous clears for the wrap-around logic.

Topics

SequentialCounterDebugModulo

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