RTL design / memory

Verilog FIFO Design Guide

A FIFO is a compact interview problem that exposes whether you can reason about state, memory, boundary conditions and simultaneous controls. The cleanest design starts from explicit enqueue/dequeue events and derives pointer and occupancy updates from those events.

Implementation-first: use this guide to review the design rules, then solve the linked HDLForge problems without looking at a solution first.

Core design rules

Implementation path

Verification checklist

Useful RTL / verification pattern

wire write_fire = wr_en && !full;
wire read_fire  = rd_en && !empty;

case ({write_fire, read_fire})
  2'b10: count <= count + 1'b1;
  2'b01: count <= count - 1'b1;
  default: count <= count;
endcase

Practice with executable problems

RTL Design · HardSynchronous FIFO

Implement a synchronous parameterized FIFO with ready/valid-style enqueue and dequeue controls.

RTL Design · MediumSimple Dual-Port RAM

Infer a small synchronous-write, asynchronous-read dual-port memory.

RTL Design · MediumBinary to Gray Counter

Build a parameterized binary counter and expose its Gray-code representation.

Turn it into a project

ProjectCDC-Safe Asynchronous FIFOProjectParameterized Cache or Memory Controller