Moore machine is a finite state machine in which the next state is decided by the current state and the current input symbol.
The output symbol at a given time depends only on the present state of the machine.
The Moore machine has 6 tuples
(Q, q0, Σ, O, δ, λ)
The state diagram is as follows −
Input − 010
Transition − δ (q0,0) => δ(q1,1) => δ(q1,0) => q2
Output − 1110(1 for q0, 1 for q1, again 1 for q1, 0 for q2)
The transition table for Moore machine is as follows −
|Current State||Next State||Output|
Design a Moore machine whether an input string contains an even or odd number of 1's.
If input is even number of 1’s, the output is 1
Otherwise, the output is 0
The transition diagram is as follows −
The transition table is as follows −
|Current state||Next state input 0||Next state input 1||Output|