chapter 2 introduction to finite state machines l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Chapter 2 Introduction To Finite State Machines PowerPoint Presentation
Download Presentation
Chapter 2 Introduction To Finite State Machines

Loading in 2 Seconds...

play fullscreen
1 / 30

Chapter 2 Introduction To Finite State Machines - PowerPoint PPT Presentation


  • 875 Views
  • Uploaded on

Chapter 2 Introduction To Finite State Machines. Presented By: Cecilia Parng Class: C.S. 147 Prof: Sin-Min Lee. Topics To Cover. 2.1 State Diagrams And State Tables 2.2 Mealy And Moore Machines 2.3 Designing State Diagrams. State Table. Inputs. Present state. Next State. Outputs.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 2 Introduction To Finite State Machines' - salena


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
chapter 2 introduction to finite state machines
Chapter 2Introduction To Finite State Machines

Presented By: Cecilia Parng

Class: C.S. 147

Prof: Sin-Min Lee

topics to cover
Topics To Cover

2.1 State Diagrams And State Tables

2.2 Mealy And Moore Machines

2.3 Designing State Diagrams

state table
State Table

Inputs

Present state

Next State

Outputs

  • A state table is similar to the truth table
    • present state
    • all inputs
    • next state
    • all outputs .
important rule for state table
Important Rule for State Table

Complete state table must include each possible combination of present states and input values, and no such combination may match more than one row of the table

state diagrams
State Diagrams

J’

Y

  • A state diagram:
    • Each state is represented by a circled vertex
    • Each row of the state table is shown as directed arc
important rule for state diagram
Important Rule for State Diagram

State diagram has same situation as state table. Their conditions should be mutually exclusive, no input values should meet the condition of more than one arc.

the alarm clock
The Alarm Clock

Presentstate

Turn off alarm

Alarm

Weekday

Nextstate

On

X

Awake in bed

Asleep

Yes

Awake in bed

Off

Yes

No

Awake and up

No

Awake in bed

Asleep

No

Off

state diagram for the alarm clock a
State Diagram for The Alarm Clock (a)

Alarm

Turn off Alarm = Yes

Asleep

Awake in bed

Alarm’

Alarm

Alarm’ /\ Weekday

Alarm’ /\ Weekday’

Awake and up

1 (Always)

( a )

the alarm clock problem with inaction states
The alarm clock problem with inactionstates

Present state

Alarm

Weekday

Next state

Turn off alarm

Asleep

Asleep

Off

X

No

On

X

Yes

Asleep

Awake in bed

Awake in bed

X

yes

On

Awake in bed

Off

Yes

Awake and up

No

Awake in bed

Awake in bed

Off

No

Asleep

No

X

Awake and up

X

Awake and up

No

state diagram for the alarm clock b
State Diagram for The Alarm Clock (b)

Alarm / 1

Asleep

Awake in bed

Alarm’ / 0

Alarm / 1

Alarm’ /\ Weekday / 0

Alarm’ /\ Weekday’ / 0

Awake and up

1 (Always) / 0

( b )

1 = yes turn off alarm (output)

0 – no turn off alarm (output)

state tables for the jk flip flop
State Tables for The JK Flip-Flop

Present State

J

K

Next State

Q

Y

0

0

Y

0

Y

0

1

Y

0

Y

1

0

Z

1

Y

1

1

Z

1

Z

0

0

Z

1

Z

0

1

Y

0

Z

1

0

Z

1

Z

1

1

Y

0

( a )

mealy and moore machines
Mealy and Moore Machines
  • A finite state machine can represent outputs in one of two ways
    • Moore Machines
    • Mealy Machines
moore machines
Moore Machines
  • Moore Machines
    • Associates its outputs with the states.
    • Output values depend only on the state and not on the transitions.
    • It requires less hardware to produce the output values
    • It is well suited for representing the control units of microprocessors and cpu.
state diagram for the alarm clock a15
State Diagram for The Alarm Clock (a)

Alarm

Turn off Alarm = Yes

Asleep

Awake in bed

Alarm’

Alarm

Alarm’ /\ Weekday

Alarm’ /\ Weekday’

Awake and up

1 (Always)

Moore Machine

mealy machines
Mealy Machines
  • Mealy Machines
    • Associates outputs with the transitions.
    • It depends on both its state and its input values
state diagram for the alarm clock b17
State Diagram for The Alarm Clock (b)

Alarm / 1

Asleep

