What is Gray Code?

Posted by London Rhodes on Jun 18, 2021 12:37:38 PM

Gray Code is a form of binary. The difference between Gray code and binary is the method of incrementing to the next number. In Gray Code, only one digit may change states for every increment. This means the count sequence would look something like this 0,1, 3, 2, 6, and 7. This is different than standard binary, where the sequence would be 0, 1, 2, 3, 4, and 5.

Gray Code Binary
0000 0 0000 0
0001 1 0001 1
0011 2 0010 2
0010 3 0011 3

Gray Code is used to prevent errors as transitions to the next state occur. An example of how an error could occur would be where both values in the sequence were true. This can occur due to the timing sequence and the capacitance of the cable. The transition from 0011 to 0100 could cause 0111 to be generated, with Gray code this is not possible.

Topics: Encoder Signals Output