It's pretty easy to compute the shaft's angular position via a formula or lookup table given only the number of encoder bits. Sometimes binary is less than ideal. As the encoder slowly rotates the binary value increases monotonically, thankfully keeping the software that reads it simple. When lots of bits change at once trouble can result. For example, many switching lines can cause crosstalk in the cable.
Gray code is a variation of binary that eliminates much of the problem.
A Gray code encoder will change only one bit at a time as the shaft rotates. Table 1 shows the relationship between Gray and binary. Note that for each sequential entry in the table, the Gray code changes only by a single bit. This reduces the demands made on the transmission channel, whether they are simply wires or a radio link. It's interesting philosophically as well, as the Theory relates how entropy, the amount of disorder in the universe, effects just how fast one can send data over a communications link.