Download - Finite State Machines
FINITE STATE MACHINES
Where can you find applications of FSMs Computer Design Communications Linguistics Theory of Computations
Basic Concepts Most complex devices are realized by
interconnecting many simple components Only a finite number of physical symbols can
be enclosed a specified volume The symbols used to signal events between
the components are often represented by the values of physical quantities
A given signal or state requires a small but nonzero interval to measure
Basic Concepts
We convert problem solutions into sequence of steps
Designing machines one step at a time is the simplest way to make its behavior deterministic
Finite State Machines are
Finite Discrete Sequential Deterministic
Applied FSMs
Mechanical Systems Digital Electronic Systems Pneumatic and Hydraulic Systems Chemical Systems Informstion Processing Systems
Properties of Finite State Machines
INPUT CHANNEL OUTPUT CHANNEL
INITIALIZE
s(t) s(t-1)…s(1) r(t) r(t-1)…r(1)
Properties of FSM The behavior of M is defined only at the
moments t = 0, 1, 2, …
The input symbols s(t) are chosen from a finite input alphabet S
The output symbols r(t) are chosen from a finite output alphabet R
Properties of FSM The behavior of M is uniquely determined by
the sequence of input symbols presented
The behavior of M carries it through a sequence of states, each of which is a member of the state set Q
There is an initial state qi of M that describes the condition of the parts of M just before any stimulus is presented
Mathematical Description of FSMFSM consist of the following:1. The finite sets S,R,Q2. A state transition function f that gives the next
state of M in terms of the current state and the next input symbol
3. An output function g that gives the next output symbol of M in terms of the current state and next input symbol
4. A predetermined initial state q(0) = qi in which M is placed prior to instant t = 0
Machine with Transition-Assigned OutputA transition-assigned finite state machine is a six-tuple M = (Q,S,R,f,g,qi)
WhereQ is a finite set of internal statesS is a finite input alphabetR is a finite output alphabet f is the state transition function, f: Q x S Q g is the output function, g: Q x S R qi is the initial state
Representations of MachinesState Table
: .
… q’,r …
: .
q
s
s/rQ q’
Representations of Machines
State Diagram
s/rq q’
q’ = f(q,s) r = g(q,s)
Example 1
The Modulo-3 Counter
Design a FSM whose output tells the number of inout symbols modulo 3. Let a be the input symbol
Example 2
The Parity Checker (Even Parity)
Design a FSM that will accept a series of 1’s and 0’s; it should output 0 if there are even number of 1’s in the input stream otherwise it should output 1
Example 3
Language Recognizer
Design a FSM to identify if an input w is an element of the language
L ={ 11*01*}
LUNCH BREAK!
CS Entry 4 (25 points each)1. The 2-Unit DelayThe input and output alphabets of machine M are
{0,1}. The output sequence is to be a replica of the input sequence delayed by two time units
Q = {A,B,C,D}
2. Language RecognizerDesign a FSM to identify the languageL= {abk|k>=0}Q = {A,B,C}
Class Presentation
BINDING
CONTROL STRUCTURES