CSCE 222 Lecture 28

From Notes
Jump to navigation Jump to search

« previous | Wednesday, April 13, 2011 | next »


Finite State Machines

A finite state machine is defined by a six-tuple: M=(S,I,O,f,g,s0)

  • S — set of states
  • I — input alphabet
  • O — output alphabet
  • f — transition function (what is the next state given the current state and input)
  • g — output function (what kind of output should I produce?)
  • s0 — start state


Example

M=({s0,s1},x,y,f,g,s0)


Input: binary string of length n, x=(0,xn1,,x0) and y=(0,yn1,,y0)

Output: Computes the sum of two integers x and y. Add x0 and y0 producing a sum z0=x0y0 and a carrier c0=x0y0. Then x1 and y1 are added to the carrier bit yielding z1=x1y1c0 and another carrier c1=x1y1. etc.