Gray code
Beginner
A way of counting where only one digit changes at each step.
Novice
A way of counting in binary where only one bit changes from each number to the next (000, 001, 011, 010, 110…). A count caught in the middle of changing is then either the old number or the new one, never garbage.
Expert
Guarantees that a value sampled mid-transition is the old or the new value, which makes Gray counters safe to pass bit by bit through synchronizers. Logic that converts binary to Gray can briefly produce out-of-sequence codes, so the Gray value must come straight from a register.
Explained in RTL design (Design Flow).
See also: Asynchronous FIFO, Finite state machine (FSM).