Hexadecimal To Gray Code
Reverse Conversion
How This Converter Works
Converts hexadecimal input to reflected binary Gray code, discarding redundant leading zero bits before Gray encoding.
Formula or rule
Expand each hex digit to four bits, strip leading zeroes (or retain 0), then form Gray bits as the leading binary bit followed by adjacent-bit XORs.
Example
- Input
- 2D
- Calculation
- 2D₁₆=101101₂; leading bit and adjacent XORs give 1,1,1,0,1,1.
- Result
- 111011