Convert between Gray code, binary and decimal for absolute encoders.
Enter a decimal number, e.g. 45
Gray code changes only one bit between consecutive values, which makes it robust for absolute encoders. The tool converts between Gray code, binary and decimal.
Formula
binary → gray: g = b XOR (b >> 1) gray → binary: b_i = g_i XOR b_(i+1)
Example
Decimal 5 = binary 101 → Gray 111; Gray 111 → binary 101 = 5.
Notes
// RELATED TOOLS