Lecture 20 Logistics Last lecture Today Graded HW back today

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.
Introduction to Sequential Circuits
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Give qualifications of instructors: DAP
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
Introduction to CMOS VLSI Design Lecture 14: CAMs, ROMs, and PLAs Credits: David Harris Harvey Mudd College (Material taken/adapted from Harris’ lecture.
FSMs 1 Sequential logic implementation  Sequential circuits  primitive sequential elements  combinational logic  Models for representing sequential.
CAMs, ROMs, and PLAs. 2 Outline  Content-Addressable Memories  Read-Only Memories  Programmable Logic Arrays.
Give qualifications of instructors: DAP
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)
Lecture 17 General finite state machine (FSM) design
Lecture 18 More Moore/Mealy machines.
1 Lecture 22 State encoding  One-hot encoding  Output encoding State partitioning.
1 CSE370, Lecture 19 Lecture 19 u Logistics n Lab 8 this week to be done in pairs íFind a partner before your lab period íOtherwise you will have to wait.
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.
State Machines The first problem set is now online! (Due on Jan. 31st, 2011)
1 CSE370, Lecture 18 Lecture 20 u Logistics n HW6 due Wednesday n Lab 7 this week (Tuesday exception) n Midterm 2 Friday (covers material up to simple.
DLD Lecture 26 Finite State Machine Design Procedure.
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
Lecture 4. Sequential Logic #2
1.3 Finite State Machines.
Introduction to CMOS VLSI Design Lecture 14: CAMs, ROMs, and PLAs
Lecture 28 Logistics Today
Lecture 26 Logistics Last lecture Today HW8 due Friday
Lecture 27 Logistics Last lecture Today: HW8 due Friday
Digital Design Lecture 9
Typical Timing Specifications
Lecture 23 Logistics Last lecture Today HW7 due Friday Lab8 going on
Evaluation in Engineering Design Process Modeling and FSM
Lecture 27 Logistics Last lecture Today: HW8 due Friday
Lecture 13: Sequential Circuits, FSM
Hakim Weatherspoon CS 3410 Computer Science Cornell University
Lecture 28 Logistics Today
Extra credit (worth 10pts equivalent in a midterm)
Lecture 21 Logistics Today
CSE 370 – Winter Sequential Logic-2 - 1
Instructor: Alexander Stoytchev
Lecture 25 Logistics Last lecture Today HW8 posted today, due 12/5
Lecture 15 Logistics Last lecture Today HW4 is due today
Lecture 24 Logistics Last lecture Today HW7 due today
Lecture 23 Logistics Last lecture Today HW7 due Friday Lab8 going on
Extra credit (worth 10pts equivalent in a midterm)
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
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
Instructor: Alexander Stoytchev
Lecture 24 Logistics Last lecture Today HW7 due today
Lecture 22 Logistics Last lecture Today
Lecture 20 Logistics Last lecture Today HW6 due Wednesday
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
EGR 2131 Unit 12 Synchronous Sequential Circuits
Lecture 20: CAMs, ROMs, PLAs
ECE 352 Digital System Fundamentals
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
Announcements Assignment 7 due now or tommorrow Assignment 8 posted
Finite State Machine Continued
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 19 A bigger FSM example: Hungry Robot Ant in Maze.
Introduction to CMOS VLSI Design Lecture 18: CAMs, ROMs, and PLAs
Presentation transcript:

Lecture 20 Logistics Last lecture Today Graded HW back today HW7 Due next Wednesday Lab 9 starts next week (2 week lab) Last lecture Intro to Moore and Mealy machines Today More Moore and Mealy machines A bigger FSM example: Hungry Robot Ant in Maze

The “WHY” slide Bigger FSM example Many things in the world are finite state machines (are we humans?) and most of them are far bigger and more complex than the examples we had so far. It is good to be able to understand and solve for a project-level FSM problem that’s a lot more realistic to FSMs that you may design in industry or in grad school.

Example: A vending machine 15 cents for a cup of coffee Doesn’t take pennies or quarters Doesn’t provide any change Previously we had mix of Moore and Mealy Reset N Vending Machine FSM Open Coin Sensor Release Mechanism D Clock

A vending machine: Moore machine 0¢ Reset symbolic state table present inputs next present state D N state output 0¢ 0 0 0¢ 0 0 1 5¢ 0 1 0 10¢ 0 1 1 – – 5¢ 0 0 5¢ 0 0 1 10¢ 0 1 0 15¢ 0 1 1 – – 10¢ 0 0 10¢ 0 0 1 15¢ 0 1 0 15¢ 0 1 1 – – 15¢ – – 15¢ 1 10¢ D 5¢ N 15¢ [open] D N N + D

A vending machine: Mealy machine 0¢ Reset symbolic state table present inputs next present state D N state output 0¢ 0 0 0¢ 0 0 1 5¢ 0 1 0 10¢ 0 1 1 – – 5¢ 0 0 5¢ 0 0 1 10¢ 0 1 0 15¢ 1 1 1 – – 10¢ 0 0 10¢ 0 0 1 15¢ 1 1 0 15¢ 1 1 1 – – 15¢ – – 15¢ 1 10¢ D/0 5¢ N/0 15¢ D/1 N/0 N + D/1

A vending machine: State encoding Mealy Moore present state inputs next state present Q1 Q0 D N D1 D0 output 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 – – – 0 1 0 0 0 1 0 0 1 1 0 0 1 0 1 1 0 1 1 – – – 1 0 0 0 1 0 0 0 1 1 1 0 1 0 1 1 0 1 1 – – – 1 1 – – 1 1 1 present state inputs next state present Q1 Q0 D N D1 D0 output 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 – – – 0 1 0 0 0 1 0 0 1 1 0 0 1 0 1 1 1 1 1 – – – 1 0 0 0 1 0 0 0 1 1 1 1 1 0 1 1 1 1 1 – – – 1 1 – – 1 1 1

A vending machine: Logic minimization 0 0 1 1 0 1 1 1 X X X X 1 1 1 1 Q1 D1 Q0 N D Moore 0 0 1 0 0 0 1 0 X X 1 X 0 0 1 0 Q1 Open Q0 N D 0 1 1 0 1 0 1 1 X X X X 0 1 1 1 Q1 D0 Q0 N D Mealy 0 0 1 1 0 1 1 1 X X X X 1 1 1 1 Q1 D1 Q0 N D 0 0 1 0 0 0 1 1 X X 1 X 0 1 1 1 Q1 Open Q0 N D 0 1 1 0 1 0 1 1 X X X X 0 1 1 1 Q1 D0 Q0 N D

A vending machine: Implementation Moore Mealy

Robotic ant in a maze Robot ant, physical maze Maze has no islands Corridors are wider than ant Design the robotic ant’s brain to get to the food! Food! start

Robot ant specifics Sensors: L and R antennae, 1 if touching wall Actuators: F - forward step, TL/TR - turn left/right Goal: find way out of maze to get to food. Strategy: keep the wall on the right

Example: ant brain (special case 1) Left (L) Antenna touching the wall

Example: ant brain (special case 2) Ant Lost

Example: ant brain (special case 2) Ant Lost (another example)

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 & 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 Keep the wall on the right

Design the ant-brain FSM State diagram 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 R L + R L’ R LOST (F) L’ R’ E/G (TL) L L’ R A/D (TL, F) L L’ R’ B/F (TR, F) L’ R’ R L C (TR, F) L’ R’ L’ R’ L

State Minimization, Encoding, and Circuit Next class

Extra credit (worth 10pts equivalent in a midterm) Design the robotic ant’s brain with virtual maze representation Due last day in class, Friday, March 13; printouts only Graded on clarity and completeness of explanation No questions will be answered, no late submission accepted Food! 127,127 0,127 start 0,0 127,0

The maze Virtual maze 128 × 128 grid YX is maze addresses Stored in memory 16384 8-bit words YX is maze addresses X is the ant’s horizontal position (7 bits) Y is the ant’s vertical position (7 bits) Each memory location says 00000001  No wall 00000010  North wall 00000100  West wall 00001000  South wall 00010000  East wall 00100000  Exit Can have multiple walls Example: 00001100  Walls on South and East

Design of different components Predesigned: Submit the designs for: Ant-Brain FSM Forward SRAM Turn right Maze Data Turn left Antennae logic X counter Forward East West Y counter SRAM Address Preload North South L R North Heading (shift register) South East West

Recommendations Memory controller Shift register for heading Move horizontally: Increment or decrement X Move vertically: Increment or decrement Y Shift register for heading N: 0001 W: 0010 S: 0100 E: 1000 Rotate right when ant turns right Rotate left when ant turns left Combinational logic for antennae logic