DigiFlop

Counts in Gray code directly, one bit change per step.

Verilog Coding Exercise · Sequential
Gray Code Counter
Counts in Gray code directly, one bit change per step.

Instead of counting in binary and converting afterward, this counter maintains a hidden binary counter internally and outputs its Gray-coded equivalent every cycle — directly useful for CDC-safe pointers in async FIFOs.

Related conceptThis is exactly the technique used for async FIFO pointers in the Clock Domain Crossing (CDC) deep dive.
▶ Try the interactive version