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

FIFO Full Logic Using Binary Pointers

MediumLogic CircuitDebug

An asynchronous FIFO uses Gray code pointers to safely pass state across clock domains. The full logic evaluates whether the FIFO has reached maximum capacity by comparing the local write pointer to the synchronized read pointer.

Expected behavior:

The Full output must be 1 if and only if the Gray-encoded write pointer (WG) and the synchronized Gray read pointer (R) satisfy the standard Gray full condition:

  • WG[2] != R2
  • WG[1] != R1
  • WG[0] == R0

Here, WG is the pure Gray-code equivalent of the binary write pointer inputs W2, W1, and W0.

Simulation shows Full = 0 for inputs W2=0, W1=0, W0=0 and R2=1, R1=1, R0=0. The full flag fails to assert when the write pointer wraps around and catches up to a read pointer at address 4. Inspect the circuit and correct the fault.

Constraints

  • Do not convert the synchronized Gray read pointer back to binary.
  • Use minimum gate depth for the pointer comparison logic to avoid combinational timing violations.

Topics

Gray CodeClock Domain CrossingAsynchronous FIFO

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