Вы находитесь на странице: 1из 33

Finite State Transducers

Automata with output


• Used for translation
• Lexical analysis
• State based or transition based ouptuts
• Can perform simple computations
• Can be used for coding – decoding
Reads strings of {a,b};
Writes the number of a’s that have been read % 3

Moore
Automata:
state based
output

Note that there is an


output with l
Mealy
Automata:
Transition
based-
output
Reads the output of the previous automaton;
Outputs the original string
Replace
String of {c, a, t} that end with a
$.
Replaces K for all occurrences
of cat
Replace

String of {c, a, t} that end with a $.


Replaces K for all occurrences of cat
Reads strings {a,b,c} that end with $.
When it finds n consecutive s’s it replaces sn
for the sequence of n s’s. It does this for n
between 2 and 5.
So:
Simple Zip aaabbbbaccbbbbbbb$ would produce the
following output:
a3b4ac2b5b2$
Simple Zip
Simple Zip
Simple Zip
Simple Zip
Reads a number (digits followed by $) writes the result
of dividing the number by 4 with the remainder.

Simple Examples:
Arithmetic:
Divide by 4 Input: 345634 output 086408R2

Intput: 1048 output 0262R0


The process of dividing by four

4 856783
The process of dividing by four

2
4 856783
The process of dividing by four

2
4 856783
8
05
The process of dividing by four

21
4 856783
8
05
The process of dividing by four

21
4 856783
8
05
4
----
16
The process of dividing by four

214
4 856783
8
05
4
----
16
The process of dividing by four

214
4 856783
8
05
4
----
16
16
-------
07
The process of dividing by four

2141
4 856783
8
05
4
----
16
16
-------
07
The process of dividing by four

2141
4 856783
8
05
4
----
16
16
-------
07
4
---
38
The process of dividing by four

21419
4 856783
8
05
4
----
16
16
-------
07
4
---
38
The process of dividing by four

21419
4 856783
8
05
4
----
16
16
-------
07
4
---
38
36
---
2
The process of dividing by four
21419
4 856783
8
05
4
----
16
16
-------
07
4
---
38
36
---
23
The process of dividing by four
214195
4 856783
8
05
4
----
16
16
-------
07
4
---
38
36
---
23
20
----
3
The process of dividing by four
214195R3
4 856783
8
05
4
----
16
16
-------
07
4
---
38
36
---
23
20
----
3
What do I have to remember?

• So how many states?


Dividing by
4
Dividing by
4
Dividing by
4
Dividing by
4
Dividing by
4

Вам также может понравиться