Lecture14 fsm ic

16
ECE 287 – Lecture 14 Finite State Machines - I

Transcript of Lecture14 fsm ic

Page 1: Lecture14 fsm ic

ECE 287 – Lecture 14

Finite State Machines - I

Page 2: Lecture14 fsm ic

Announcements

• Next Quiz on Wednesday after Exam• Exam II – Nov 15th

• Last Day to Demo Labs – Nov 14th

• Project Oral Proposal - Nov 1st

Page 3: Lecture14 fsm ic
Page 4: Lecture14 fsm ic
Page 5: Lecture14 fsm ic
Page 6: Lecture14 fsm ic
Page 7: Lecture14 fsm ic

Robot control START

Approach

Ask Name

Response?

Small Talk

Sense Compatibility?

Ask on Date/Contact

SUCCESS

False

True

False

True

False

True

Page 8: Lecture14 fsm ic

1) System of inputs, outputs and states• Peter: Assume input for question and input

for if action complete

Page 9: Lecture14 fsm ic

2) State Diagram

Page 10: Lecture14 fsm ic

3) Encode States

Page 11: Lecture14 fsm ic

4) State table

Page 12: Lecture14 fsm ic

5) Build Circuit

Page 13: Lecture14 fsm ic

State Machine Generalization

State

Combinational circuit

Inputs outputs

Current State

Next State

Page 14: Lecture14 fsm ic

Example 2

Turn a light on every 4 cycles of a clock using a state machine

Page 15: Lecture14 fsm ic

Problem Set

1. Build a finite state machine for the following state diagram:

A

B

G

In = 0

In = 0

In = 0

In = 1

In = 1

In = 1

Out = 1

Out = 1

Out = 0

Page 16: Lecture14 fsm ic

Problem Set

1. Build a finite state machine for:• Design a state machine controller for an elevator. The elevator can be at one of two

floors: Ground or First. There is one button that controls the elevator, and it has two values: Up or Down. Also, there are two lights in the elevator that indicate the current floor: Red for Ground, and Green for First. At each time step (clock), the controller checks the current floor and current input, changes floors and lights in the obvious way.