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

Pessimistic vs Optimistic Flag Generation

HardLogic CircuitAnalyze

Asynchronous FIFOs rely on synchronized read and write pointers to safely generate full and empty flags across independent clock domains.

The design under analysis is a 16-deep FIFO utilizing 5-bit Gray code pointers: wr_ptr in the write domain and rd_ptr in the read domain. The full flag is evaluated exclusively in the write domain by comparing wr_ptr against the synchronized read pointer rd_ptr_sync. The empty flag is evaluated in the read domain by comparing rd_ptr against the synchronized write pointer wr_ptr_sync. Synchronization requires a standard two-flop synchronizer, introducing a two-cycle latency.

Determine the exact state of the flags during simultaneous read and write bursts. Prove mathematically whether the flag generation logic evaluates available space optimistically or pessimistically and identify the system-level consequences of this evaluation.

Constraints

  • Synchronization latency is exactly 2 clock cycles in the destination domain.
  • The FIFO depth is 16 entries.
  • Pointers are 5 bits wide to distinguish between full and empty conditions.
  • Gray code is used for all pointer domain crossings.

Topics

CDCAsynchronous FIFOPointersFlags

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