lecture15 fsm i_ic

17
ECE 287 – Lecture 15 Finite State Machines - II

Upload: konsta-anttila

Post on 30-Jul-2015

42 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Lecture15 fsm i_ic

ECE 287 – Lecture 15

Finite State Machines - II

Page 2: Lecture15 fsm i_ic

Announcements

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

Page 3: Lecture15 fsm i_ic
Page 4: Lecture15 fsm i_ic
Page 5: Lecture15 fsm i_ic
Page 6: Lecture15 fsm i_ic
Page 7: Lecture15 fsm i_ic

FSM Example

For the given circuit, we want to use it to store 16 bits of information and check if all the 4 bit individual numbers (4 of them) are all equal.

clk

valid

input out

Page 8: Lecture15 fsm i_ic

Algorithm

Page 9: Lecture15 fsm i_ic

State Diagram

Page 10: Lecture15 fsm i_ic

State Table

Page 11: Lecture15 fsm i_ic

State Machine Circuit

Page 12: Lecture15 fsm i_ic

What if clock is fast?

How does the system start up?

Page 13: Lecture15 fsm i_ic

Actual Comparison Circuit

Page 14: Lecture15 fsm i_ic

Verilog for FSMs

BA

In = 0

In = 0

In = 1

Out = 1Out = 0

In = 1

reset

Page 15: Lecture15 fsm i_ic

Try and build the Verilog for bit matching example at the start of class…

Page 16: Lecture15 fsm i_ic

Problem Set

1. Build a verilog system for:

A

B

G

In = 0

In = 0

In = 0

In = 1

In = 1

In = 1

Out = 1

Out = 1

Out = 0

Page 17: Lecture15 fsm i_ic

Problem Set

1. Build a verilog system 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.