Docstoc

L6

Document Sample
L6 Powered By Docstoc
					Background
Have seen FAs with Yes/No output.
– Convenient for theory. – Practical uses include
• • • • • Parity checking Error detection Single-bit control signal generation Pattern matching Circuit verification

Pragmatically, often want more general output.
• • • • • Multi-bit control signal generation Tokenization of input for parsing Pattern matching with grep-like output Communication protocols Circuits for bit-wise operations
1

Transducers (= Mealy Machines)
DFA + output on transitions
M = (Q, S, D, d, l, q0)
Q,S,d,q0 same as in regular DFA. No F: Output is more general than Yes/No acceptance.

D = output alphabet l = output mapping

l: QS  D

Output string is of same length as input string. Very simple extension.
2

Many Variations Possible
Moore machines
DFA + output on states l: Q  D Mealy outputs |x| symbols – each transition. Moore outputs |x|+1 symbols – each state.

More flexible output
– Output comes from D{e} or D*. – As in upcoming example.

Output can represent external action.
– E.g., Increment_Counter. – Action not seen by FA.
3

Communicating Automata
Often useful to use multiple automata.

One machine’s output is another’s input. Why useful?
Model independent communicating processes. Simplify what could be modeled by single, large machine.

Examples
– Processes’ communication protocols – Traffic lights – Processors
4

Communicating Automata: Example
Consider controller for a single intersection.

It does multiple things:
– – – – – Change lights on north-south road Change lights on east-west road Track how long lights have been in current state Sense cars on north-south road Sense cars on east-west road

5

Communicating Automata: Example
Consider controller for a single intersection.

Could model as single automaton:
Timer    Sensor  Sensor

Lots of states – difficult to understand.
6

Communicating Automata: Example
Simplify: Multiple small communicating automata.
Easier to build. Easier to reason about.

Express each output as asserting a shared variable:
– Each light has G, Y, R variables. – Timer has two status variables (long & short), asserted if sufficient time has passed since last light change. – Each sensor can assert its own car-arrived variable.

Each machine has transitions based on variables’ status…
7

Communicating Automata: Example
Timer & Sensors
Assert variables, based on external events.
– External events can’t be fully modeled by FAs.

Variables: Timer
Can assert Long_timer & Short_timer

NS Sensor
Can assert NS_car

EW Sensor
Can assert EW_car

8

Communicating Automata: Example
Lights
E.g., NS Light:
Each state asserts corresponding color variable.
Long_timer  EW_car EW:Y  Short_timer

Short_timer

Example Transition Sequence Light Time 1 NS
EW

Transition

Time 2

Transition

Time 3

G
R

Long_timer  Y EW_car
R

Short_timer R
NS:Y  G Short_timer
9


				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:94
posted:11/12/2007
language:English
pages:9