Awake in bed

Alarm’ / 0

Alarm / 1

Alarm’ /\ Weekday / 0

Alarm’ /\ Weekday’ / 0

Awake and up

1 (Always) / 0

Mealy Machine

designing state diagrams
Designing State Diagrams

Counter

String Checker

Toll Booth

modulo 6 counter
Modulo 6 Counter
  • A modulo 6 counter is a 3-bit counter that counts through the sequence.
    • 000 001 010 011 100 101 000…
    • 0 1 2 3 4 5 0 …

Unlike a regular 3-bit counter

110(6) and 111(7) do not count

state table for the modulo 6 counter
State Table for The Modulo 6 Counter

Present State

U

Next State

C

V2 V1 V0

S0

0

S0

1

0 0 0

S0

1

S1

0

0 0 1

S1

0

S1

0

0 0 1

S1

1

S2

0

0 1 0

S2

0

S2

0

0 1 0

S2

1

S3

0

0 1 1

S3

0

S3

0

0 1 1

S3

0

1 0 0

1

S4

S4

0

S4

0

1 0 0

S4

1

S5

0

1 0 1

S5

0

S5

0

1 0 1

S5

1

S0

1

0 0 0

state diagram for the modulo 6 counter mealy
State Diagram for The Modulo 6 Counter (Mealy)

0 / 1000

0 / 0001

0 / 0010

S0

S1

S2

1 / 0001

1 / 0010

1 / 1000

1 / 0011

S5

S4

S3

1 / 0101

1 / 0100

0 / 0101

0 / 0100

0 / 0011

( a ) Mealy

state diagram for the modulo 6 counter moore
State Diagram for The Modulo 6 Counter (Moore)

C=0

V=0010

C=1

V =000

C=0

V=010

S0

S1

U

U

S2

U’

U’

U’

U

U’

S5

S4

S3

U’

U’

U

U

C=0

V=101

C=0

V=100

C=0

V=011

( b ) Moore

string checker
String Checker

A String Checker inputs a string of

bits, one bits per clock cycle.

It checks bits 1,2, and 2, then 2,3,and 4 and so forever

state table for string checker
State Table For String Checker

Present State

L

Next State

M

0

1

0

1

0

1

0

1

0

1

0

1

0

1

0

1

S0

S1

S2

S3

S4

S5

S6

S7

S0

S1

S2

S3

S4

S5

S6

S7

0

0

0

0

0

0

1

0

0

0

0

0

0

0

1

0

S0

S0

S1

S1

S2

S2

S3

S3

S4

S4

S5

S5

S6

S6

S7

S7

state diagrams for the string checker mealy
State Diagrams for the String Checker ( Mealy)

0/0

S5

S6

S4

1/0

0/0

0/1

0/1

0/0

1/0

S7

0/1

1/0

S0

0/0

1/0

1/0

0/0

1/0

S3

S2

S1

0/0

1/0

Mealy

state diagrams for the string checker moore
State Diagrams for the String Checker (Moore)

I’

M=0

M=1

M=0

I

S6

S5

S4

I’

I’

I’

I

S7

I

S0

I

I’

I’

I’

I

M=0

M=0

I

I

S3

S2

S1

I’

M=0

M=0

M=0

I

Moore

toll booth controller
Toll Booth Controller
  • A toll booth controller has two external sensors.
    • Indicates a car is at the toll booth
    • Indicates a coin has been deposited in the toll booth’s collection basket and its value
states for the toll booth controller
States for the toll booth controller

State

Condition

R G A

SNOCAR

S0

S5

S10

S15

S20

S25

S30

Spaid

Scheat

No car in toll booth

1 0 0

Car in toll booth, 0 cents paid

1 0 0

Car in toll booth, 5 cents paid

1 0 0

Car in toll booth, 10 cents paid

1 0 0

Car in toll booth, 15 cents paid

1 0 0

Car in toll booth, 20 cents paid

1 0 0

Car in toll booth, 25 cents paid

1 0 0

Car in toll booth, 30 cents paid

1 0 0

Car in toll booth, full toll paid

0 1 0

Car left toll booth without paying full toll

1 0 1

I1I0 = 00 no coin has been deposited

I1I0 = 01 nickel has been deposited

I1I0 = 10 dime has been deposited

I1I0 = 11 quarter has been deposited

R Red light

G Green light

A Alarm

C = 1 Car enters the toll booth

C = 0 No car arrives

slide29

The End

*****