Codiode

Counter: Minimum Gate Correction for Single Self-Loop

HardLogic CircuitBuild

State machine lockups occur when noise flips register bits into an unmapped state that transitions to itself. Rather than redesigning the entire next-state logic block to handle this illegal state, engineers patch the specific node causing the self-loop to minimize area overhead.

A mod-7 counter for states 000 through 110 has a bug where state 111 loops indefinitely. The uncorrected next-state bit D2_in evaluates to 1 when the current state bits Q2, Q1, and Q0 are all 1. To break the loop without altering valid transitions, intercept D2_in and force the corrected output D2_out to 0 only when the counter is in state 111. For all other states, D2_out must exactly equal D2_in.

Q2 Q1 Q0 D2_in D2_out
0 0 0 0 0
0 0 0 1 1
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 0
0 1 1 1 1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 0
1 1 1 1 0

Constraints

  • Combinational logic only.
  • Use a maximum of two logic gates to implement the correction.

Topics

FSMCountersState 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.

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 117 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.