cl a simple form of computation used widely one way to find - - PDF document

cl
SMART_READER_LITE
LIVE PREVIEW

cl a simple form of computation used widely one way to find - - PDF document

Finite-State Machines (Automata) lecture 11 cl a simple form of computation used widely one way to find patterns with thanks to Grard Berry 1 ATM wrong PIN insert card PIN ok withdraw e c n a l a b return card


slide-1
SLIDE 1

cl

Finite-State Machines (Automata) lecture 11

  • a simple form of computation
  • used widely
  • one way to find patterns
  • with thanks to Gérard Berry

1

slide-2
SLIDE 2

ATM

£

  • k?

yes choose a/c b a l a n c e withdraw insert card wrong PIN PIN ok amount no take money r e t u r n c a r d return card

2

withdraw

slide-3
SLIDE 3

Counting trains

  • A

B axle sensor (detects passing wheels) from-a-to-b : a↓ ; b↓ ; a↑ ; b↑

a b

from-b-to-a : b↓ ; a↓ ; b↑ ; a↑

3

slide-4
SLIDE 4

Finite-state machines

axle sensor inputs : a↑, a↓, b↑, b↓

  • utputs :

from-a-to-b, from-b-to-a

a↓ b↓ a↑ b↑ / from-a-to-b b↓ a↓ b↑ a↑ / from-b-to-a b↑ a↑ a↓ b↑ a↑ b↓

a b

a a a b b b ab ba 4

slide-5
SLIDE 5

Hierarchical FSMs

carriage counter inputs : a2b, b2a

  • utputs :

A2B, B2A

a2b a2b b2a

a2b / A2B

b2a b2a b2a

b2a / B2A

b2a b2a a2b a2b a2b a2b

b

  • A

B

a2b = from-a-to-b

5

slide-6
SLIDE 6

Industry

  • real-time control, vending machines, cash dispensers, etc.

Electronic circuits

  • data path / control path
  • memory / cache handling
  • protocols, USB, etc.

Communication protocols

  • initiation and maintenance of communication links
  • error detection and handling, packet retransmission

Language analysis

  • natural languages
  • programming languages
  • search engines

Application Fields

001

6

slide-7
SLIDE 7

A Decimal Number

d d

+⎮−

.

d d d ε start end sta sta alternative paths repetition skip S

7

slide-8
SLIDE 8

finite state machines

R S

8

slide-9
SLIDE 9

sequence RS

R S

ε ε ε

9

slide-10
SLIDE 10

alternation R|S

R S

ε ε ε ε

10

slide-11
SLIDE 11

iteration R*

R

ε ε ε ε

11

slide-12
SLIDE 12

finite state spaghetti

12

slide-13
SLIDE 13

suss this?

s

<>

su sus s s u s u s

[]

s su sus • s s s sus • u

[]

su

[]

su

[^su] [] [] [] []

input state

FSAs can be represented as:

  • transition tables as well as
  • graphs

If you’re in state s and you’re looking at a u, go to state su 13 [^su] stands for any character except s or u

[^su] [^s] [^su] [^su] [^su] stands for any character except s or u

slide-14
SLIDE 14

rara

r r a a r r S

14

slide-15
SLIDE 15

ra(ra)*

r a r r S

15

slide-16
SLIDE 16

f

(flip)|(flop) = fl(i|o)p

fl []

fl(i|o)

f l i p

  • S

16

slide-17
SLIDE 17

w

wha+m

wh

[]

wha+ []

w wh wha+

  • w

w

[] []

[] h

[] wh [] []

a

[] []

wha+

wha+

m

[] [] []

  • w

h m a

a

S

17