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.