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

Debugging Lost State During Stall

MediumLogic CircuitDebug

A pipelined datapath must preserve in-flight data when downstream components are not ready. This single-stage pipeline registers data_in and valid_in when stall is low, and holds its current state when stall is high.

Expected behavior:

When stall is asserted, the outputs data_out and valid_out must remain frozen at their current values. New inputs are ignored until stall is deasserted.

Simulation shows that data is lost during a pipeline stall. When a valid input is followed by a cycle where stall = 1, the pipeline overwrites the stored data with the new input instead of holding the previous value. For example, if data_out = 5 and stall = 1 is asserted, the next cycle shows data_out incorrectly changing to the new data_in value. Inspect the circuit and correct the fault.

Constraints

  • Do not add new registers or pipeline stages.
  • Only modify the enable logic of the existing pipeline registers.
  • The fix requires changing exactly one logic gate or wire connection.

Topics

debugregisterspipelining

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