Heuristic Minimization of Two Level Circuits

Slides:



Advertisements
Similar presentations
Three Special Functions
Advertisements

Minimization of Circuits
Irredundant Cover After performing Expand, we have a prime cover without single cube containment now. We want to find a proper subset which is also a cover.
CSEE 4823 Advanced Logic Design Handout: Lecture #2 1/22/15
Universal logic design algorithm and its application to the synthesis of two-level switching circuits §H.-J.Mathony §IEEE Proceedings 1989.
MVI Function Review Input X is p -valued variable. Each Input can have Value in Set {0, 1, 2,..., p i-1 } literal over X corresponds to subset of values.
Two-Level Logic Synthesis -- Heuristic Method (ESPRESSO)
1 Consensus Definition Let w, x, y, z be cubes, and a be a variable such that w = ax and y = a’z w = ax and y = a’z Then the cube xz is called the consensus.
Multi-Valued Input Two-Valued Output Functions. Multi-Valued Input Slide 2 Example Automobile features 0123 X1X1 TransManAuto X2Doors234 X3ColourSilverRedBlackBlue.
ENEE 6441 On Quine-McCluskey Method > Goal: find a minimum SOP form > Why We Need to Find all PIs? f(w,x,y,z) = x’y’ +wxy+x’yz’+wy’z = x’y’+x’z’+wxy+wy’z.
ECE Synthesis & Verification - Lecture 9b 1 ECE 697B (667) Fall 2004 ECE 697B (667) Fall 2004 Synthesis and Verification of Digital Systems Boolean.
Two-Level Logic Minimization Exact minimization –problem : very large number of prime and very large number of minterm Heuristic minimization –avoid computing.
Irredundant Cover After performing Expand, we have a prime cover without single cube containment now. We want to find a proper subset which is also a cover.
1 Generalized Cofactor Definition 1 Let f, g be completely specified functions. The generalized cofactor of f with respect to g is the incompletely specified.
Winter 2014 S. Areibi School of Engineering University of Guelph
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
Simple Minimization Loop F = EXPAND(F,D); F = IRREDUNDANT(F,D); do { cost = F ; F = REDUCE(F,D); F = EXPAND(F,D); F = IRREDUNDANT(F,D); } while ( F < cost.
Logic gate level Part 3: minimizing circuits. Improving circuit efficiency Efficiency of combinatorial circuit depends on number & arrangement of its.
Lecture 3. Boolean Algebra, Logic Gates
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.
Two Level Logic Optimization. Two-Level Logic Minimization PLA Implementation Ex: F 0 = A + B’C’ F 1 = AC’ + AB F 2 = B’C’ + AB product term AB, AC’,
Tautology. Tautology Decision May be able to use unateness to simplify process Unate Function – one that has either the uncomplemented or complemented.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Two-Level Minimization II.
BOOLEAN FUNCTION PROPERTIES
Synthesis of Two-Level Circuits
Heuristic Two-level Logic Optimization Giovanni De Micheli Integrated Systems Centre EPF Lausanne This presentation can be used for non-commercial purposes.
ECE 3110: Introduction to Digital Systems Symplifying Products of sums using Karnaugh Maps.
State university of New York at New Paltz Electrical and Computer Engineering Department Logic Synthesis Optimization Lect15: Heuristic Two Level Logic.
February 2, 2004CS 2311 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are AND, OR and.
CS231 Boolean Algebra1 Summary so far So far: – A bunch of Boolean algebra trickery for simplifying expressions and circuits – The algebra guarantees us.
June 12, 2002© Howard Huang1 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are.
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.
Boolean Algebra.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Heuristic Minimization of Two-Level Logic
Computer Organisation
Prof. Sin-Min Lee Department of Computer Science
CS 105 Digital Logic Design
As the last CC-list represents Maximum Compatible Classes we conclude:
CS 352 Introduction to Logic Design
… and now for the Final Topic:
Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn how to how use Boolean algebra to.
ECE 2110: Introduction to Digital Systems
Lecture 3 Gunjeet Kaur Dronacharya Group of Institutions
17-Nov-18 Logic Algebra 1 Combinational logic.
ICS 252 Introduction to Computer Design
Synthesis of Two Level Circuits
MVI Function Review Input X is p-valued variable. Each Input can have Value in Set {0, 1, 2, ..., pi-1} literal over X corresponds to subset of values.
Functions Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways: We can represent.
MINTERMS and MAXTERMS Week 3
Sungho Kang Yonsei University
COE 202: Digital Logic Design Combinational Logic Part 3
ECB2212-Digital Electronics
Synthesis and Verification of Finite State Machines
MVI Function Review Input X is p-valued variable. Each Input can have Value in Set {0, 1, 2, ..., pi-1} literal over X corresponds to subset of values.
Minimization of Switching Functions
Heuristic Minimization of Two Level Circuits
From now on: Combinatorial Circuits:
Overview Part 2 – Circuit Optimization
ECE 352 Digital System Fundamentals
ICS 252 Introduction to Computer Design
Karnaugh maps Last time we saw applications of Boolean logic to circuit design. The basic Boolean operations are AND, OR and NOT. These operations can.
Basic circuit analysis and design
Tautology Decision May be able to use unateness to simplify process
ECE 352 Digital System Fundamentals
Presentation transcript:

Heuristic Minimization of Two Level Circuits Sungho Kang Yonsei University

Outline Local Search Checking for Equivalence and Tautology Choosing the Right Direction Identifying Essential Implicants

Local Search Local search algorithms The algorithms that start from an initial solution and try to find a better one by applying successive modifications One property of the solution of a local search algorithm is local optimality A solution is locally optimal if its neighborhood does not contain any solution of lower cost In order to guarantee local optimality, it is sufficient to use the following stopping criterion Stop when there is no cheaper solution in the neighborhood of the current solution

Local Search Applied to Logic Minimization Starting point is a cover for a multi-output function and the cost is the number of cubes with the number of literals as a tie-breaker The neighborhood is defined as the set of covers that are obtained from the original cover by adding or removing exactly one literal to one of the cubes A new cover obtained is a feasible point if it is equivalent to the original one i.e. if it represents the same function The solutions with more cubes than the initial cover are not part of the search space

Local Search Applied to Logic Minimization x y z f 1 - x y z f - 1 change 000 1 into 0-0 1 Expanding input parts and removing the cube from the cover

Local Search Applied to Logic Minimization Expand output part and remove the cube x y z f g - 1 x y z f g - 1 x y z f g - 1 x y z f g 1 - x y z f g 1 -

Simple Local Search Algorithm F = EXPAND(F,D); F = IRREDUNDANT(F,D); do { cost = |F|; F = REDUCE(F,D); } while (|F| < cost); F = MAKE_SPARSE(F,D);

MAKE_SPARSE Example x y z f g 1 - Local Search x y z f g 1 - All cubes are maximally expanded in their input and output parts The input term xz of f is redundant MAKE_SPRSE eliminates it x y z f g 1 -

Checking for Equivalence Equivalence and Tautology Two problems One is the choice of the best move when many are possible The other is checking a move for validity When a cube is expanded new minterms are added to it Check that none of these minterms belong to the OFF-set When a cube is reduced minterms are removed from it Make sure that these minterms are either covered by some other cubes or belong to the DC-set

Checking for Equivalence Equivalence and Tautology The expansion or reduction is valid if and only if ci*  ( F-{ci} )  D F={cj} is the current cover for ON-set and D is the cover for DC-set ci is the cube of F that is being added or reduced ci* is the cube that contains the newly added or removed minterms check the validity of the expansion of 000 1 to 0-0 1 ci is 000 1 and ci* is 010 1 must check the containment of 010 1 in x y z f 1 - x y z ( F-{ci} )  D 1 -

Checking for Tautology Equivalence and Tautology A possible simplistic approach is to examine all the minterms of ci* for containment in ( F-{ci} )  D This is simple but there could be too many minterms to examine Improvement Initially check for single cube containment of ci* If that fails, we break ci* into halves and check the two halves separately If both are contained, we are done If only one is contained, the other is split again, and so on If eventually we find no minterms that are not contained, the containment test has succeeded

Checking for Tautology Equivalence and Tautology The cofactor of a function f(x1, x2, …, xn) with respect to literal x1, written fx1, is f(1, x2, …, xn) The cofactor of a function f(x1, x2, …, xn) with respect to literal x1’, written fx1’, is f(0, x2, …, xn) The cofactor of a function f(x1, x2, …, xn) with respect to cube c is the successive cofactoring of f with respect to all the literals in c A function that is identically 1 is called a tautology For a function f and a cube c c  f  fc  1 (c  f → cc  fc  1 fc  fc  1)

Checking for Tautology Equivalence and Tautology Advantages of [ ( F-{ci} )  D ] ci* Cofactoring may greatly simplify the function by reducing the number of variables and cubes Tautology The cofactor is taken by selecting the rows such that The first and the third input columns are not 0 The first output column is a 1

Checking for Tautology Equivalence and Tautology General rule Eliminate the rows that disagree with the input part of ci* A disagreement means that the row has a 1 in an input column where ci* has a 0 or vice versa Eliminate the rows that do not have at least a 1 in an output column where ci* has a one

Unate Functions Equivalence and Tautology A function f(x1, x2, …, xn) is monotonically increasing in variable x1 if and only if f(0, x2, …, xn )  f(1, x2, …, xn) A function f(x1, x2, …, xn) is monotonically decreasing in variable x1 if and only if f(0, x2, …, xn )  f(1, x2, …, xn) If neither of the two above is true, f is non monotonic in x1 A function f(x1, x2, …, xn) is unate in variable x1 if and only if it is either monotonic increasing or monotonic decreasing in x1 It is unate if it is unate in all of its variables

Unate Functions Equivalence and Tautology A cover f is monotonically increasing in variable x1 if and only if x1 never appears complemented in the terms of f It is monotonically decreasing in variable x1 if and only if x1 never appears uncomplemented in the terms of f If neither of the two above is true, f is non monotonic in x1 If function ia unate in variable x1 then there exists a cover of f unate in x1 If a cover in F is unate in x1 then the function F represents is also unate in x1 A unate cover F is a tautology if and only if it contains the constant term 1

Unate Functions Non-unate cover xyz f yz fx yz fx’ Equivalence and Tautology Non-unate cover xyz f yz fx yz fx’ 1-1 1 after splitting -1 1 0- 1 11- 1 1- 1 -0 1 00- 1 0-0 1 It is sufficient to examine one of them to see that the function is not a tautology

Unate Functions Equivalence and Tautology It is sufficient to test the negative cofactor for tautology to get the answer for the complete functions If a function is negative unate in a variable, it is sufficient to test the positive cofactor for tautology wxyz f - 1- 1 1 0 -10 1 010- 1 All minterms with w=1 and x=0 cause f to be 0 After simplification, no row is left The fucntion is not tautologous

Speed-up for Tautology Checking Equivalence and Tautology A row of all - in the input part If such a row is found, the function is tautologous in all the outputs that have a 1 in that row This condition is always sufficient and is also necessary for unate functions An input column of all 1s or all 0s If such a column is found, the function is not a tautology If the number of inputs is less than 8, the truth table is generated and the tautology question is answered by inspection The rationale is that if the number of inputs is small enough, generating the truth table is faster than recurring If the vertex count of the cover is insufficient, the function is not a tautology The vertex count of the cover is the sum of the vertex counts of the cubes

Speed-up for Tautology Checking Equivalence and Tautology Partitioning a search problem is normally very advantageous If a cover F can be written as F = G + H where G and H have disjoint support (no variables in common), then F is tautologous if and only if either G and H are tautologous Let x1, …xk be the variables on which G depends and xk+1, … xn be the variables on which H depends If G(x1*, …xk*)=0 and H(xk+1*, … xn*)=0, then F(x1*, …xk*, xk+1*, … xn*)=0

Speed-up for Tautology Checking Equivalence and Tautology Finding a bipartition The set of columns of the first block C1, is initialized to empty One then picks a cube of the cover All the columns where the cube is 0 or 1 are added to C1 Then all the cubes that intersect any of the column in C1 are selected and their columns added to C1 The process is repeated until no addition to C1 is possible There are two possible outcomes C1 includes all the columns of the cover There is no bipartition At least one column is left over The leftover columns and rows identify the second block of the partition

Speed-up for Tautology Checking Equivalence and Tautology Partitioning example 12345 1 1-1- - 2 -1--0 3 0--0- 4 -- 01- 5 ---- 1 C1={1,3,4} and C2={2,5} Neither subproblem is tautologous

Tautology Checks : Example Equivalence and Tautology Not a tautology wxyz f cover is unate in w and x - - 1 - 1 1 - - 1 1 cofactor wrt to w’ and x yz f - 0 - 0 1 1- 1 - 0 0 - 1

Tautology Checks : Example Equivalence and Tautology A multiple output cover is tautologous if all the outputs are tautologous wxyz fg cover is unate in w and x 1- 01 01 - 110 10 cofactor yz fg 1110 11 -0 10 - - - 0 10 -1 11 - - - 1 11 can drop y g is not a tautology Not a tautology

Choosing the Right Direction The choice of one direction over another may influence the quality of the solution Having an explicit representation of the OFF-set of the function helps

Recursive Complementation Right Direction For a Boolean function f f’ = xf’x +x’f’x’ Proof Let g = xf’x +x’f’x’ ( f = xfx +x’fx’ ) f + g = x(fx + f’x) + x’(fx’ + f’x’) = x + x’ = 1 fg = (xfx +x’fx’)(xf’x +x’f’x’) = 0

Recursive Complementation Example Right Direction Positive cofactor wrt x Positive cofactor wrt x f’xy’ = 0 x y z f 1 - y z fx - 1 z fxy 1 z f’xy 1 z fxy’ - 1 z f’xy’ y z f’x’ - 1 y z fx’ - 1 y z f’x 1 x y z f’ 1 -

Recursive Complementation Right Direction For f monotonic increasing in x f’ = fx’ +x’ fx’’ For f monotonic decreasing in x f’ = x fx’ + fx’’

Recursive Complementation Right Direction Example wxyz If we select w, a row of all dashes will appear in fw 11 - - Complement of the tautology is trivial to compute 1 - - - - 1 - 1 fw’ = 0 - 11 - compute fw’’ cofactoring f xyz - 111 1- 1 11- 111 fw’’ = x’+G’ xyz final result 0- - wxyz -00 00 - - 0 - 00

Using the OFF-set in the Expansion Right Direction Build a blocking matrix, that has a row for each cube in the OFF-set and a column for each variable A row of the blocking matrix tells us that it is OK to expand the cube, as long as at least one of the directions corresponding to one of its ones is not expanded It is not difficult to see that finding a maximum expansion corresponds to finding a minimum subset of the columns of the blocking matrix that covers all the rows

Identifying Essential Primes Let F be a cover composed of prime implicants Let e be one of the primes in F and let G be the cover composed of the remaining primes Then e is an essential prime if and only if it is not covered by the union of ; 1. The consensus terms of e and each term of G 2. The intersections of e and each term of G

Identifying Essential Primes Consider y’z’+xy’+xz and test y’z’ This prime intersects xy’ (the intersection is xy’z’) It also has a consensus term with xz (xy’) To see whether y’z’ is essential, check y’z’  xy’ + xy’z’ Since xy’z’ xy’, need to check y’z’  xy’ The answer is no; hence y’z’ is essential If we consider xy’, need to check whether xy’ is covered by xy’z’ + xy’z The answer is positive and xy’ is not essential

Identifying Essential Primes Consider f = x’z’+x’y+xz The cover is not a complete sum Therefore it is not immediate to see whether a given prime is essential Suppose we want to test x’y Its intersection with x’z’ is x’yz’, while its consensus term with xz is yz Hence we test x’y  x’yz’ + yz Cofactoring the right hand side, we get z’+x, which is clearly a tautology Hence x’y is not essential