Codiode

Circular Buffer Write Pointer Logic

MediumLogic CircuitBuild

Network routers, audio processing pipelines, and UART FIFOs rely on circular buffers to manage streaming data in bounded memory. The write pointer must wrap around seamlessly to continuously overwrite the oldest data.

The circuit maintains a 3-bit write pointer ptr for a modulo-6 circular buffer. The pointer increments on write and resets to zero immediately after reaching address 5.

rst wr_en Current ptr Next ptr
1 X X 0
0 0 X Current
0 1 0 to 4 ptr + 1
0 1 5 0

Constraints

  • Implement synchronous logic using standard D flip-flops.
  • Treat rst as a synchronous, active-high reset.
  • Restrict the maximum pointer value to exactly 5.

Topics

sequentialdatapathcounterspointers

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.

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.

Part of Datapath and Storage

Problem 7 of 29 in the Datapath and Storage track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.