Introduction to Finite State Machine (FSM) - PowerPoint PPT Presentation

1 / 51
About This Presentation
Title:

Introduction to Finite State Machine (FSM)

Description:

Key characteristics of FSM. Focus is on control. Appropriate for specifying systems having ... Nondeterministic FA (NFA) NFA. Differs from deterministic model ... – PowerPoint PPT presentation

Number of Views:906
Avg rating:3.0/5.0
Slides: 52
Provided by: hassa
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Finite State Machine (FSM)


1
Introduction to Finite State Machine (FSM)
  • Csci562

2
Objectives
  • Automata Based specification
  • Finite State Machine
  • Statecharts
  • Petri Nets

3
FSM
  • Key characteristics of FSM
  • Focus is on control
  • Appropriate for specifying systems having finite
    set of states
  • Used to specify a system with limited states
    (e.g. ,lexical analyzers)
  • Key problem
  • State Explosion Problem (SEP)
  • A variety of models have been proposed to
    overcome SEP

4
(No Transcript)
5
(No Transcript)
6
(No Transcript)
7
(No Transcript)
8
(No Transcript)
9
(No Transcript)
10
(No Transcript)
11
(No Transcript)
12
(No Transcript)
13
(No Transcript)
14
(No Transcript)
15
(No Transcript)
16
(No Transcript)
17
(No Transcript)
18
(No Transcript)
19
Simple DFA Lexical analyzer
a d
a
A B
A
B
a
B B B
d
20
Simulating DFA
  • Input an input string X terminated by eof
  • Output
  • Yes if M accepts string x,
  • No otherwise

21
FSM Simulation Algorithm
s S0 c getnextchar() While c? eof do s
move(s,c) cgetnextchar End If s ?F then
return yes Else return no
22
Nondeterministic FA (NFA)
  • NFA
  • Differs from deterministic model
  • For any given state and input symbol, there may
    exist more than one transition

23
example
  • FA for (ab)abb

b
b
0
1
3
2
a
b
a
Possible paths lt0, 0, 1,2,3gt, lt0,0,0,0,0gt
24
(No Transcript)
25
(No Transcript)
26
(No Transcript)
27
(No Transcript)
28
(No Transcript)
29
(No Transcript)
30
(No Transcript)
31
(No Transcript)
32
Example A chocolate Vending Machine (CVM)
  • CVM will dispense a chocolate bar for 11 cents.
  • The requirements for machine are
  • Accepts 1, 10 cents
  • Gives no changes
  • Refunds all coins if wrong amount (too little or
    too much) is given
  • Cannot accepts more than two coins

33
(No Transcript)
34
(No Transcript)
35
(No Transcript)
36
(No Transcript)
37
(No Transcript)
38
(No Transcript)
39
(No Transcript)
40
(No Transcript)
41
(No Transcript)
42
(No Transcript)
43
(No Transcript)
44
(No Transcript)
45
(No Transcript)
46
(No Transcript)
47
(No Transcript)
48
(No Transcript)
49
(No Transcript)
50
(No Transcript)
51
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com