Synthesis and Verification of Finite State Machines

Slides:



Advertisements
Similar presentations
Chapter 9 -- Simplification of Sequential Circuits.
Advertisements

Optimization of Sequential Networks Step in Synthesis: Problem Flow Table Reduce States Minimum-State Table State Assignment Circuit Transition Table Flip-Flop.
FUNCTION OPTIMIZATION Switching Function Representations can be Classified in Terms of Levels Number of Levels, k, is Number of Unique Boolean (binary)
Greedy Algorithms.
EDA (CS286.5b) Day 15 Logic Synthesis: Two-Level.
EDA (CS286.5b) Day 17 Sequential Logic Synthesis (FSM Optimization)
Finite State Machine Minimization Advanced Methods based on triangular table and binate covering.
Chapter 3 Simplification of Switching Functions
Sequential System Synthesis -- State Encoding. ENEE 6442 The State Encoding Problem > Goal: Given n states, assign a unique code (of length of at least.
Sequential System Synthesis -- Incompletely Specified Machines.
FUNDAMENTAL PROBLEMS AND ALGORITHMS  Giovanni De Micheli Stanford University Branch and Bound.
Exact State Minimization of Non-Deterministic FSMs 290N: The Unknown Component Problem Lecture 17.

ECE Synthesis & Verification 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Exact Two-level Minimization Quine-McCluskey Procedure.
ECE 667 Synthesis and Verification of Digital Systems
Cardinality & Sorting Networks. Cardinality constraint Appears in many practical problems: scheduling, timetabling etc’. Also takes place in the Max-Sat.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Two-Level Minimization I.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Two-Level Minimization II.
Zvi Kohavi and Niraj K. Jha 1 Capabilities, Minimization, and Transformation of Sequential Machines.
Combinatorial Algorithms Unate Covering Binate Covering Graph Coloring Maximum Clique.
Two-Level Simplification Approaches Algebraic Simplification: - algorithm/systematic procedure is not always possible - No method for knowing when the.
Introduction to State Machine
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Mathematical Preliminaries
Why consider ND-MV networks? Multi-Values: Multi-valued domains can be used to explore larger optimization spaces. Several interesting direct applications.
Chapter 8. Sequential machine. Sequential machine M = ( I, O, S, , ) I : set of input O : set of output S : set of states  (state transition) : I 
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
Boolean Functions 1 ECE 667 ECE 667 Synthesis and Verification of Digital Circuits Boolean Functions Basics Maciej Ciesielski Univ.
ECE 301 – Digital Electronics Minimizing Boolean Expressions using K-maps, The Minimal Cover, and Incompletely Specified Boolean Functions (Lecture #6)
CS137: Electronic Design Automation
Capabilities, Minimization, and Transformation of Sequential Machines
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Finite state machine optimization
Finite state machine optimization
Lecture #6 EGR 277 – Digital Logic
As the last CC-list represents Maximum Compatible Classes we conclude:
CS 352 Introduction to Logic Design
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Example of application: Decomposition
A Boolean Paradigm in Multi-Valued Logic Synthesis
Synthesis of Two Level Circuits
COE 561 Digital System Design & Synthesis Sequential Logic Synthesis
Lecture 14 Reduction of State Tables
Optimized Implementation of Logic Function
Synthesis of sequential circuits
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
ECE 331 – Digital System Design
Synthesis and Verification of Finite State Machines
Multi-Level Minimization
Optimization Algorithm
Automatic Test Generation for Combinational Circuits
SYEN 3330 Digital Systems Chapter 2 – Part 5 SYEN 3330 Digital Systems.
COE 202: Digital Logic Design Combinational Logic Part 3
ECB2212-Digital Electronics
Heuristic Minimization of Two Level Circuits
Overview Part 2 – Circuit Optimization
Heuristic Minimization of Two Level Circuits
ECE 352 Digital System Fundamentals
Laws & Rules of Boolean Algebra
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Chapter5: Synchronous Sequential Logic – Part 3
ECE 331 – Digital System Design
INTRODUCTION A graph G=(V,E) consists of a finite non empty set of vertices V , and a finite set of edges E which connect pairs of vertices .
Chapter 9 -- Simplification of Sequential Circuits
Presentation transcript:

Synthesis and Verification of Finite State Machines Sungho Kang Yonsei University

Outline Minimization of Incompletely Specified Machines Binate Covering Problem State Encoding Decomposition and Encoding

Synthesis of Practical FSMs Minimization We have learned basic methods for minimizing, encoding, checking equivalence, and synthesizing circuits for realizing completely specified FSMs Now we must learn to deal with the more practical case of incomplete specification Our goal is thus to find a least cost circuit that satisfies a partial specification

Flow Table Compatibility Table Incomplete specification and Compatibility MInimization Use don’t-cares to merge states. Merged states must have same output sequences. Flow Table Compatibility Table Note each constraint represents pair (incompatibility)

Strategy Derive all prime sets of compatible states MInimization Derive all prime sets of compatible states Solve a covering problem to obtain minimum states.

Note each constraint represents pair (incompatibility) Compatibility Constraints MInimization Compatibility relation: conjunction of constraints (one for each “X”) Note each constraint represents pair (incompatibility)

Computing the Maximal Compatibles MInimization By recursive multiplication method, like computing the Complete Sum: The (complete) constraint sums are multiplied out, dropping absorbed terms when they arise.

Maximal compatibles are “Prime”. Computing the Maximal Compatibles MInimization Maximal compatibles are “Prime”. ( No superset of these state sets are also pairwise compatible).

Prime Compatibles MInimization Unfortunately, some subsets of the maximal compatibles pairs are also prime compatibles. Because, selection of one compatible pair may imply selection of other compatible pairs.

Defining Prime Compatibles MInimization A compatible is prime if and only if there is no other compatible which contains it or whose class set contains class set of . That is, is prime if and only if Subsets with smaller class sets are acceptable. (Bigger compatible, smaller class set)

Class Sets and Prime Compatibles MInimization In minimization, we desire a minimum number of compatible sets that cover all original states. Pick from primes. Choice of conditionally compatible set implies choosing all implied pairs. Set of implied compatibles pairs is called the class set, is the class set of

We just derived maximal compatibles that are prime Update and Strategy MInimization We just derived maximal compatibles that are prime Derive remaining prime compatibles Solve a covering problem

Class Sets x1 x2 x3 x4 x5 x6 x7 a a,0 -- d,0 e,1 b,0 a,-- -- MInimization x1 x2 x3 x4 x5 x6 x7 a a,0 -- d,0 e,1 b,0 a,-- -- b b,0 d,1 a,-- -- a,-- a,1 -- c b,0 d,1 a,1 -- -- -- g,0 d -- e,-- -- b,-- b,0 -- a,-- e b,-- e,-- a,-- -- b,-- e,-- a,1 f b,0 c,-- --,1 h,1 f,1 g,0 -- g -- c,1 -- e,1 -- g,0 f,0 h a,1 e,0 d,1 b,0 b,-- e,-- a,1 b a,d c X ~ d b,e a,b d,e d,e a,g e a,b a,d d,e a,b a,e X ~ f X X c,d X X g ~ X c,d f,g X X e,h h X X X ~ a,b a,d X X a b c d e f g

Note is prime: although Class Sets and Primes MInimization Note is prime: although b a,d c X ~ d b,e a,b d,e d,e a,g e a,b a,d d,e a,b a,e X ~ f X X c,d X X g ~ X c,d f,g X X e,h h X X X ~ a,b a,d X X a b c d e f g

Class Sets and Primes Note is not prime: b a,d c X ~ MInimization Note is not prime: b a,d c X ~ d b,e a,b d,e d,e a,g e a,b a,d d,e a,b a,e X ~ f X X c,d X X g ~ X c,d f,g X X e,h h X X X ~ a,b a,d X X a b c d e f g

Note is prime: Class Sets b a,d c X ~ d b,e a,b d,e d,e a,g MInimization Note is prime: b a,d c X ~ d b,e a,b d,e d,e a,g e a,b a,d d,e a,b a,e X ~ f X X c,d X X g ~ X c,d f,g X X e,h h X X X ~ a,b a,d X X a b c d e f g

through are added to the list of prime compatibles Maximal compatibles are prime MInimization maximal class compatibles set 1 {a,b,d,e} {} 2 {b,c,d} {{a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} other PCs 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}} 8 {c,g} {{c,d}, {f,g}} 9 {f,g} {{e,h}} 10 {d,h} {} 12 {f} {} Note sub-compatibles through are added to the list of prime compatibles before maximal compatible

which has an empty class set Maximal compatibles are prime MInimization maximal class compatible set 1 {a,b,d,e} {} 2 {b,c,d} {a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} other PCs 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}} 8 {c,g} {{c,d}, {f,g}} 9 {f,g} {{e,h}} 10 {d,h} {} 12 {f} {} Note that subsets and are not prime because they are contained in , which has an empty class set

