Download Finite State Machines - Lecture Slides | CPSC 489 and more Study notes Computer Science in PDF only on Docsity!
Finite State Machines (FSM)
a Functional decomposition into states of operation
a Inputs and outputs are sequences of events
a Typical domains of application:
+ control functions:
+ protocols (telecom, computers, ...}
a Different communication mechanisms:
Âą synchronous
(classical FSMs, Moore â64, Kurshan â90)
+ asynchronous
(CCS. Milner â80: CSP. Hoare â85)
ASV's Slide
FSM Example
m Informal specification:
Af the driver
turns an the key, and
dues not fasien the seat belt within $ seconds
ther an alarm beeps
for 5 seconds, or
anil the driver fasiens the seat Bell, or
until the driver turns off the key
ASV's Slide
â
oo condition is satsied, implicit sloop inthe curren state
vr
ASV's Slide
b:2%S58
eg. 3 (KEY_OFF },
oA 22'x $3 2°
eg. 2 ({ KEY_ON }, OFF ) {START_TIMER }
note: self-looo not imolied in the function
ASV's Slide
ASV's Slide 9
* M, = (Ty
a Find the com
+ M=(1,0,8,r,52)
m given a set of const. for
+ C=((oaQi, iro 0 ipyer 5 iy }
â_â
_
wv
ASV's Slide 10
# B,C ins is bs 52) = ty SoCs ih, 2) =P, }
we have: =
# Slip iy ts}, (982) ) =
.
is Ty (8p 8) ={ Oy 0}
i.e. i, is in input pattern iff o, is in output pattern
ASV's Slide i
_
_
=
i. , §
+ Moore machine: S depends on inpatand'state; only on state
we i alwaynelldefinedââ
. . =
« Mealy maine: Band * depend on input and state >
«composition may he ondefifed =
Âą what if A,( }b Jol Lig}?
Ts 0, output or
+ Causality analysis in Mealy FSMs (Berry *98)
ASV's Slide 12
Moore vs..Mealy
a Theoretically, same-computational power (almost)
a In practice, differcnt characteristics
a Moore machines:
* non-reactive
(response delayed by 1 âŹycle)
+ easy to compose
(always well-defined)
« good for implementation
# software is always âslowâ
+ hardware is better when /Odsdatched
ASV's Slide 13
Moore vs..Mealy
a Mcaly machines:
+ reactive
(0 response time)
« hard to compose
(problem withccombinational-cycles)
Esterel compilation algorithm
+ problematic for implementation
software must be âfast enoughâ.
(synchronous hypothesis)
# may be needed in hardware, for speed
ASV's Slide 4