Lecture 21 Logistics Last lecture Today HW7 due Wednesday

Slides:



Advertisements
Similar presentations
(Synchronous) Finite State Machines
Advertisements

Lecture 21 State minimization via implication charts.
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Finite state machine optimization State minimization  fewer.
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Give qualifications of instructors: DAP
1 Review: Counters and Registers CS 231 Review October 26, 2007 By Joshua Smith Please note the NOTES in the PPT file for help with the examples.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
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
Spring 2002EECS150 - Lec15-seq2 Page 1 EECS150 - Digital Design Lecture 15 - Sequential Circuits II (Finite State Machines revisited) March 14, 2002 John.
Lecture 20: CAMs, ROMs, PLAs. CMOS VLSI DesignCMOS VLSI Design 4th Ed. 20: CAMs, ROMs, and PLAs2 Outline  Content-Addressable Memories  Read-Only Memories.
ENGIN112 L25: State Reduction and Assignment October 31, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 25 State Reduction and Assignment.
Circuit, State Diagram, State Table
Lecture 18 More Moore/Mealy machines.
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)
CS1Q Computer Systems Lecture 7
DLD Lecture 26 Finite State Machine Design Procedure.

Introduction to CMOS VLSI Design Lecture 14: CAMs, ROMs, and PLAs
Finite state machine optimization
Finite state machine optimization
Introduction to CMOS VLSI Design Lecture 14: CAMs, ROMs, and PLAs
Lecture 26 Logistics Last lecture Today HW8 due Friday
Lecture 27 Logistics Last lecture Today: HW8 due Friday
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
Typical Timing Specifications
Lecture 23 Logistics Last lecture Today HW7 due Friday Lab8 going on
Instructor: Alexander Stoytchev
Lecture 27 Logistics Last lecture Today: HW8 due Friday
Extra credit (worth 10pts equivalent in a midterm)
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 25 Logistics Last lecture Today HW8 posted today, due 12/5
Lecture 24 Logistics Last lecture Today HW7 due today
Instructor: Alexander Stoytchev
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
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
Instructor: Alexander Stoytchev
FSMs, Multiplication, and Division
Guest Lecture by David Johnston
Lecture 25 Logistics Last lecture Today HW8 posted today, due 12/5
CSE 370 – Winter Sequential Logic-2 - 1
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 20 State minimization via row matching.
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 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
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
ECE 352 Digital System Fundamentals
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 21 Logistics Last lecture Today HW7 due Wednesday Lab 9 this week and next week Last lecture A bigger FSM example: Hungry Robot Ant in Maze --- Started Today Continue on the same example FSM simplification

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 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

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 from last class L’ R B/C/F [TR, F] L’ R’ LR A/D [TL, F] R E [TL] LOST (F) G [TL] L R’ L R’ +L’R +L’ R L’ R’ Diagram was incomplete Make certain that transitions from all states are defined on all possible inputs

1. State Diagram before Minimization 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’ LOST (F) L’ R’ R

2. State Transition Table Using symbolic states and outputs 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

1. Before Minimization L’ R’ L’ R A/D B/C/F [TL, F] L’ R [TR, F] L’ R’ G [TL] LR R E [TL] L R’ R L R’ L R’ LOST (F) L’ R’ R

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 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 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

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

6. Circuit Implementation 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 24

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

The “WHY” slide FSM minimization It is best to minimize FSM before expressing it as a logic circuit. As you saw in the ant robot example, minimization step is about looking for some patterns and merging states. There are systematic ways to do this (rather than the way we’d done it for the ant example) and we will learn them here.

FSM Minimization Two simple FSMs for odd parity checking

Collapsing States We can make the top machine match the bottom machine by collapsing states S0 and S2 onto one state If you’re a skeptical sort of person, you might ask, “why would anyone ever design the top state machine?”

FSM Design on the Cheap Let’s say we start with this FSM for even parity checking

FSM Design on the Cheap Now an enterprising engineer comes along and says, “Hey, we can turn our even parity checker into an odd parity checker by just adding one state.” An example this small is a little silly, but this kind of thing really happens on a larger scale

Two Methods for FSM Minimization Row matching Easier to do by hand Misses minimization opportunities Implication table Guaranteed to find the most reduced FSM More complicated algorithm (but still relatively easy to write a program to do it)

A simple problem Design a Mealy machine with a single bit input and a single bit output. The machine should output a 0, except once every four cycles, if the previous four inputs matched one of two patterns (0110, 1010) Example input/output trace: in: 0010 0110 1100 1010 0011 … out: 0000 0001 0000 0001 0000 … The spaces in the traces are just for readability

… and a simple solution

Find matching rows Next State Output Input Sequence Present State X=0 Reset S0 S1 S2 S3 S4 1 S5 S6 00 S7 S8 01 S9 S10 10 S11 S12 11 S13 S14 000 001 010 011 100 101 110 111

Merge the matching rows Next State Output Input Sequence Present State X=0 X=1 Reset S0 S1 S2 S3 S4 1 S5 S6 00 S7 S8 01 S9 S10’ 10 S11 11 S13 S14 000 001 010 011 or 101 100 110 111

Merge until no more rows match Next State Output Input Sequence Present State X=0 X=1 Reset S0 S1 S2 S3 S4 1 S5 S6 00 S7’ 01 S10’ 10 11 Not (011 or 101) 011 or 101

The final state transition table Next State Output Input Sequence Present State X=0 X=1 Reset S0 S1 S2 S3’ S4’ 1 00 or 11 S7’ 01 or 10 S10’ Not (011 or 101) 011 or 101

A more efficient solution