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

Self-Correction with Synchronous Load

HardLogic CircuitBuild

State machines in aerospace and automotive applications must recover from single-event upsets without ignoring external commands. A counter with both self-correction and synchronous load requires strict priority resolution to ensure external control is never locked out by internal error handling.

Design a 3-bit Modulo-5 counter that counts continuously from 0 to 4. The circuit has a 1-bit control signal LOAD, a 3-bit data input D, and a 3-bit output Q. The design must enforce a strict priority hierarchy: synchronous loads override self-correction, and self-correction overrides the normal count sequence.

| LOAD | Current Q | Next Q | Behavior | |--------|-------------|----------|----------| | 1 | Any | D | Synchronous load overrides all other logic | | 0 | 0, 1, 2, 3 | Q + 1 | Normal count | | 0 | 4 | 0 | Normal wrap around | | 0 | 5, 6, 7 | 0 | Self-correction to valid state |

Constraints

  • Implement the design using only standard combinational logic gates and D flip-flops.
  • Trigger all state transitions on the positive edge of the clock.
  • Do not use high-level behavioral counter blocks or macro-cells.
  • Resolve all priority conflicts purely through combinational next-state logic.

Topics

sequential-logiccountersself-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