Library

Mealy · Rational transduction

Two’s complement, least significant bit first

Negate a binary number as it streams in, low bit first: copy the bits up to and including the first 1, then flip every bit after it. Two states — before and after that first 1 — and the output keeps pace with the input.

copyflip0/01/10/1, 1/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 · 1000010011100111