We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byDandre Whitlock
Modified about 1 year ago
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Finite state machine optimization State minimization fewer states require fewer state bits fewer bits require fewer logic equations Encodings: state, inputs, outputs 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
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 2 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
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 3 Input Next State Output SequencePresent StateX=0X=1X=0X=1 ResetS0S1S200 0S1S3S400 1S2S5S600 00S3S0S000 01S4S0S010 10S5S0S000 11S6S0S010 State minimization example Sequence detector for 010 or 110 S0 S3 S2S1 S5S6S4 1/00/0 1/0 0/1 0/01/00/0 1/0 0/0 1/0 0/1 1/0 0/0
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 4 ( S0 S1 S2 S3 S4 S5 S6 ) ( S0 S1 S2 S3 S5 ) ( S4 S6 ) ( S0 S3 S5 ) ( S1 S2 ) ( S4 S6 ) ( S0 ) ( S3 S5 ) ( S1 S2 ) ( S4 S6 ) Input Next State Output SequencePresent StateX=0X=1X=0X=1 ResetS0S1S200 0S1S3S400 1S2S5S600 00S3S0S000 01S4S0S010 10S5S0S000 11S6S0S010 S1 is equivalent to S2 S3 is equivalent to S5 S4 is equivalent to S6 Method of successive partitions
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 5 Input Next State Output SequencePresent StateX=0X=1X=0X=1 ResetS0S1'S1' S1'S3'S4'00 X0S3'S0S000 X1S4'S0S010 Minimized FSM State minimized sequence detector for 010 or 110 S0 S1’ S3’ S4’ X/0 1/0 0/1 0/0 X/0
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 6 symbolic state transition table present next state output state S0S0S1S2S31 S1S0S3S1S40 S2S1S3S2S41 S3S1S0S4S50 S4S0S1S2S51 S5S1S4S0S50 inputs here More complex state minimization Multiple input example S0  S2  S4  S1  S3  S5  01
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 7 S0-S1 S1-S3 S2-S2 S3-S4 S0-S0 S1-S1 S2-S2 S3-S5 S0-S1 S3-S0 S1-S4 S4-S5 S0-S1 S3-S4 S1-S0 S4-S5 S1-S0 S3-S1 S2-S2 S4-S5 S4-S0 S5-S5 S1-S1 S0-S4 minimized state table (S0==S4) (S3==S5) present next state output state S0'S0'S1S2S3'1 S1S0'S3'S1S3'0 S2S1S3'S2S0'1 S3'S1S0'S0'S3'0 Minimized FSM Implication chart method cross out incompatible states based on outputs then cross out more cells if indexed chart entries are already crossed out S1 S2 S3 S4 S5 S0S1S2S3S4
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 8 Minimizing incompletely specified FSMs Equivalence of states is transitive when machine is fully specified But its not transitive when don't cares are present e.g.,stateoutput S0– 0S1 is compatible with both S0 and S2 S11 –but S0 and S2 are incompatible S2– 1 No polynomial time algorithm exists for determining best grouping of states into equivalent sets that will yield the smallest number of final states
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 9 XQ1Q0Q1+Q –1000XQ1Q0Q1+Q –1000 Q 1 + = X (Q 1 xor Q 0 ) Q 0 + = X Q 1 ’ Q 0 ’ Minimizing states may not yield best circuit Example: edge detector - outputs 1 when last two input changes from 0 to 1 00  11  01  X’ X X X
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 10 Another implementation of edge detector "Ad hoc" solution - not minimal but cheap and fast 00  10  01  X’X X X X 11  X’
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 11 State assignment Choose bit vectors to assign to each “symbolic” state with n state bits for m states there are 2 n ! / (2 n – m)! [log n <= m <= 2 n ] 2 n codes possible for 1st state, 2 n –1 for 2nd, 2 n –2 for 3rd, … huge number even for small values of n and m intractable for state machines of any size heuristics are necessary for practical solutions optimize some metric for the combinational logic size (amount of logic and number of FFs) speed (depth of logic and fanout) dependencies (decomposition)
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 12 State assignment strategies Possible strategies sequential – just number states as they appear in the state table random – pick random codes one-hot – use as many state bits as there are states (bit=1 –> state) output – use outputs to help encode states heuristic – rules of thumb that seem to work in most cases No guarantee of optimality – another intractable problem
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 13 One-hot state assignment Simple easy to encode easy to debug Small logic functions each state function requires only predecessor state bits as input Good for programmable devices lots of flip-flops readily available simple functions with small support (signals its dependent upon) Impractical for large machines too many states require too many flip-flops decompose FSMs into smaller pieces that can be one-hot encoded Many slight variations to one-hot one-hot + all-0
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 14 IQQ+OiacjibckIQQ+Oiacjibck IQQ+OiabjkaclIQQ+Oiabjkacl IQQ+OiabjicdjIQQ+Oiabjicdj c = i * a + i * b b = i * a c = k * a j = i * a + i * c b = i * a d = i * c i / j i / k a b c a bc i / j k / l bd i / j a c Heuristics for state assignment Adjacent codes to states that share a common next state group 1's in next state map Adjacent codes to states that share a common ancestor state group 1's in next state map Adjacent codes to states that have a common output behavior group 1's in output map
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 15 General approach to heuristic state assignment All current methods are variants of this 1) determine which states “attract” each other (weighted pairs) 2) generate constraints on codes (which should be in same cube) 3) place codes on Boolean cube so as to maximize constraints satisfied (weighted sum) Different weights make sense depending on whether we are optimizing for two-level or multi-level forms Can't consider all possible embeddings of state clusters in Boolean cube heuristics for ordering embedding to prune search for best embedding expand cube (more state bits) to satisfy more constraints
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 16 Output-based encoding Reuse outputs as state bits - use outputs to help distinguish states why create new functions for state bits when output can serve as well fits in nicely with synchronous Mealy implementations HG = ST’ H1’ H0’ F1 F0’ + ST H1 H0’ F1’ F0 HY = ST H1’ H0’ F1 F0’ + ST’ H1’ H0 F1 F0’ FG = ST H1’ H0 F1 F0’ + ST’ H1 H0’ F1’ F0’ HY = ST H1 H0’ F1’ F0’ + ST’ H1 H0’ F1’ F0 Output patterns are unique to states, we do not need ANY state bits – implement 5 functions (one for each output) instead of 7 (outputs plus 2 state bits) InputsPresent StateNext StateOutputs CTLTSSTHF 0––HGHG00010 –0–HGHG –HGHY10010 ––0HYHY00110 ––1HYFG –FGFG ––FGFY –1–FGFY ––0FYFY ––1FYHG110 01
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 17 Current state assignment approaches For tight encodings using close to the minimum number of state bits best of 10 random seems to be adequate (averages as well as heuristics) heuristic approaches are not even close to optimality used in custom chip design One-hot encoding easy for small state machines generates small equations with easy to estimate complexity common in FPGAs and other programmable logic Output-based encoding ad hoc - no tools most common approach taken by human designers yields very small circuits for most FSMs
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 18 Sequential logic optimization summary State minimization straightforward in fully-specified machines computationally intractable, in general (with don’t cares) State assignment many heuristics best-of-10-random just as good or better for most machines output encoding can be attractive (especially for PAL implementations)
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design 8.3 Alternative State Machine.
Escola Politécnica da Universidade de São Paulo GSEIS - LME Logic Synthesis in IC Design and Associated Tools Sequential Synthesis Wang Jiang Chau Grupo.
(Synchronous) Finite State Machines Lab 2 is due tonight Great -Theory! Finally! Some ENGINEERING!
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
1 Computational Complexity Size Matters!. 2 Suppose there are several algorithms which can all be used to perform the same task. We need some way to judge.
Automata Theory November 2002 Introduction & NFAPart 1:
Reinforcement Learning Yijue Hou. What is learning? Learning takes place as a result of interaction between an agent and the world, the idea behind learning.
Techniques for Combinational Logic Optimization. Minimizing Circuits Karnaugh Maps.
P.Rajasekar & C.M.T.Karthigeyan Asst.Professor SRM University, Kattankulathur 1.
Chapter 5: Tree Constructions Breadth-First Search (BFS) –layer-based using Dijkstras algorithm –update-based using the Bellman-Ford algorithm Distributed.
Turing Machines Part 1:. 2 Church-Turing Thesis Part 1 An effective procedure is defined as: a procedure which can be broken down into simple.
Automata Theory CS 3313 Chapter 4 An Introduction to Finite Automata.
Quicksort Introduction to Algorithms Quicksort CSE 680 Prof. Roger Crawfis.
Section Goals Understand Tables Know how to create, edit, and use Tables Investigate ‘nesting’ Tables Be able to format Tables.
State Machines An approach to assembler coding. Intro State Machines are an integral part of software programming. State machines make code more efficient,
1 NFA ε - NFA - DFA equivalence. 2 What is an NFA An NFA is an automaton that its states might have none, one or more outgoing arrows under a specific.
5.1 Real Vector Spaces. Definition (1/2) Let V be an arbitrary nonempty set of objects on which two operations are defined, addition and multiplication.
PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 3: LINEAR MODELS FOR REGRESSION.
Chapters 7 & 8 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
FPA – IFPUG CPM 4.1 Rules. Function Point Analysis Function of the Data and the Operations on that data Data –4 types 2 Basic, 2 Attributive Operations.
Compiler Construction A Compulsory Module for Students in Computer Science Department Faculty of IT / Al – Al Bayt University Second Semester 2010/2011.
Nonlinear & Neural Networks LAB. PART State Reduction ( )
Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
Presented by: Tutorial Services The Math Center Base 10 to Different Number Bases When converting a number from base 10 to another base follow these.
Context-Free and Noncontext-Free Languages Chapter 13.
Black Box Checking Book: Chapter 9 Model Checking Finite state description of a system B. LTL formula. Translate into an automaton P. Check whether L(B)
1.4 Inverses; Rules of Matrix Arithmetic. Properties of Matrix Operations For real numbers a and b,we always have ab=ba, which is called the commutative.
Protein Secondary Structure Prediction Using BLAST and Relaxed Threshold Rule Induction from Coverings Leong Lee Missouri University of Science and Technology,
TP4: S TATE M ACHINE D ESIGN P ATTERN Definition Infrastructure Transition Code Conclusion.
Alexander Kononov Sobolev Institute of Mathematics Siberian Branch of Russian Academy of Science Novosibirsk, Russia.
© 2016 SlidePlayer.com Inc. All rights reserved.