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

Counter: Two Separate Invalid State Cycles

HardLogic CircuitAnalyze

Robust digital systems must recover gracefully from random power-on states or radiation-induced bit flips.

A synchronous 4-bit counter uses state variables Q3, Q2, Q1, and Q0 to implement a standard BCD decade sequence from 0 to 9. The next-state logic produces the valid sequence perfectly, but the unused states (10 through 15) exhibit unintended transition behavior. The transition logic dictates the following mappings for the invalid states: 10 transitions to 12, 12 transitions to 14, 14 transitions to 10, 11 transitions to 13, 13 transitions to 15, and 15 transitions to 11.

Analyze the state transition behavior for all 16 possible states. Determine the topology of the unused states and identify the necessary logic to guarantee self-correction to the valid sequence.

Constraints

  • Valid states are 0 (0000) through 9 (1001).
  • State variables are ordered Q3 (MSB) down to Q0 (LSB).
  • States 10 through 15 are considered invalid.

Topics

sequential-logiccountersstate-machinesself-correction

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