You are on page 1of 19

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
r(t) r(t-1)r(1)

s(t) s(t-1)s(1)

OUTPUT CHANNEL

INPUT CHANNEL

INITIALIZE

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
FSM
FSM consist of the following:
1.
The finite sets S,R,Q
2.
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 TransitionAssigned Output


A transition-assigned finite state machine is a six-tuple
M = (Q,S,R,f,g,qi)
Where
Q is a finite set of internal states
S is a finite input alphabet
R 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 Machines
State Table
s

:
.
q

q,r
:
.
s/r
Q q

Representations of Machines
State Diagram

s/r

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 1s
and 0s; it should output 0 if there are even
number of 1s 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 Delay
The 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}
Language Recognizer
Design a FSM to identify the language
L= {abk|k>=0}
Q = {A,B,C}
2.

Class Presentation
BINDING
CONTROL STRUCTURES

You might also like