prime because it is contained in , whose class set is the same. Maximal compatibles are prime MInimization maximal class compatible set 1 {a,b,d,e} {} 2 {b,c,d} {a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} other PCs 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}} 8 {c,g} {{c,d}, {f,g}} 9 {f,g} {{e,h}} 10 {d,h} {} 12 {f} {} Note that subset , with class set , is not prime because it is contained in , whose class set is the same.

are all contained in primes with empty class sets, so they Maximal compatibles are prime MInimization maximal class compatible set 1 {a,b,d,e} {} 2 {b,c,d} {a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} other PCs 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}} 8 {c,g} {{c,d}, {f,g}} 9 {f,g} {{e,h}} 10 {d,h} {} 12 {f} {} After treating subsets of size 2, we still have to check all subsets of size 1, which have empty class sets. Note are all contained in primes with empty class sets, so they are not prime. But is not, so it is prime.

Goal: To Find Prime Compatibles MInimization maximal class compatible set 1 {a,b,d,e} {} 2 {b,c,d} {a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} other PCs 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}} 8 {c,g} {{c,d}, {f,g}} 9 {f,g} {{e,h}} 10 {d,h} {} 12 {f} {} Maximal Compatibles are prime. Other prime compatibles are subsets of primes such that: is prime iff its class set does not contain the class set of a larger prime .

