Presentation is loading. Please wait.

Presentation is loading. Please wait.

Heuristic Minimization of Two Level Circuits

Similar presentations


Presentation on theme: "Heuristic Minimization of Two Level Circuits"— Presentation transcript:

1 Heuristic Minimization of Two Level Circuits
Sungho Kang Yonsei University

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

3 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

4 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 The solutions with more cubes than the initial cover are not part of the search space

5 Local Search Applied to Logic Minimization
xyz f xyz f change into Expand output xyz fg xyz fg xyz fg xyz fg xyz fg

6 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);

7 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 xyz f check the validity of the expansion of to 0-0 1 000 1 must check the containment of in xyz ( F-{ci} )  D

8 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

9 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

10 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

11 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 f(x1, x2, …, xn) is unate in variable x1, then there exists a cover of f unate in x1 If a cover F is unate in x1, then the function F represents is also in x1 A unate cover F is a tautology if and only if it contains the constant term 1

12 Unate Functions Non-unate cover wxyz f - 1- 1 1 0 -10 1 010- 1
Equivalence and Tautology Non-unate cover xyz f yz fx yz fx’ 1-1 1 after splitting 00- 1 0-0 1 It is sufficient to examine one of them to see that the function is not a tautology wxyz f All minterms with w=1 and x=0 cause f to be 0 After simplification, no row is left The fucntion is not tautologous

13 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

14 Tautology Checks : Example
Equivalence and Tautology First : Not a tautology wxyz f cover is unate in w and x cofactor wrt to w’ and x yz f Second : Not a tautology wxyz fg cover is unate in x and x cofactor yz fg can drop y g is not a tautology

15 Choosing the Right Direction
The choice of one direction over another may influence the quality of the solution

16 Recursive Complementation
Right Direction For a Boolean function f f’ = x fx’ +x’ fx’’ For f monotonic increasing in x f’ = fx’ +x’ fx’’ For f monotonic decreasing in x f’ = x fx’ + fx’’

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

18 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

19 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


Download ppt "Heuristic Minimization of Two Level Circuits"

Similar presentations


Ads by Google