Sie sind auf Seite 1von 15

2.

Finite State Automata


Combinatorial Circuits:
Output only depends on input
Having no memory

Sequential Circuits:
 o/p not only depends on i/p but also on the
state of the system at the time i/p is
introduced.
 The state of the system is determined by
previous processing.
 These circuits have memory.
Serial Adder
 A serial adder accepts as input two
binary numbers x and y and outputs the
sum z = x + y
x = xNxN-1…x1x0
y = yNyN-1…y1y0
z = zNzN-1…z1z0
 x and y are input sequentially in pairs
x0,y0; x1,y1; …; 0,0
 The sum is the output z0, z1,…, zN
Example of a Serial Adder
A serial adder circuit  x1 = 1, y1 = 1.
performs addition in the  Adding these two,
binary system obtain z1 = 0 and i = 1
Example: add x + y,  x2 = 0, y2 = 0.
 Add these two plus
where x = 010 and y = 011
the last i =1 and
 x0 = 0, y0 = 1. obtain z2 = 1
 Adding these two, obtain
 Final answer is
z0 = 1 and i = 0
z = 101
Finite-State Machines
 Finite State Machine (FSM) is an abstracted model
of m/c with a primitive internal memory.
 Finite State Automata (FSA) is a special kind of
FSM that is closely linked to a particular type of
language.
A finite-state machine M = (I, O, S, f, g, ), where:
i) I is a finite set of input symbols
ii) O is finite set of output symbols
iii) S is a finite set of states
iv) f: S x I  S is a next-state function
v) g: S x I  O is an output function
vi)  is an initial state
Example of a Finite-State Machine
Input f g
 I = {a, b} symbols a b a b
 O = {0, 1}
States 0 0  1 0 1
 S = {0, 1}
1 1  1 1 0
 f and g are defined
by the table and the
transition diagram

Fig. Transition diagram


Input and Output Strings

 Given a finite state machine M = (I, O, S, f,


g,), an input string for M is a finite sequence
 = x1x2…xn over I, i.e. xj  I for 1 < j < n.

 Given an input string  = x1x2…xn, then


 = y1y2…yn is an output string for M if
 there exist states 0 = , i = f(i-1,xi) for i = 1,…, n
 and yi = g(i-1,xi) for i = 1,…, n.
A Serial Adder Finite-State Machine
 A serial adder accepts pairs of bits, thus its input
set is {00, 01, 10, 11}
 And the output set is the set {0, 1}
 Two states: NC (no carry) and C (carry)
 Initial state NC

Fig. Transition diagram


SR flip-flop (1)
Set-Reset flip-flop
S R Q
1 1 Not allowed
1 0 1
0 1 0
0 0 1 if S was last 1
Sequential circuit implementation
0 if R was last 1
of the SR flip-flop

Its Transition diagram ?


SR flip-flop (2)
Finite State Automata
A finite-state automaton Example of a FSA
is a special kind of finite Input f g
symbols
state machine. a b a b
 A = (I, O, S, f, g, ) with States 0 1 0 1 0
output set O = {0, 1} and 1 2 0 1 0
the current state 2 2 1 1 0
determines the next
state.
 States for which the last
output is 1 are called
accepting states.
Alternative definition of a FSA

 A finite-state automaton A is
 I = set of input symbols
 S = set of states
 f :S x I  S, next-state function
 A  S, a set of accepting states
  = initial state
Write A = (I, S, f, A , )
Accepted strings

 = x1x2…xn is an accepted string over I


if there are states 0, 1,…, n satisfying
a) 0 = 
b) f(i-1,xi) = i, for i = 1,…, n
c) n  A
Examples of accepted strings
 Some of the strings accepted by the FSA in the
diagram are: a, an (n >1), abak (k > 1), (ab)mak
(k >1), etc.
 Let Ac(A) = {accepted strings of A}
 Strings ending in b are not accepted
Equivalent Finite-State Automata

Two FSAs A and A' are


equivalent if they accept
exactly the same strings
i.e. Ac(A) = Ac(A' )
Here, the strings: baa and
bab are same accepted
by A and A'

Das könnte Ihnen auch gefallen