Library

Mealy · Rational transduction

Gray code back to binary

The inverse of the binary-to-Gray transducer, reading most significant bit first: each binary bit is the previous binary bit XOR the current Gray bit. So the state is the last bit printed, and a 1 in the Gray code flips it.

was0was10/01/10/11/0
The machine as drawn — 2 states, 4 transitions.

The author’s examples, run

0 → reject · 01 → reject · 100 → reject · 0001 → reject · 01000 → reject · 0001111101100011000 → reject · 1010110111101111