FST · Rational transduction
Binary → Gray code
Streams a binary number into its Gray code (output = bit XOR previous bit). Adjacent values end up differing in exactly one bit — the trick rotary encoders rely on.
The author’s examples, run
1011 → reject · 11101111 → reject · 10000110 → reject · 01010111 → reject · 01001000 → reject · 1100