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

Self-Correcting Ring Counter: One-Hot Detection Circuit

HardLogic CircuitBuild

High-speed state machines and token-passing arbiters often rely on ring counters for glitch-free control. Because electrical noise can flip a bit and derail the sequence permanently, robust designs include self-correcting logic to detect invalid states and force a recovery.

Design the next-state logic for a 4-bit self-correcting ring counter. The circuit must evaluate the current state inputs Q3, Q2, Q1, and Q0. A valid state is strictly one-hot. If the state is valid, the circuit performs a standard right shift. If the state is invalid (zero-hot or multi-hot), it asserts an internal invalid condition and forces the next state outputs D3, D2, D1, and D0 to 1000.

| Q3 | Q2 | Q1 | Q0 | D3 | D2 | D1 | D0 | |------|------|------|------|------|------|------|------| | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |

Constraints

  • Combinational logic only.
  • Determine one-hot validity by combining an XOR parity check with a combinational check that rejects any state with multiple HIGH bits.
  • Do not use behavioral adders or equality operators to check the state.

Topics

combinationalone-hotnext-stateerror-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