Finding Prime Compatibles MInimization Enqueue known primes of size k Test subcompatibles for primality

For , only is enqueued For , are enqueued Finding Prime Compatibles MInimization For each value of k, the for-loop of Line 1 puts the maximal compatibles of size k onto the queue of primes, P. For , only is enqueued For , are enqueued

is a prime compatible if and only if Finding Prime Compatibles MInimization For each enqueued prime (of size ), we check every subset of size . is a prime compatible if and only if

Building the Reduced Machine MInimization x1 x2 x3 x4 x5 x6 x7 a a,0 -- d,0 e,1 b,0 a,-- -- b b,0 d,1 a,-- -- a,-- a,1 -- c b,0 d,1 a,1 -- -- -- g,0 d -- e,-- -- b,-- b,0 -- a,-- e b,-- e,-- a,-- -- b,-- e,-- a,1 f b,0 c,-- --,1 h,1 f,1 g,0 -- g -- c,1 -- e,1 -- g,0 f,0 h a,1 e,0 d,1 b,0 b,-- e,-- a,1 x 1 2 3 4 5 6 7 9 , –

x 1 2 3 4 5 6 7 9 , x1 x2 x3 x4 x5 x6 x7 a a,0 -- d,0 e,1 b,0 a,-- -- Reduced Machine MInimization x1 x2 x3 x4 x5 x6 x7 a a,0 -- d,0 e,1 b,0 a,-- -- b b,0 d,1 a,-- -- a,-- a,1 -- c b,0 d,1 a,1 -- -- -- g,0 d -- e,-- -- b,-- b,0 -- a,-- e b,-- e,-- a,-- -- b,-- e,-- a,1 f b,0 c,-- --,1 h,1 f,1 g,0 -- g -- c,1 -- e,1 -- g,0 f,0 h a,1 e,0 d,1 b,0 b,-- e,-- a,1 Where there is a choice, choose 1 (as in x2-successor of compatible 1): {d,e} contained in or . x 1 2 3 4 5 6 7 9 , –

