Mealy machine

From dankwiki