Gray Code To Decimal
How This Converter Works
Decodes an untrimmed reflected binary Gray-code bit string containing only 0 and 1 to a non-negative decimal integer.
Formula or rule
Cumulatively XOR Gray bits to recover binary, then parse that binary string in base 2 and format in base 10.
Example
- Input
- 1111
- Calculation
- Gray 1111 decodes cumulatively to binary 1010; 1010₂ = 10₁₀.
- Result
- 10