Closed Cover : Choosing Compatibles MInimization Closed Cover : Choosing Compatibles Every state of the original machine must be covered Every implied compatible must be present in the solution

Coverage: Closure: Closed Cover maximal class MInimization maximal class compatibles set 1 {a,b,d,e} {} 2 {b,c,d} {{a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} other PCs 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}} 8 {c,g} {{c,d}, {f,g}} 9 {f,g} {{e,h}} 10 {d,h} {} 12 {f} {} Let’s check if the following set of compatibles forms a closed cover: Coverage: Closure:

Covering Constraints--POS FORM MInimization maximal class compatibles set 1 {a,b,d,e} {} 2 {b,c,d} {{a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} other PCs 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}} 8 {c,g} {{c,d}, {f,g}} 9 {f,g} {{e,h}} 10 {d,h} {} 12 {f} {} Every state of the original machine must be covered.

Covering Constraints--POS FORM MInimization maximal class compatibles set 1 {a,b,d,e} {} 2 {b,c,d} {{a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} other PCs 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}} 8 {c,g} {{c,d}, {f,g}} 9 {f,g} {{e,h}} 10 {d,h} {} 12 {f} {} Every state of the original machine must be covered. c a b d e f g h

Finding a Minimum Closed Cover MInimization Associate a variable to the prime compatible For each , form the coverage constraint 1 {a,b,d,e} {} 2 {b,c,d} {{a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} This cover is not closed, since is excluded

is the set of prime compatibles with non-empty class sets Closure Constraints MInimization is the set of prime compatibles with non-empty class sets Note class sets 1 {a,b,d,e} {} 2 {b,c,d} {{a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}}

Covering and Closure Constraints--POS FORM MInimization

Covering Constraints--Matrix FORM MInimization Row Dominance Col Dominance? (see below)

Closure Constraints--Matrix FORM MInimization class sets 1 {a,b,d,e} {} 2 {b,c,d} {{a,b},{a,g},{d,e}} 3 {c,f,g} {{c,d}, {e,h}} 4 {d,e,h} {{a,b}, {a,d}} 11 {a,g} {} 5 {b,c} {} 6 {c,d} {{a,g}, {d,e}} 7 {c,f} {{c,d}} For each pair in the class set of each compatible , form the clause where ranges over the indices of compatibles that contain .

Closure Constraints--Matrix FORM MInimization Cover rows by including a 1-col OR excluding a 0-col

Covering Constraints Closure Constraints Closed Covering Problem Minimization Find a minimum set of columns which cover all rows: {1,4,5,9} Covering Constraints A row is covered by either including a 1-col or excluding a 0-col. Closure Constraints

Binate Covering Problem Similar to unate covering Matrix Variables on columns Sum expressions on the rows Solution may not exist when product is 0

The Binate Covering Problem Note: replaced by to emphasize POS semantics Also there is one addition (for empty solution space)

Unacceptable (anti-essential)Variables Binate Covering When is essential we say that is unacceptable When is essential, we may delete all rows of the matrix which has a zero in the column

Formally: Row dominates row if is satisfied, Row Dominance Binate Covering Row 1 ( ) dominates row 2 ( ) since row 2 matches row 1 at all care entries. Row 1 may be deleted. Formally: Row dominates row if is satisfied, in a Boolean sense, whenever is satisfied, that is, .

Let and be two columns of . We say that Column Dominance Binate Covering Let and be two columns of . We say that dominates if, for each row of , one of the following conditions hold: Example: reduced column dominates

Maximal Independent Set Binate Covering Two rows are independent if it is not possible to satisfy both clauses by assigning one variable to 1 Thus in finding the MIS, we ignore rows (clauses) that contain 0s, since these are satisfied by assigning variables to 0

Infeasible Subproblems Binate Covering cannot occur in original problem (first call to the recursive procedure). But it can happen after one or more recursions: This is detected by REDUCTION, which discovers that both and are essential

dominates dominates is essential dominates Solution: x x x x x x x x x Reduction Binate Covering dominates dominates x x x x x x x x x x x x 1 2 3 4 1 2 3 4 1 2 3 4 1 - f 1 - f 1 - f 1 1 1 - 1 - f - 1 - f - 1 - f 2 2 2 1 - - 1 f 1 - - 1 f 1 - - 1 f 3 3 3 1 1 f 1 1 f 1 1 f 4 4 4 is essential dominates x x x x x x x x 1 2 3 4 1 2 3 4 Solution: 1 - f 1 - f 1 1 - 1 - f - 1 - f 2 2 1 - - 1 f 1 - - 1 f 3 3 1 1 f 1 1 f 4 4

State Encoding The number of possible assignments is very high If one uses k bits to encode p states, there are (2k)!/(2k - p)! possible assignments If one considers two assignments obtained by permutation or complementation of some of the bits as essentially the same assignment, then there are (2k -1)! / (2k - p)! k! distinct assignments

Practical Encoding Algorithms State Encoding Mustang tries to identify pairs of states by receiving adjacent pairs Two codes are adjacent if they only differ in one bit The first objective is to build a graph representing the attraction between each pair of states Two states that have a strong attraction should be given adjacent codes How to build attraction graph In the fanout-oriented algorithm, whenever two states, si and sj have a common fanout state, the weight of the edge (si, sj) of the attraction graph is increased In the fanin-oriented algorithm, if si and sj have a common fanin state, the weight of the edge (si, sj) of the attraction graph is increased Once the graph of the attractions is found, we try to assign codes to pairs of states that have strong attractions

Fanout Oriented Algorithm State Encoding Build two matrices The first with one row for each present state and one column for each next state The second with one row for each present state and one column for each output

Embedding Algorithm Assign codes to states State Encoding Assign codes to states Select first the node for which the sum of the weights of the Nb heaviest incident edges is maximum

Fanin Oriented Algorithm State Encoding Build two matrices The first with one row for each next state and one column for each present state The second with one row for each next state and two columns for each output One column is for the true input and the other is for the complement

Decomposition and Encoding Rather than aiming directly at minimizing the number of literals in the next-state functions, one may actually try to minimize the support of the functions Reduction of the number of literals and simplification of the interconnections

Partitions Decomposition A partition  is on a set S is a collection of disjoint subsets of S whose set union is S, i.e.  = { Ba } such that Ba  Bb =  for a  b and  { Ba } = S Each subset is called a block of the partition If 1 and 2 are partitions on S, then 1 2 is the partition on S such that s  t(1 2 ) if and only if s  t(1 ) and s  (2 ), whereas, 1 + 2 is the partition on S such that s  t(1 + 2 ) if and only if there exists a sequence in S s=s0 s1 s2… sn = t for which either si  si+1 (1) or si  si+1 (2), 0  i  n-1

Partitions with Substitution Property Decomposition A partition  on the set of states of the machine is said to have the substitution property if and only if s  t() implies that (s,a)  (t,a) () a  I A sequential machine M has a non-trivial parallel decomposition of its state behavior if and only if there exist two nontrivial S.P. partitions 1 and 2 on M such that 1 2 = 0 Independent component Dependent component

Computation of SP Partitions Decomposition First generate the minimal SP partitions and then sum them until considering all possible sums The minimal partitions are those obtained by requiring that two states only are included in a block

General Decomposition and Encoding Need to resort to something more general than SP partitions, namely, partition pairs A partition pair (, ’) on the machine is an ordered pair of partitions on S such that s  t() implies that (s,a)  (t,a) (’) a  I The knowledge of the block of  containing the present state and of the current input allows one to compute the block ’ of that will contain the next state. It is evident that if (, ) is a partition pair, then  has substitution property Partition pairs generalize SP partitions