Gray Encoding
Appearance
Gray Encoding
'Gray Encoding' in digital design lingo commonly refers to a specific encoding of a state machine where a minimal number of flip flops are used to represent all valid states, and where advancing from one state to the next involves a change in only one bit. For example, a 'Gray Encoded' state machine with nine states would use four flip flops and might use a sequence such as:
0000
0001
0011
0010
0110
0111
0101
0100
1100
The advantage to using 'Gray Encoding' above ordinary binary encoding is that since only one bit is changing, any combinational logic downstream of the state machine will not exhibit glitches or race conditions.
See also: Gray Code