CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/FSM Design

Debugging Sequence Detector Lockup

MediumLogic CircuitDebug

Sequence detectors in packet routers identify frame boundaries and must recover gracefully from partial matches.

A Moore finite state machine detects the overlapping sequence 101 on input X. The machine uses four states: 0, 1, 2, and 3. Output Z is 1 only in state 3.

Expected behavior:

| Current State | X | Next State | Z | |-----------------|-----|--------------|-----| | 0 | 0 | 0 | 0 | | 0 | 1 | 1 | 0 | | 1 | 0 | 2 | 0 | | 1 | 1 | 1 | 0 | | 2 | 0 | 0 | 0 | | 2 | 1 | 3 | 0 | | 3 | 0 | 2 | 1 | | 3 | 1 | 1 | 1 |

Simulation shows that after successfully detecting the sequence, supplying an input of X=0 causes the output Z to remain 1 indefinitely. The test sequence X = 1, 0, 1, 0 starting from reset produces Z = 0, 0, 1, 1 instead of the expected Z = 0, 0, 1, 0.

Inspect the circuit and correct the fault.

Constraints

  • Do not add new state registers.
  • The circuit must remain a Moore machine where Z depends only on the current state.
  • The rst signal is synchronous and active-high.

Topics

FSMDebuggingSequence Detector

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

  • Debugging Handshake DeadlockHard
  • Sequence Detector 101 (FSM)Medium
  • Incomplete Default State AssignmentMedium
  • Moore FSM Output Delay AnalysisEasy

Browse all problems · Learning tracks