Lecture 19 A bigger FSM example: Hungry Robot Ant in Maze.

Slides:



Advertisements
Similar presentations
(Synchronous) Finite State Machines
Advertisements

ENGIN112 L23: Finite State Machine Design Procedure October 27, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 23 Finite State Machine.
L9 – State Assignment and gate implementation. States Assignment  Rules for State Assignment  Application of rule  Gate Implementation  Ref: text.
1 Steps towards State assignment Slides of Mark Schulz used.
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Finite state machine optimization State minimization  fewer.
CS 151 Digital Systems Design Lecture 25 State Reduction and Assignment.
Introduction to CMOS VLSI Design Lecture 14: CAMs, ROMs, and PLAs Credits: David Harris Harvey Mudd College (Material taken/adapted from Harris’ lecture.
CAMs, ROMs, and PLAs. 2 Outline  Content-Addressable Memories  Read-Only Memories  Programmable Logic Arrays.
Give qualifications of instructors: DAP
Contemporary Logic Design FSM Optimization © R.H. Katz Transparency No Chapter #9: Finite State Machine 9.4 Choosing Flip-Flops 9.5 Machine Partitioning.
Lecture 20: CAMs, ROMs, PLAs. CMOS VLSI DesignCMOS VLSI Design 4th Ed. 20: CAMs, ROMs, and PLAs2 Outline  Content-Addressable Memories  Read-Only Memories.
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
ENGIN112 L25: State Reduction and Assignment October 31, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 25 State Reduction and Assignment.
IKI c-Synthesis of Sequential Logic Bobby Nazief Semester-I The materials on these slides are adopted from: Prof. Daniel Gajski’s transparency.
Lecture 18 More Moore/Mealy machines.
Chapter 8 -- Analysis and Synthesis of Synchronous Sequential Circuits.
1 Lecture 22 State encoding  One-hot encoding  Output encoding State partitioning.
Announcements Assignment 8 posted –Due Friday Dec 2 nd. A bit longer than others. Project progress? Dates –Thursday 12/1 review lecture –Tuesday 12/6 project.
Module : FSM Topic : types of FSM. Two types of FSM The instant of transition from the present to the next can be completely controlled by a clock; additionally,
State Machines The first problem set is now online! (Due on Jan. 31st, 2011)
DLD Lecture 26 Finite State Machine Design Procedure.
Do Now Find the domain & range:. Answers to Homework
A sequential logic circuit (a.k.a. state machine) consists of both combinational logic circuit(s) and memory devices (flip flops). The combinational circuits.
1 CSE370, Lecture 24 Lecture 26 u Logistics n HW8 due Friday n Ant extra credit due Friday n Final exam a week from today, 12/8 8:30am-10:20am here n Review.

Introduction to CMOS VLSI Design Lecture 14: CAMs, ROMs, and PLAs
Finite state machine optimization
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
Finite state machine optimization
Introduction to CMOS VLSI Design Lecture 14: CAMs, ROMs, and PLAs
Lecture 28 Logistics Today
Lecture 26 Logistics Last lecture Today HW8 due Friday
COMP541 Sequential Logic – 2: Finite State Machines
Typical Timing Specifications
ECE 301 – Digital Electronics
Lecture 23 Logistics Last lecture Today HW7 due Friday Lab8 going on
Evaluation in Engineering Design Process Modeling and FSM
CSE 140L Discussion Finite State Machines.
Hakim Weatherspoon CS 3410 Computer Science Cornell University
Lecture 28 Logistics Today
Recap D flip-flop based counter Flip-flop transition table
Digital Logic & Design Dr. Waseem Ikram Lecture No. 31.
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 25 Logistics Last lecture Today HW8 posted today, due 12/5
Relations vs. Functions Function Notation, & Evaluation
Lecture 24 Logistics Last lecture Today HW7 due today
Lecture 23 Logistics Last lecture Today HW7 due Friday Lab8 going on
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Lecture No. 32 Sequential Logic.
Lecture 25 Logistics Last lecture Today HW8 posted today, due 12/5
Lecture 21 Logistics Last lecture Today HW7 due Wednesday
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 24 Logistics Last lecture Today HW7 back today
Lecture 24 Logistics Last lecture Today HW7 due today
Lecture 22 Logistics Last lecture Today
Lecture 20 Logistics Last lecture Today Graded HW back today
Lecture 23 Logistics Last lecture Today HW8 due Wednesday, March 11
ECE 352 Digital System Fundamentals
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Lecture 18 Logistics Last Lecture Today HW6 due today Midterm 2
Lecture 18 Logistics Last lecture Today HW5 due today (with extra 10%)
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Lecture 20: CAMs, ROMs, PLAs
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
ECE 352 Digital System Fundamentals
Announcements Assignment 7 due now or tommorrow Assignment 8 posted
CSE 370 – Winter Sequential Logic-2 - 1
Introduction to CMOS VLSI Design Lecture 18: CAMs, ROMs, and PLAs
Presentation transcript:

Lecture 19 A bigger FSM example: Hungry Robot Ant in Maze

Robotic ant in a maze Help the ant escape the maze to find food! Maze has no islands Food! start

Robotic ant specifics Sensors Actuators What strategy should we use? L and R antennae, 1 if touching wall Actuators F - forward step, TL/TR - turn left/right What strategy should we use? Right-hand rule! (It works in physics and pretty much everywhere else…)

Right-hand rule Keep the wall to the right of the ant

Special cases: What to do? Left (L) antenna touching the wall

Special cases: What to do? Ant lost (not adjacent to any wall)

Special cases: What to do? Ant lost (not adjacent to any wall)

Robot ant behavior A: Following wall, touching Go forward, turning left slightly B: Following wall, not touching Go forward, turning right slightly D: Hit wall again Back to state A C: Break in wall Go forward, turning right slightly E: Wall in front Turn left until... F: ...we are here, same as state B G: Turn left until... LOST: Forward until we touch something

Notes and strategy Notes Strategy Maze has no islands Corridors are wider than ant Don’t worry about startup Assume a Moore machine Assume D flip-flops Strategy Right-hand rule!

FSM design procedure 1. State diagram 2. State-transition table 3. State minimization 4. State encoding 5. Next-state logic minimization 6. Implement the design

Notations Sensors on L and R antennae Movement Sensor = “1” if touching wall; “0” if not touching wall L'R'  no wall L'R  wall on right LR'  wall on left LR  wall in front Movement F  forward one step TL  turn left slightly TR  turn right slightly

1. State diagram Make certain that transitions L’ R’ L’ R A/D [TL, F] B/C/F [TR, F] L’ R L’ R’ L’ R’ L’ R’ LR L R’ L R’ G [TL] LR R E [TL] L R’ R L R’ L R’ Make certain that transitions from all states are defined on all possible inputs LOST (F) L’ R’ R

2. State transition table state L R next state outputs LOST 0 0 LOST F LOST X 1 E F LOST 1 0 G F E 0 0 B TL E X 1 E TL E 1 0 G TL G 0 0 B TL G X 1 E TL G 1 0 G TL A 0 0 B TL, F A 0 1 A TL, F A 1 0 G TL, F A 1 1 E TL, F B 0 0 B TR, F B 0 1 A TR, F B 1 0 G TR, F B 1 1 E TR, F Same outputs and transitions  can merge states

3. State minimization Result of merging states E and G L’ R’ L’ R A/D [TL, F] B/C/F [TR, F] L’ R L’ R’ L’ R’ L Result of merging states E and G L L+R E/G [TL] LOST (F) L’ R’ L+R

4. State encoding state L R next state outputs X Y X+ Y+ F TR TL 0 0 0 0 0 0 1 0 0 0 0 X 1 0 1 1 0 0 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 1 0 1 X 1 0 1 0 0 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 1 0 1 1 0 1 X 0 1 1 0 1 1 1 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 X 0 1 1 1 0 state L R next state outputs LOST 0 0 LOST F LOST X 1 E F LOST 1 0 E F E 0 0 B TL E X 1 E TL E 1 0 E TL A 0 0 B TL, F A 0 1 A TL, F A 1 X E TL, F B 0 0 B TR, F B 0 1 A TR, F B 1 X E TR, F

5. Next-state logic minimization 0 1 1 1 0 0 1 1 0 0 0 0 X X+ Y R L 0 1 1 1 1 1 1 1 1 1 0 0 X Y+ Y R L state L R next state outputs X Y X+ Y+ F TR TL 0 0 0 0 0 0 1 0 0 0 0 X 1 0 1 1 0 0 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 1 0 1 X 1 0 1 0 0 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1 1 0 1 1 0 0 1 1 0 1 0 1 1 0 1 X 0 1 1 0 1 1 1 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 X 0 1 1 1 0 1 0 1 1 1 0 1 1 X F Y R L 0 0 1 0 X TR Y R L 0 1 0 1 X TL Y R L Why are the 1's in the last 3 K-maps in vertical columns?

6. Implement the design Outputs are a function of the current state only - Moore machine L R F TR TL Next State Current State output logic next state logic X+ Y+ X Y