Home › Practice › RTL Design › 4-bit Gray-code counter
4-bit Gray-code counter
MediumRTLcountersencoding
Count in 4-bit reflected Gray code: 0000, 0001, 0011, 0010, 0110, … , 1000, then back to 0000. Exactly one bit of g changes per step, which is why Gray counters are used for FIFO pointers across clock domains.
- Advance one step per rising edge when
en=1; hold whenen=0. rstis synchronous, active-high, and setsgto 0000.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.