Synthesis For Finite State Machines. FSM (Finite State Machine) Optimization State tables State minimization State assignment Combinational logic optimization.

Slides:



Advertisements
Similar presentations
Date of Birth Design Problem
Advertisements

CSE 370 Sample Final Exam Questions. 1) Logic Minimization CD AB F = Σm(0,6,7,8,9,11,15) + d(1,13)
Nonlinear & Neural Networks LAB. PART State Reduction ( )
Convolutional Codes Mohammad Hanaysheh Mahdi Barhoush.
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.
Principles & Applications
Magnetic Data Storage A computer hard drive stores your data magnetically Disk NS direction of disk motion Write Head __ Bits of information.
Magnets used to store data ? Magnet with unknown state Current N S S N 0 1.
A Simple ALU Binary Logic.
Question (from exercises 2) Are the following sources likely to be stationary and ergodic? (i)Binary source, typical sequence aaaabaabbabbbababbbabbbbbabbbbaabbbbbba......
Lexical Analysis Dragon Book: chapter 3.
Recursion and Induction
Regular Expression Manipulation FSM Model
ENGIN112 L23: Finite State Machine Design Procedure October 27, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 23 Finite State Machine.
Example: Binary Adder We want to construct a finite state machine that will add two numbers. The input is two binary numbers, (xn…x1x0)2 and (yn…y1y0)2.
Discrete Math by R.S. Chang, Dept. CSIE, NDHU1 Languages: Finite State Machines Chapter 6 problemsstrings (languages) machines answers.
Chapter #8: Finite State Machine Design Contemporary Logic Design
Truth Tables & Logic Expressions
Chapter 9 -- Simplification of Sequential Circuits.
Boolean Algebra and Logic Gates
A New Recombination Lower Bound and The Minimum Perfect Phylogenetic Forest Problem Yufeng Wu and Dan Gusfield UC Davis COCOON07 July 16, 2007.
Chapter #8: Finite State Machine Design 8
Chapter 4 Variable–Length and Huffman Codes. Unique Decodability We must always be able to determine where one code word ends and the next one begins.
Error-Correcting codes
Topics Adders Half Adder Full Adder Subtracter Half Subtracter
Digital Logic & Design Lecture No. 3. Number System Conversion Conversion between binary and octal can be carried out by inspection.  Each octal digit.
Finite-state Recognizers
Minimization of Circuits
ELECTRONICS TECHNOLOGY Digital Devices I Karnaugh Maps
Finite State Machines Finite state machines with output
Introduction to Sequential Circuits
Optimization of Sequential Networks Step in Synthesis: Problem Flow Table Reduce States Minimum-State Table State Assignment Circuit Transition Table Flip-Flop.
Node Optimization. Simplification Represent each node in two level form Use espresso to minimize each node Several simplification procedures which vary.
Min terms and logic expression
FUNCTION OPTIMIZATION Switching Function Representations can be Classified in Terms of Levels Number of Levels, k, is Number of Unique Boolean (binary)
Some Slides from: U.C. Berkeley, U.C. Berkeley, Alan Mishchenko, Alan Mishchenko, Mike Miller, Mike Miller, Gaetano Borriello Gaetano Borriello Introduction.
1 Steps towards State assignment Slides of Mark Schulz used.
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.
No. 9-1 Chapter #9: Finite State Machine Optimization.
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.
EDA (CS286.5b) Day 17 Sequential Logic Synthesis (FSM Optimization)
Sequential System Synthesis -- State Encoding. ENEE 6442 The State Encoding Problem > Goal: Given n states, assign a unique code (of length of at least.
Computation Engines: BDDs and SAT (part 2) 290N: The Unknown Component Problem Lecture 8.
Spring 2002EECS150 - Lec15-seq2 Page 1 EECS150 - Digital Design Lecture 15 - Sequential Circuits II (Finite State Machines revisited) March 14, 2002 John.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 12: March 2, 2009 Sequential Optimization (FSM Encoding)
COE 561 Digital System Design & Synthesis Sequential Logic Synthesis Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum.
Engineering Models and Circuit Realization of Quantum State Machines.
ENGIN112 L25: State Reduction and Assignment October 31, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 25 State Reduction and Assignment.
CSCI 3301 Transparency No. 9-1 Chapter #9: Finite State Machine Optimization Contemporary Logic Design.
IKI c-Synthesis of Sequential Logic Bobby Nazief Semester-I The materials on these slides are adopted from: Prof. Daniel Gajski’s transparency.
FSM State Assignment for Area, Power and Testability using Modern Optimization Techniques Mohammed Mansoor Ali Computer Engineering Department.
9-1 Introduction Chapter #9: Finite State Machine Optimization.
1 State Assignment The problem: Assign a unique code to each state to produce a minimal binary logic level implementation. Given: 1.|S| states, 2.at least.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 6: January 26, 2004 Sequential Optimization (FSM Encoding)
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 17: March 11, 2002 Sequential Optimization (FSM Encoding)
CS137: Electronic Design Automation
Finite state machine optimization
Sequential Networks and Finite State Machines
Finite state machine optimization
Adapted by Dr. Adel Ammar
State Reduction and State Assignment
COE 561 Digital System Design & Synthesis Sequential Logic Synthesis
Synthesis of sequential circuits
Implement FSM with fewest possible states • Least number of flip flops
DESIGN OF SEQUENTIAL CIRCUITS
Synthesis and Verification of Finite State Machines
CSE 370 – Winter Sequential Logic-2 - 1
CSE 370 – Winter Sequential Logic-2 - 1
Presentation transcript:

Synthesis For Finite State Machines

FSM (Finite State Machine) Optimization State tables State minimization State assignment Combinational logic optimization net-list identify and remove equivalent states assign unique binary code to each state use unassigned state-codes as don’t care

FSM Optimization S2S2 S1S1 S3S Combinational Logic PIPO PS NS u1u1 u2u2 v1v1 v2v2 S4S4

State Minimization Goal : identify and remove redundant states (states which can not be observed from the FSM I/O behavior) Why : 1. Reduce number of latches –assign minimum-length encoding –only as the logarithm of the number of states 2. Increase the number of unassigned states codes –heuristic to improve state-assignment and logic-optimization

State Minimization Definition Completely-specified state machine –two states are equivalent if outputs are identical for all input combinations Next states are equivalent for all input combinations –equivalence of states is an equivalence relation which partitions the states into disjoint equivalence classes Incompletely specified state machines

Classical State Minimization 1. Partition states based on input output values asserted in the state 2. Define the partitions so that all states in a partition transition into the same next-state partition (under corresponding inputs)

Example Ex : 0 A B 0 1 A C 0 0 B D 0 (A,B,C,D,E,F,H)(G) 1 B E 0 0 C F 0 (A,B,C,E,F,H)(G)(D) 1 C A 0 0 D H 0 (A,C,E,H)(G)(D)(B,F) 1 D G 0 0 E B 0 (A,C,E)(G)(D)(B,F)(H) 1 E C 0 0 F D 0 1 F E 0 0 G F 1 1 G A 0 0 H H 0 1 H A 0

State Assignment Assign unique code to each state to produce logic-level description –utilize unassigned codes effectively as don’t cares Choice for S state machine –minimum-bit encoding log S –maximum-bit encoding one-hot encoding using one bit per state something in between Modern techniques –hypercube embedding of face constraint derived for collections of states (Kiss,Nova) –adjacency embedding guided by weights derived between state pairs (Mustang)

Hypercube Embedding Technique Observation : one -hot encoding is the easiest to decode Am I in state 2,5,12 or 17? binary : x 4 ’x 3 ’x 2 ’x 1 x 0 ’(00010) + x 4 ’x 3 ’x 2 x 1 ’x 0 (00101) + x 4 ’x 3 x 2 x 1 ’x 0 ’(01100) + x 4 x 3 ’x 2 ’x1’x0 (10001) one hot : x 2 +x 5 +x 12 +x 17 But one hot uses too many flip flops. Exploit this observation 1. two-level minimization after one hot encoding identifies useful state group for decoding 2. assigning the states in each group to a single face of the hypercube allows a single product term to decode the group to states.

State Group Identification Ex: state machine input current-state next state output 0 start S S2 S S3 S S4 S S5 start 10 0 S6 start 01 0 S7 S start S S2 S S3 S S4 S S5 S S6 S S7 S6 00 Symbolic Implicant : represent a transition from one or more state to a next state under some input condition.

Representation of Symbolic Implicant Symbolic cover representation is related to a multiple-valued logic. Positional cube notation : a p multiple-valued logic is represented as P bits (V 1,V 2,...,V p ) Ex: V = 4 for 5-value logic (00010) represent a set of values by one string V = 2 or V = 4 (01010)

Minimization of Multi-valued Logic Find a minimum multiple-valued-input cover - espresso Ex: A minimal multiple-valued-input cover

State Group Consider the first symbolic implicant This implicant shows that input “0” maps “state-2” or “state-3” or “state-7” into “state-5” and assert output “00” This example shows the effect of symbolic logic minimization is to group together the states that are mapped by some input into the same next-state and assert the same output. We call it “state group” if we give encodings to the states in the state group in adjacent binary logic and no other states in the group face, then the states group can be implemented as a cube.

Group Face group face : the minimal dimension subspace containing the encoding assigned to that group. Ex: **0 group face

Hyper-cube Embedding c a b state groups : {2,5,12,17} {2,6,17} wrong!

Hyper-cube Embedding c a b state groups : {2, 6, 17} {2, 4, 5} wrong! 617 6

How to Check if a State Assignment Satisfies the Constraint Matrix? Step1: Step2: Find the group face of the encoding For all states, check if a state that does not belong to a state group intersects that group face

Example Constraint matrix A, state encoding S and group-face matrix F A = S = Step1: Group face F = A˙S = 1 ** 0 * * 00 0 Step2: Check encoding of state-6 = [011] Since it does not belong to group 1, 2 and 3, Encoding of state-6 satisfies the constraint check [0 1 1] ∩ [1 * *] = [0 1 1] ∩ [0 * 0] = [0 1 1] ∩ [* 0 0] =

Other State Encoding If encoding of state-6 = [111], check Do not satisfy the constraint. [1 1 1] ∩ [1 * *] = 111 [1 1 1] ∩ [0 * 0] = [1 1 1] ∩ [* 0 0] =

Algorithm for State Assignment Step 1: Step 2: Step 3: Step 4: Step 5: Select an uncoded state (or a state subset). Determine the encodings for that state (states) satisfying the constraint relation. If no encoding exists, increase the state code dimension and go to Step 2. Assign an encoding to the selected state (states). If all states have been encoded, stop. Else go to Step 1.

Step 3 –Can always increase the coding length by one bit –New state assignment: 1.For states already assigned, append 0 at the end 2.For the new state, ns, case1: case2: ns does not belong to any state group, encoding of ns = [c | 1]  c is any vector ns belongs to some state group, encoding of ns = [c | 1]  c is the encoding of any state that belongs to the state group

Example Ex: A = S = To encode a new state (state-5), we have a new constraint matrix, A’ = S’ = ns = [1 0 1] or [1 1 1] For the states already assigned, we have a new encoding, For the new state (state-5), we have encodings

Hyper-cube Embedding Method Advantage : –use two-level logic minimizer to identify good state group –almost all of the advantage of one-hot encoding, but fewer state-bit

Adjacency-Based State Assignment Basic algorithm: (1) Assign weight w(s,t) to each pair of states –weight reflects desire of placing states adjacent on the hypercube (2) Define cost function for assignment of codes to the states –penalize weights for the distance between the state codes eg. w(s,t) * distance(enc(s),enc(t)) (3) Find assignment of codes which minimize this cost function summed over all pairs of states. –heuristic to find an initial solution –pair-wise interchange (simulated annealing) to improve solution

Adjacency-Based State Assignment Mustang : weight assignment technique based on loosely maximizing common cube factors

How to Assign Weight to State Pair Assign weights to state pairs based on ability to extract a common-cube factor if these two states are adjacent on the hyper- cube.

Fan-Out-Oriented (examine present-state pairs) Present state pair transition to the same next state S1S1 S3S3 S2S2 $$$ S 1 S 2 $$$$ $$$ S 3 S 2 $$$$ Add n to w(S 1,S 3 ) because of S 2

Fan-Out-Oriented present states pair asserts the same output S2S2 S3S3 S1S1 S4S4 $/j Add 1 to w(S 1, S3) because of output j $$$ S 1 S 2 $$$1$ $$$ S 3 S 4 $$$1$

Fanin-Oriented (exam next state pair) The same present state causes transition to next state pair. $$$ S 1 S 2 $$$$ $$$ S 1 S 4 $$$$ Add n/2 to w(S 2,S 4 ) because of S 1 S1S1 S2S2 S4S4

Fanin-Oriented (exam next state pair) The same input causes transition to next state pair. $0$ S 1 S 2 $$$$ $0$ S 3 S 4 $$$$ Add 1 to w(S 2,S 4 ) because of input i ii S1S1 S3S3 S2S2 S4S4

Which Method Is Better? Which is better? FSMs have no useful two-level face constraints => adjacency-embedding FSMs have many two-level face constraints => face-embedding