= Mealy machine
{c}
{wiki}
A <Mealy machine> is a <finite-state machine> whose transition and output both depend on the current state and input. It consists of a finite state <set> $Q$, input and output <alphabets> $\Sigma,\Gamma$, an initial state, a transition $\delta:Q\times\Sigma\to Q$, and an output map $\lambda:Q\times\Sigma\to\Gamma$.
For a running parity checker, let states be $0,1$ and put $\delta(q,a)=q+a\pmod2$, $\lambda(q,a)=q+a\pmod2$. On input $1101$, it outputs $1001$, the parity after each prefix. Unlike a <Moore machine>, whose output is attached to a state, the output here is attached to a transition. This model naturally represents synchronous controllers and stream transformations.
Back to article page