CSE 370 – Winter Sequential Logic-2 - 1

Slides:



Advertisements
Similar presentations
ENGIN112 L23: Finite State Machine Design Procedure October 27, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 23 Finite State Machine.
Advertisements

Chapter #8: Finite State Machine Design 8
Introduction to Sequential Circuits
Sequential Logic Optimization
Some Slides from: U.C. Berkeley, U.C. Berkeley, Alan Mishchenko, Alan Mishchenko, Mike Miller, Mike Miller, Gaetano Borriello Gaetano Borriello Introduction.
General Sequential Design
State-machine structure (Mealy)
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.
Circuits require memory to store intermediate data
CS 151 Digital Systems Design Lecture 25 State Reduction and Assignment.
ECE C03 Lecture 111 Lecture 11 Finite State Machine Optimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
ECE C03 Lecture 101 Lecture 10 Finite State Machine Design Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
ECE C03 Lecture 131 Lecture 13 Finite State Machine Optimization Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Give qualifications of instructors: DAP
Sequential Circuit Design
Spring 2002EECS150 - Lec15-seq2 Page 1 EECS150 - Digital Design Lecture 15 - Sequential Circuits II (Finite State Machines revisited) March 14, 2002 John.
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.
Lecture 17 General finite state machine (FSM) design
Lecture 18 More Moore/Mealy machines.
Chapter 8 -- Analysis and Synthesis of Synchronous Sequential Circuits.
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.
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.
Analysis and Synthesis of Synchronous Sequential Circuits A “synchronizing” pulse/edge signal (clock) controls the operation of the memory portion of the.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Week #7 Sequential Circuits (Part B)
Finite state machine optimization
Sequential Networks and Finite State Machines
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
Figure 8.1. The general form of a sequential circuit.
Finite state machine optimization
Chapter #6: Sequential Logic Design
© Copyright 2004, Gaetano Borriello and Randy H. Katz
Lecture 28 Logistics Today
Computer Organization
Lecture 27 Logistics Last lecture Today: HW8 due Friday
COMP541 Sequential Logic – 2: Finite State Machines
FIGURE 5.1 Block diagram of sequential circuit
FINITE STATE MACHINES (FSMs)
Sequential Networks and Finite State Machines
Lecture 27 Logistics Last lecture Today: HW8 due Friday
David Culler Electrical Engineering and Computer Sciences
Lecture 28 Logistics Today
EEL 3705 / 3705L Digital Logic Design
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 25 Logistics Last lecture Today HW8 posted today, due 12/5
CSE 370 – Winter Sequential Logic - 1
CS M51A/EE M16 Winter’05 Section 1 Logic Design of Digital Systems Lecture 12 February 28 W’05 Yutao He 4532B Boelter Hall
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
DESIGN OF SEQUENTIAL CIRCUITS
Lecture 25 Logistics Last lecture Today HW8 posted today, due 12/5
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 22 Logistics Last lecture Today
Lecture 20 Logistics Last lecture Today Graded HW back today
Lecture 20 Logistics Last lecture Today HW6 due Wednesday
Lecture 23 Logistics Last lecture Today HW8 due Wednesday, March 11
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
CS M51A/EE M16 Winter’05 Section 1 Logic Design of Digital Systems Lecture 11 February 23 W’05 Yutao He 4532B Boelter Hall
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
Chapter 9 -- Simplification of Sequential Circuits
Presentation transcript:

CSE 370 – Winter 2002 - Sequential Logic-2 - 1 Overview Last lecture Example: Ant in a maze More on Moore vs. Mealy Today Optimization of FSMs State assignment 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 1

Vending machine implementation D1 = Q1 + D + Q0 N D0 = Q0’ N + Q0 N’ + Q1 N + Q1 D OPEN = Q1 Q0 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 2

Map design to a (registered) PLD reset COM out CLK D Q Q' Q0 Q1 REG out N OPEN 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 3

CSE 370 – Winter 2002 - Sequential Logic-2 - 4 Retime design OPEN is delayed by AND gate after Q1 and Q0 Can remove this delay by retiming Move output logic (AND gate) to eliminate delay OPEN = Q1Q0 = (Q1+D+Q0N)(Q0'N+Q0N'+Q1N+Q1D) Original Design Retimed Design 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 4

Retimed PLD implementation CLK D Q Q' Q0 Q1 REG out N D reset OPEN 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 5

Synchronous (or registered) Mealy machine Moore machine with no output decoding (like the retimed Moore vending machine) Registered state and registered outputs No glitches on outputs No race conditions between communicating machines reg inputs combinational logic for outputs and next state outputs reg state feedback 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 6

