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

Counter: Lockup Detection Output Signal

MediumLogic CircuitBuild

System watchdogs monitor critical state machines and counters to ensure they do not freeze during operation. A lockup detector flags when a sequential element remains in the identical state across multiple clock cycles, allowing a microcontroller to trigger a reset or alert.

Construct a lockup detection circuit for a 4-bit counter. The circuit receives the current counter state via inputs Q3, Q2, Q1, and Q0. It must register these inputs on every clock cycle to maintain a record of the previous state. The output LOCKUP must be driven HIGH continuously whenever the current state exactly matches the registered previous state. A synchronous active-high rst signal must clear the registered previous state to 0.

| Q == Q_prev | LOCKUP | |---------------|----------| | 0 | 0 | | 1 | 1 |

Constraints

  • Use exactly four D flip-flops to store the previous state.
  • Implement the state comparison using only basic combinational logic gates.
  • Do not use high-level equality comparator blocks: build the bitwise comparison manually.
  • The rst signal must synchronously clear all flip-flops to 0.

Topics

Flip-FlopsCountersState ComparisonWatchdog

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