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

FIFO Empty Logic Evaluated in Wrong Domain

MediumLogic CircuitDebug

An asynchronous FIFO safely transfers data between two independent clock domains. The full flag prevents overflow in the write domain, while the empty flag prevents underflow in the read domain.

Expected behavior:

The empty flag must assert immediately when the read pointer r_ptr catches up to the synchronized write pointer w_ptr_sync in the read clock domain.

Simulation shows the empty flag asserting late during a burst read operation. When r_en is high and the FIFO contains one remaining word, a subsequent read operation executes before the empty flag updates. This causes an underflow. Test waveforms indicate the empty flag is delayed by several clock cycles relative to the pointers updating.

Inspect the circuit and correct the fault.

Constraints

  • Do not modify the full flag generation logic.
  • The empty flag must evaluate combinationally in the read clock domain.
  • Use the synchronized write pointer w_ptr_sync for the empty condition evaluation.

Topics

fifodebuggingsequential-logicclock-domain-crossing

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