In a Mealy machine, the output gates read the state flip-flops and the input wires. So the output belongs to an arrow, not a state.
- In a state diagram, each arrow is labeled input/output. 0/1 means "on input 0, output 1 and follow this arrow".
- In a state table, each cell holds next state / output: one output per cell, not per row.
- The output equation mentions an input, for example Z = .
Because the output reads the input directly, it can change as soon as the input changes, without waiting for a clock edge. That makes a Mealy machine react one cycle earlier than a moore machine, and it often needs fewer states: a sequence detector for an n-bit pattern needs only n.
The flip side: a Mealy output can glitch whenever the input glitches, and it's only valid once the input has settled. Designers often register a Mealy output, or pick Moore, when a clean signal matters.
When tracing a Mealy machine, read the output on the arrow you take.