0% found this document useful (0 votes)
27 views9 pages

04 TOC Moore Machine

The document explains the concepts of Moore and Mealy machines, which are types of finite state machines. A Moore machine's output depends solely on its current state, while a Mealy machine's output depends on both the current state and the input symbol. The document also covers the conversion processes between these two types of machines.

Uploaded by

sinhaaaryankumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views9 pages

04 TOC Moore Machine

The document explains the concepts of Moore and Mealy machines, which are types of finite state machines. A Moore machine's output depends solely on its current state, while a Mealy machine's output depends on both the current state and the input symbol. The document also covers the conversion processes between these two types of machines.

Uploaded by

sinhaaaryankumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

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
𝑎 ൗ𝑏 ൗ𝑏

Σ: A finite input alphabet 1


0 1
q0: The initial/starting state
δ : A transition function, which is a total function from Q x Σ
Δ : Output symbols
λ : Output function λ: Q-> Δ
If the input is of n length the corresponding output is of n+1 length
Transition Table
0
Current state Next state Output
0 1
1 0
𝑞0ൗ 𝑞1 𝑞2
𝑞0 𝑞0 𝑞1 a 𝑎 ൗ𝑏 ൗ𝑏
𝑞1 𝑞2 𝑞0 b
1
𝑞2 𝑞0 𝑞1 b 0 1
Mealy Machine
• Mealy machines are also finite state machines with output value and their
output depends on the present state and current input symbol.
• It is a six tuple machine, M = (Q, Σ, λ, Δ, δ, q0)
Where
𝑏ൗ 𝑎ൗ
1
Q: A finite set of states 1

Σ: A finite input alphabet 𝑞0 𝑞1

q0: The initial/starting state 𝑎ൗ


0
δ : A transition function, δ: (Q x Σ)  Q 𝑏ൗ
0
𝑖𝑛𝑝𝑢𝑡
Δ : Output symbols ൗ𝑜𝑢𝑡𝑝𝑢𝑡
λ : Output function λ: Q x Σ -> Δ

If the input is of n length the corresponding output is also of n length


Transition Table

𝑏ൗ
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.

If the input is of n length the If the input is of n length the


corresponding output is of n+1 length corresponding output is also of n length

λ: 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

Current State Next State


0ൗ
0
Input= 0 Input= 1
State Output State Output
1ൗ 0ൗ
𝑞0 1
𝑞1
0
𝑞2 𝑞0 𝑞0 0 𝑞1 1
𝑞1 𝑞2 0 𝑞0 0
0ൗ 1ൗ 1ൗ
0 0 1 𝑞2 𝑞0 0 𝑞1 1

With m state and n output  max m states


Mealy to Moore Conversion

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

With m state and n output  max m*n states


Using Transition Table
Current Next State State a b output
State 𝑞0 𝑞3 , 0 𝑞11 ,1
Input= a Input= b 𝑞10 𝑞0 ,1 𝑞3 , 0
State Output State Output 𝑞11 𝑞0 ,1 𝑞3 , 0
𝑞0 𝑞3 0 𝑞1 1
𝑞20 𝑞21 ,1 𝑞20 ,0
𝑞1 𝑞0 1 𝑞3 0
𝑞21 𝑞21 ,1 𝑞20 ,0
𝑞2 𝑞2 1 𝑞2 0 𝑞3 𝑞10 ,0 𝑞0 ,1
𝑞3 𝑞1 0 𝑞0 1

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

You might also like