Codiode

Ring Counter: Self-Correction for Any Invalid State

HardLogic CircuitBuild

Multiphase clock generators and timing sequencers rely on ring counters to circulate a single active bit. Because standard ring counters cannot recover from glitch-induced invalid states, production designs require dedicated self-correction hardware.

The circuit must maintain a 4-bit ring counter that shifts right on every rising clock edge. If the current state Q is not strictly one-hot (meaning zero bits are HIGH, or two or more bits are HIGH), the circuit must synchronously force the next state to 1000. A synchronous load input is also provided to inject arbitrary states for testing.

Current State (Q3 Q2 Q1 Q0) load Next State (Q3 Q2 Q1 Q0)
Any 1 D3 D2 D1 D0
1000 0 0100
0100 0 0010
0010 0 0001
0001 0 1000
All other states (Invalid) 0 1000

Constraints

  • Use standard D flip-flops for state storage.
  • Implement synchronous state updates and self-correction exclusively on the rising edge of clk.
  • Do not use pre-packaged counter or shift register components.

Topics

Sequential LogicCountersState MachinesOne-Hot

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.

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.

Part of Counters

Problem 92 of 139 in the Counters track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.