Decimal To Gray Code
Reverse Conversion
How This Converter Works
Converts a nonnegative decimal digit string to Gray code through its binary representation.
Formula or rule
Remove whitespace and underscores; require decimal digits only, convert to binary, then XOR the binary integer with itself shifted right by one.
Example
- Input
- 10
- Calculation
- 10₁₀ = 1010₂; leading bit 1 followed by adjacent XOR bits 1,1,1.
- Result
- 1111