How this calculation works
Convert unsigned words between ordinary binary and reflected Gray encoding.
Encode with n XOR (n shifted right once). Decode by cumulative XOR.A worked example
Binary 111 encodes as Gray 100, and Gray 100 decodes back to 111.
Good to know
Both input fields accept the integer represented by the word.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
Read the result
Convert unsigned words between ordinary binary and reflected Gray encoding.
The primary result is labeled “Encoded Gray word”. Keep the input definitions in view when comparing this result with another method.
Try a related calculation
Both input fields accept the integer represented by the word.
For a related exercise, try the greatest common divisor.
A few questions, answered
How can I check the default inputs by hand?
Binary 111 encodes as Gray 100, and Gray 100 decodes back to 111.
Which rule does this calculator apply?
Encode with n XOR (n shifted right once). Decode by cumulative XOR.