Mealy and Moore Machines