1. Binary ↔ Gray Code Converters (Zero-Glitch Unit-Distance Code)
A Gray code orders integers so adjacent codewords differ in exactly ONE bit (and wraps smoothly from back to !). Unlike weighted Binary (where transitioning flips 4 bits simultaneously and causes race glitches on asynchronous clock-domain crossings or optical shaft encoders), Gray eliminates multi-bit transition skew completely.
- Binary to Gray () — Parallel 1-Gate-Delay:
- Gray to Binary — Cascaded Prefix XOR: (Note: Binary Gray computes all bits in parallel with 1 XOR delay, whereas Gray Binary ripples through XOR delays unless tree-parallelized!)