Practice
Digital circuit debugging problems
Most engineering time goes into designs that nearly work. Each of these problems hands you one: a counter that resets at 8 instead of 10, a JK flip flop with its inputs swapped, an async FIFO whose full flag arrives a cycle late.
122 problems13 easy, 70 medium, 39 hard
You run the tests, read which ones fail and where the waveform goes wrong, and fix the circuit with as few edits as the problem allows.
What these problems cover
- Wrong or swapped gates in combinational logic
- Flip flop wiring, polarity and reset mistakes
- Counters that skip, stick or reset at the wrong count
- Clocks used as data and data used as clocks
- Synchronizer and FIFO flag bugs
Problems by track
Gate-Level Logic6
Combinational Building Blocks8
- Debug a Full Adder Where Sum and Carry Outputs Are Swapped at the Output Pins
- Debug a Full Subtractor with Wrong Borrow Expression
- Debug 2-Bit Adder/Subtractor
- Debug 4:1 Multiplexer
- Debug a Priority Encoder with Reversed Priority Direction
- Debug 2:4 Decoder Enable Polarity
- Debug a 7-Segment Decoder
- Out of Bounds Array Indexing
Latches and Flip-Flops10
- SR NOR Latch: Missing Cross-Coupling Wire Debug
- SR NAND Latch Stuck Forbidden State Debug
- Gated SR Latch: Enable Connected to Wrong NAND Input Debug
- D Latch: Permanently-Enabled Latch Debug
- JK Flip-Flop: J and K Input Swapped Debug
- Synchronous Reset Wired to Asynchronous Path Debug
- Debug: Read Before Write In Sequential Block
- Debug: Polarity Mismatch in Reset Condition
- Debug: Clock Enable in Sensitivity List
- Missing Reset Causing Undefined State
Counters18
- Ripple Counter: Wrong Trigger Stage Debug
- Ripple Counter: Q2 Stuck-at-0 Fault Debug
- Synchronous Counter Missing Carry Term Debug
- Synchronous Counter Q3 Stuck-at-0 Debug
- Mod-6 Counter Reset Decode Wrong Bit Debug
- Mod-N Counter: Off-by-One in Terminal Count Detection Debug
- Up/Down Counter: DOWN Mode Counting UP Debug
- Up/Down Counter: Underflow Detection Missing Debug
- BCD Counter: State 12 Lockup Debug
- BCD Counter: Reset at 8 Instead of 10 Debug
- BCD Counter Sequence Error
- Johnson Counter: Q Feedback Instead of Q_bar Debug
Shift Registers9
- SISO: Clock Missing on One Stage Debug
- SISO: Wrong D-to-Q Wiring Debug
- SIPO: One Flip-Flop D Input Floating Debug
- PISO: Parallel Load Before Shift Complete Debug
- PIPO: Load and Shift Priority When Both Asserted
- Bidirectional SR: Inverted DIR Signal Debug
- Ring Counter: Q3 Stuck-at-1 Fault Trace
- Ring Counter: Feedback via Q_bar Produces Johnson Behavior Debug
- Serial Link: Clock Inversion at Receiver Debug
Finite State Machines8
Arithmetic and ALU Design1
Clocking and Synchronization6
Fault Testing and Verification10
- Test Point Insertion Logic
- Debug Combinational: Swapped Logic Gates
- Debug Combinational: Priority Encoder Masking Bug
- Debug Combinational: Parity Generator Gate Swap
- Debug Sequential: Deadlock State Identification
- Debug Sequential: Incorrect Next State Logic Loop
- Debug Sequential: Johnson Counter Feedback Inversion
- Debug Combinational: False Path Identification
- Missing Else in Combinational Logic
- Unassigned Variable in Nested Conditions
Interview Circuit4
More problems42
- Active Low Reset Polarity Mismatch
- Debugging ROM Latch Inference
- Incomplete Case Statement
- The Deeply Nested Latch
- Unused Flip Flop Removal
- Asynchronous FIFO Pointer Gray Code Verification
- Asynchronous Reset Missing from Sensitivity List
- Asynchronous Reset Wired as Synchronous Reset
- Bitwise versus Logical AND
- Blocking Assignment Race Condition
- Combinational Loop via Implicit State
- Dead Code Elimination
How your answer is checked
The broken circuit runs on the circuit simulator against the problem's tests, clocked cycle by cycle where it is sequential. Your fix passes when every test does, within the problem's edit budget.
Questions
- What is the edit budget?
- The number of changes you may make. It stops a fix from being a full rebuild, so you have to find the actual fault.
- Are these free?
- Every problem statement is free to read. The debugging problems are part of Codiode Pro; each track's free problems are a good place to start first.