04 TOC Moore Machine
04 TOC Moore Machine
and
Mealy Machine
Moore Machine
A Moore Machine is a six-tuple. Moore Machines are finite state machines with
output value and its output depends only on the present state.
0
M = (Q, Σ, λ, Δ, δ, q0)
1 0
Q: A finite set of states 𝑞0ൗ 𝑞1 𝑞2
𝑎 ൗ𝑏 ൗ𝑏
𝑏ൗ
Current State Next State 1 𝑎ൗ
1
Input= a Input= b
𝑞0 𝑞1 𝑖𝑛𝑝𝑢𝑡
State Output State Output ൗ𝑜𝑢𝑡𝑝𝑢𝑡
𝑞0 𝑞0 0 𝑞1 1
𝑎ൗ
𝑞1 𝑞1 1 𝑞0 0 0 𝑏ൗ
0
Moore Machine Mealy Machin
output depends only on the present output depends on the present state and
state. current input symbol.
λ: Q-> Δ λ: Q x Σ -> Δ
If input changes, output does not change If input changes, output also changes.
Has more or the same states as that of Has fewer or the same states as that of
the Mealy machine. the Moore machine.
Moore to Mealy Conversion
0
Current state Next state Output
0 1
1 𝑞0 𝑞0 𝑞1 0
𝑞0 𝑞1 0 𝑞2
ൗ0 ൗ1 ൗ0 𝑞1 𝑞2 𝑞0 1
𝑞2 𝑞0 𝑞1 0
1
0 1
0ൗ 0
0
0ൗ 0 𝑞1 0 𝑞1
𝑞0 0 𝑞1 𝑞0 ൗ0 ൗ1
0ൗ
1
1ൗ 1 0
0 1
1ൗ
1 1
𝑞2 𝑞2 1
ൗ0 𝑞2
ൗ1
1ൗ 1
0
State a b output
𝑞1 𝑞2 𝑞0 𝑞3 𝑞11 1
𝑞10 𝑞0 𝑞3 0
𝑞11 𝑞0 𝑞3 1
𝑞20 𝑞21 𝑞20 0
𝑞10 𝑞11 𝑞20 𝑞21
Output 0 Output 1 Output 0 Output 1
𝑞21 𝑞21 𝑞20 1
𝑞3 𝑞10 𝑞0 0