Slides for Rosen, 5th edition - PowerPoint PPT Presentation

About This Presentation
Title:

Slides for Rosen, 5th edition

Description:

Title: Slides for Rosen, 5th edition Subject: Discrete Mathematics Author: Michael P. Frank Description: Slides developed at the University of Florida for course ... – PowerPoint PPT presentation

Number of Views:283
Avg rating:3.0/5.0
Slides: 14
Provided by: Micha1182
Category:
Tags: 5th | edition | rosen | slides

less

Transcript and Presenter's Notes

Title: Slides for Rosen, 5th edition


1
12.2 Finite State Machines with Output
2
  • Remember the general picture of a computer as
    being a transition function TSI?SO?
  • If the state set S is finite (not infinite), we
    call this system a finite state machine.
  • If the domain SI is reasonably small, then we
    can specify T explicitly by writing out its
    complete graph.
  • However, this is practical only for machines that
    have a very small information capacity.

3
Size of FSMs
  • The information capacity of an FSM is C IS
    log S.
  • Thus, if we represent a machine having an
    information capacity of C bits as an FSM, then
    its state transition graph will have S 2C
    nodes.
  • E.g. suppose your desktop computer has a 512MB
    memory, and 60GB hard drive.
  • Its information capacity, including the hard
    drive and memory (and ignoring the CPUs internal
    state), is then roughly 512223 60233
    519,691,042,816 b.
  • How many states would be needed to write out the
    machines entire transition function graph?

2519,691,042,816 A number having gt1.7 trillion
decimal digits!
4
One Problem with FSMs as Models
  • The FSM diagram of a reasonably-sized computer is
    more than astronomically huge.
  • Yet, we are able to design and build these
    computers using only a modest amount of
    industrial resources.
  • Why is this possible?
  • Answer A real computer has regularities in its
    transition function that are not captured if we
    just write out its FSM transition function
    explicitly.
  • I.e., a transition function can have a small,
    simple, regular description, even if its domain
    is enormous.

5
Other Problems with FSM Model
  • It ignores many important physical realities
  • How is the transition functions structure to be
    encoded in physical hardware?
  • How much hardware complexity is required to do
    this?
  • How close in physical space is one bits worth of
    the machines information capacity to another?
  • How long does it take to communicate information
    from one part of the machine to another?
  • How much energy gets dissipated to heat when the
    machine updates its state?
  • How fast can the heat be removed, and how much
    does this impact the machines performance?
  • Lets consider a basic example.

6
Vending Machine Example
  • Suppose a certain vending machine accepts
    nickels, dimes, and quarters.
  • If gt30 is deposited, change isimmediately
    returned.
  • If the coke button is pressed,the machine
    drops a coke.
  • Can then accept a new payment.

Ignore any otherbuttons, bills,out of
change,etc.
7
Modeling the Machine
  • Input symbol set I nickel, dime, quarter,
    button
  • We could add nothing or ? as an additional
    input symbol if we want.
  • Representing no input at a given time.
  • Output symbol set O ?, 5, 10, 15, 20,
    25, coke.
  • State set S 0, 5, 10, 15, 20, 25, 30.
  • Representing how much money has been taken.

8
Transition Function Table
Old state Input New state Output
0 n 5 ?
0 d 10 ?
0 q 25 ?
0 b 0 ?
5 n 10 ?
5 d 15 ?
5 q 30 ?
5 b 5 ?
Old state Input New state Output
10 n 15 ?
10 d 20 ?
10 q 30 5
10 b 10 ?
15 n 20 ?
15 d 25 ?
15 q 30 10
15 b 5 ?
9
Transition Function Table cont.
Old state Input New state Output
20 n 25 ?
20 d 30 ?
20 q 30 15
20 b 20 ?
25 n 30 ?
25 d 30 5
25 q 30 20
25 b 25 ?
Old state Input New state Output
30 n 30 5
30 d 30 10
30 q 30 25
30 b 0 coke
10
Another Format State Table
Each entryshowsnew state,output symbol
Old state Input Symbol Input Symbol Input Symbol Input Symbol
Old state n d q b
0 5,? 10,? 25,? 0,?
5 10,? 15,? 30,? 5,?
10 15,? 20,? 30,5 10,?
15 20,? 25,? 30,10 15,?
20 25,? 30,? 30,15 20,?
25 30,? 30,5 30,20 25,?
30 30,5 30,10 30,25 0,coke
11
Directed-Graph State Diagram
  • As you can see, these can get kind of busy.

q,5
d,5
q
q
q,20
d
d
d
n
n
n
n
n
n
0
5
10
15
20
25
30
n,5
b
b
b
b
b
b
d,10
q,25
q,15
b,coke
q,10
12
Formalizing FSMs
  • Just like the general transition-function
    definition from earlier, but with the output
    function separated from the transition function,
    and with the various sets added in, along with an
    initial state.
  • A finite-state machine M(S, I, O, f, g, s0)
  • S is the state set.
  • I is the alphabet (vocabulary) of input
    symbols
  • O is the alphabet (vocabulary) of output symbols
  • f is the state transition function
  • g is the output function
  • s0 is the initial state.
  • Our transition function from before is T (f,g).

13
Construct a state table for the finite-state
machine in Fig. 3.
Find the output string for the input 101011
Answer 001000
Write a Comment
User Comments (0)
About PowerShow.com