Presentation is loading. Please wait.

Presentation is loading. Please wait.

Finite-State Machines with Output

Similar presentations


Presentation on theme: "Finite-State Machines with Output"— Presentation transcript:

1 Finite-State Machines with Output

2 Example of a FSM with Output
A vending machine accepts nickels (5¢), dimes (10¢), and quarters (25¢). When 30¢ or more has been deposited, the machine returns the amount over 30¢. The customer can then press an O-button to receive orange juice or an R-button to receive apple juice

3 Example of a FSM with Output
The same FSM can be represented using a table

4 FSMs with Outputs A finite-state machine M = (S, I, O, f, g, s0) consists of: a finite set S of states a finite input alphabet I a finite output alphabet O an initial state s0 a transition function f an output function g Example 1: S = {s0, s1, s2, s3} I = {0, 1} O = {0, 1} Initial: s0 f, g: state table/diagram

5 FSMs with Outputs Example 2: unit-delay machine
given the bit string x1x2…xk it produces 0x1x2…xk-1

6 FSMs with Outputs Example 3: adding machine for binary integers
given (xn…x1x0)2 and (yn…y1y0)2 it produces their sum


Download ppt "Finite-State Machines with Output"

Similar presentations


Ads by Google