Finite Automata With Output: Ege University Department of Computer Engineering
Finite Automata With Output: Ege University Department of Computer Engineering
Finite Automata With Output: Ege University Department of Computer Engineering
Automata Theory
Ege University
Department of Computer Engineering
Moore Machines
A Moore machine a collection of five
things:
A finite set of states (q0, q1, q2, ....) where q0 is the
start state.
An alphabet of letters for forming the input string.
An alphabet of possible output characters.
A transition table that shows for each state and each
input letter what state is reached next.
An output table that shows what character from output
characters alphabet is printed by each state as it is
entered.
Do. Dr. R. Cenk Erdur, 2013
q0 / 1
q1 / 0
q2 / 0
Do. Dr. R. Cenk Erdur, 2013
q3 / 1
b
q0 / 0
q1 / 0
q2 / 0
q3 / 1
a
b
Output Table
q0
q1
q2
q3
q1
q2
q2
q1
Input String
State
Output
a a a b a b b a a b b
q1 q2 q2 q3 q1 q0 q0 q1 q2 q3 q0
0 0 0 1 0 0 0 0 0 1 0
q0
0
q0
q0
q3
q0
0
0
0
1
Mealey Machine
A Mealy Machine is a collection of four
things:
A finite set of states (q0, q1, q2, ....) where q0 is the start
state.
An alphabet of letters for forming the input string.
An alphabet of possible output characters.
A pictorial representation with states represented by
small circles and directed edges indicating transitions
between states. Each edge is labeled with a compound
symbol of the form i/o, where i is an input letter and o is
an output character.
Do. Dr. R. Cenk Erdur, 2013
Example-1
Mealey Machine for 1s complement:
0/1, 1/0
q0
Example-2
Mealey Machine for incrementing a number by 1:
0/0, 1/1
0/1
Start
0/1
1/0
No
Carry
Owe
Carr
y
Input:1011
Output:1100
1/0
Example-3
Mealey Machine that finds the number of aa and bbs:
a/1
1
a/0
b/0
a/0
S
b/0
Input:aaa
Output:011
Input:ababbaab
b/1 Output:00001010
10
Example -4
Sequential logic circuits can be modeled using
Mealey Machines. An example is given below:
input
A
NAND
B
DELAY
OR
output
OR
Do. Dr. R. Cenk Erdur, 2013
11
Example- 4
Four states based on whether there is current at
points A and B in the circuit or not? (Current in a
wire is denoted by 1, no current by 0.)
q0: A=0
q1: A=0
q2: A=1
q3: A=1
B=0
B=1
B=0
B=1
12
Example-4
Old State
After input 0
New State Output
After input 1
New State Output
q0
q1
q2
q3
q2
q2
q3
q3
q2
q0
q1
q1
0
1
0
1
q0
1/1
1
1
1
1
0/0, 1/1
0/1
q1
q2
1/1
1/1
0/0
q3
0/1
13
TG
One
One or
more
Some
Some
or none or none
Letters Words
from from *
NFA
NFA- Moore
Mealy
One
One
One
One
Some
None
or none
Letters Letters
from from
and
Number One for Arbitrary Arbitrary Arbitrary One for
each
of Edges each
letter in
letter in
from
Each
State
DeterYes
No
No
No
Yes
ministic
?
None
Output No
Yes
No
Some
or none
Letters
from
No
No
Yes
i/o
i from
o from
One for
each
letter in
Yes
14