A position encoder can assign binary words to neighboring mechanical positions so that only one bit changes at each boundary. That property reduces one particular ambiguity: a neighboring transition does not require several data bits to change together.
It does not turn every received word into an error-checked measurement. A wrong bit can still produce another valid position word, and two observations can skip several positions between them.
Dynapar's Encoder Communications handbook describes the single-bit step property of Gray-coded parallel output. OMRON's rotary-encoder FAQ contrasts that behavior with multiple changing bits in binary code. The calculations below independently generate a standard reflected code and examine invented transitions. They do not reproduce an encoder test or establish a product's accuracy.
Specify the code before reading its digits
Use five-bit unsigned position labels n from 0 through 31. Assign the binary-reflected Gray word G(n) = n XOR (n shifted right by one bit). XOR produces one where the corresponding input bits differ.
This formula defines the mapping used here. Gray code is not a different interpretation of place-value weights: the five digits must be decoded according to the mapping before they are treated as an ordinary binary number.
For example, the binary label 11 is 01011. Its shifted version is 00101. Their XOR is 01110, so label 11 receives Gray word 01110.
Reading that Gray word directly as ordinary binary would give 14 rather than 11. The same digits can carry different meanings under different coding conventions.
A short independently calculated sequence
For labels 10 through 17, the binary and Gray representations are:
10: binary 01010, Gray 01111.
11: binary 01011, Gray 01110.
12: binary 01100, Gray 01010.
13: binary 01101, Gray 01011.
14: binary 01110, Gray 01001.
15: binary 01111, Gray 01000.
16: binary 10000, Gray 11000.
17: binary 10001, Gray 11001.
Each consecutive pair of Gray words differs in exactly one bit. The ordinary binary transition from 15 to 16, in contrast, changes all five bits.
These are mathematical codewords computed from the declared formula, not sampled electrical waveforms. The mapping changes how positions are labeled; it does not add mechanical divisions or measure their placement.
What changes at one boundary
Focus on the ordinary binary transition from label 11 to label 12: 01011 becomes 01100. Three bit positions change.
If those three changes are observed at different instants, a hypothetical sequence of resolved words could be 01011, then 01001, then 01101, then 01100. Those middle words represent labels 9 and 13 in binary, even though the intended transition is between 11 and 12.
This constructed sequence illustrates mixed old and new bits. It is not a claim about the timing of a particular receiver or encoder.
Under the Gray mapping, labels 11 and 12 are 01110 and 01010. Only one bit differs. If every unchanged bit stays correct and the changing bit resolves to either its old or new value, the resulting word is one of those two neighboring labels.
Those assumptions are part of the result. An electrically unsettled bit, unrelated noise, invalid timing, or a corrupted data path is not eliminated by drawing a one-bit transition on paper.
Adjacency describes positions, not every pair of samples
Suppose a receiver observes label 11 and later label 16 without observing the intermediate positions. Their Gray words are 01110 and 11000, differing in three bits.
That does not contradict the one-bit property. The intervening adjacent transitions can each change one bit while their net endpoint difference involves several bits.
The converse is also false: a one-bit difference between two received words does not prove that only one position was traversed. In this five-bit mapping, label 0 has word 00000 and label 3 has word 00010. Those words differ by one bit even though their labels are not neighboring positions.
Counting changed bits therefore cannot reconstruct a missing motion history. A separate assumption about allowable movement between observations would be needed to interpret such snapshots as consecutive position states.
A complete code uses every word
The five-bit reflected mapping assigns 32 distinct codewords to 32 labels. Every possible five-bit pattern is used. There are no unused patterns that can serve, by themselves, as a general indication that a received word is invalid.
Take the correct word for label 11, 01110. Flip only its most significant bit, obtaining 11110. Under the same Gray mapping, that word decodes to label 20.
The corrupted word is a valid codeword, but it identifies the wrong position. Its nine-label error is not constrained to one label merely because only one data bit was changed.
This is why the single-bit adjacency property is different from error-detection redundancy. A protocol may add status, parity, checksums, or other checks under its own definition. Such features must not be assumed from the phrase Gray code alone.
The same distinction applies to a truncated or modified code. Its available words and end-of-range transition need their actual definitions. The adjacency of the full reflected sequence does not automatically prove the same behavior for every shortened position range.
Coding is separate from physical accuracy
Imagine, solely for scale, that all 32 labels divide one ideal revolution into equal bins. Their nominal bin width is 360/32 = 11.25 degrees.
Changing those labels from binary to Gray does not make the bins smaller. It also does not establish their physical widths, angular alignment, sensing accuracy, or the accuracy of a robot joint connected through a mechanism.
A received position word can be correctly decoded while the physical measurement has other errors. Conversely, a physically valid encoder reading can be misinterpreted if its Gray digits are treated as ordinary binary.
For robot feedback records, keep the mapping, word width, range, and data-validity mechanism distinct. Gray coding answers how neighboring positions differ in their assigned words. It does not, by itself, certify a word's integrity or the mechanism's absolute position.
Sources checked October 23, 2026: Dynapar, Encoder Communications handbook, historical PDF as accessed, especially the Parallel Output section; no edition date inferred from incomplete extracted copyright text: https://www.dynapar.com/hubfs/uploadedFiles/Downloads/Encoder%20Communications%20Hanbook.pdf
OMRON, Rotary Encoders FAQ00941, What is the feature of the Gray code?, web edition as accessed; no publication date inferred: https://www.ia.omron.com/support/faq/answer/34/faq00941/index.html
Illustration note: A generic robot motor or mechanical-feedback concept image may accompany this explanation. It does not identify an encoder model, display measured code transitions, or establish positioning accuracy.