Finite state machine optimization State minimization fewer states require fewer state bits fewer bits require fewer logic equations Encodings: state, inputs, outputs (affects speed and size of FSM) State code is a vector: log(n) to n bits (n  # of states) trade flip-flop count for logic complexity state encoding with fewer bits has fewer equations to implement however, each may be more complex state encoding with more bits (e.g., one-hot) has simpler equations complexity directly related to complexity of state diagram input/output encoding may or may not be under designer control 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 7

Algorithmic approach to state minimization Goal – identify and combine states that have equivalent behavior Equivalent states: same output for all input combinations, states transition to same or equivalent states Algorithm sketch 1. place all states in one set 2. initially partition set based on output behavior 3. successively partition resulting subsets based on next state transitions 4. repeat (3) until no further partitioning is required states left in the same set are equivalent polynomial time procedure 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 8

State minimization example Sequence detector for 010 or 110 (e.g. input 010001110 yields output 001000001) Input Next State Output Sequence Present State X=0 X=1 X=0 X=1 Reset S0 S1 S2 0 0 0 S1 S3 S4 0 0 1 S2 S5 S6 0 0 00 S3 S0 S0 0 0 01 S4 S0 S0 1 0 10 S5 S0 S0 0 0 11 S6 S0 S0 1 0 Notice the short-hand notation for the transition table S0 S3 S2 S1 S5 S6 S4 1/0 0/0 0/1 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 9

Method of successive partitions Input Next State Output Sequence Present State X=0 X=1 X=0 X=1 Reset S0 S1 S2 0 0 0 S1 S3 S4 0 0 1 S2 S5 S6 0 0 00 S3 S0 S0 0 0 01 S4 S0 S0 1 0 10 S5 S0 S0 0 0 11 S6 S0 S0 1 0 ( S0 S1 S2 S3 S4 S5 S6 ) ( S0 S1 S2 S3 S5 ) ( S4 S6 ) ( S0 S1 S1 ) ( S3 S5 ) ( S4 S6 ) ( S0 ) ( S3 S5 ) ( S1 S2 ) ( S4 S6 ) S4 is equivalent to S6 S3 is equivalent to S5 S1 is equivalent to S2 Polynomial time algorithm 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 10

CSE 370 – Winter 2002 - Sequential Logic-2 - 11 Minimized FSM State minimized sequence detector for 010 or 110 Input Next State Output Sequence Present State X=0 X=1 X=0 X=1 Reset S0 S1' S1' 0 0 0 + 1 S1' S3' S4' 0 0 X0 S3' S0 S0 0 0 X1 S4' S0 S0 1 0 S0 S1’ S3’ S4’ X/0 1/0 0/1 0/0 This method does not always yield the minimum number of states: easy to find counter examples 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 11

Example: Complex state diagram symbolic state-transition table 10 01 11 00 S0 [1] S2 [1] S4 [1] S1 [0] S3 S5 inputs present next state output state 00 01 10 11 S0 S0 S1 S2 S3 1 S1 S0 S3 S1 S4 0 S2 S1 S3 S2 S4 1 S3 S1 S0 S4 S5 0 S4 S0 S1 S2 S5 1 S5 S1 S4 S0 S5 0 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 12

CSE 370 – Winter 2002 - Sequential Logic-2 - 13 Minimized FSM Implication chart method (enumerates all possible combinations of states taken 2 at a time) (1) cross out incompatible states based on outputs (2) cross out more cells if indexed chart entries are already crossed out S1 S2 S3 S4 S5 S0 minimized state table (S0==S4) (S3==S5) present next state output state 00 01 10 11 S0' S0' S1 S2 S3' 1 S1 S0' S3' S1 S3' 0 S2 S1 S3' S2 S0' 1 S3' S1 S0' S0' S3' 0 S0-S1 S1-S3 S2-S2 S3-S4 S0-S1 S3-S0 S1-S4 S4-S5 S0-S0 S1-S1 S2-S2 S3-S5 S1-S0 S3-S1 S2-S2 S4-S5 Polynomial time algorithm S0-S1 S3-S4 S1-S0 S4-S5 S4-S0 S5-S5 S1-S1 S0-S4 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 13

Minimizing incompletely specified FSMs State equivalence is transitive for fully specified machines But is not transitive if some states are “don't cares” e.g., state output S0 – 0 S1 is compatible with both S0 and S2 S1 1 – but S0 and S2 are incompatible S2 – 1 No polynomial time algorithm for determining the state grouping that gives the smallest number of final states 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 14

Minimizing states may not yield best circuit Example: edge detector - outputs 1 when last two input changes from 0 to 1 X Q1 Q0 Q1+ Q0+ 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 – 1 1 0 0 00 [0] 10 [0] 01 [1] X’ X Q1+ = X (Q1 xor Q0) Q0+ = X Q1 Q0 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 15

Another implementation of edge detector "Ad hoc" solution - not minimal but cheap and fast 00 [0] 10 [0] 01 [1] X’ X 11 [0] 8/2/2019 CSE 370 – Winter 2002 - Sequential Logic-2 - 16