Download presentation
Presentation is loading. Please wait.
1
ECE 667 - Synthesis & Verification - Lecture 9b 1 ECE 697B (667) Fall 2004 ECE 697B (667) Fall 2004 Synthesis and Verification of Digital Systems Boolean Functions SOP Representation Slides adopted (with permission) from A. Kuehlmann, UC Berkeley 2003
2
ECE 667 - Synthesis & Verification - Lecture 9b 2 Representation of Boolean Functions Sum of Products: A function can be represented by a sum of cubes (products): f = ab + ac + bc Since each cube is a product of literals, this is a “sum of products” (SOP) representation A SOP can be thought of as a set of cubes F F = {ab, ac, bc} A set of cubes that represents f is called a cover of f. F 1 ={ab, ac, bc} and F 2 ={abc,abc’,ab’c,ab’c’,bc} are covers of f = ab + ac + bc.
3
ECE 667 - Synthesis & Verification - Lecture 9b 3 SOP Covers (SOP’s) can efficiently represent many practical logic functions (i.e. for many, there exist small covers). Two-level minimization seeks the minimum size cover (least number of cubes) bc ac ab c a b = onset minterm Note that each onset minterm is “covered” by at least one of the cubes! None of the offset minterms is covered
4
ECE 667 - Synthesis & Verification - Lecture 9b 4 Irredundant Cubes Let F = {c 1, c 2, …, c k } be a cover for f, i.e. f = i k =1 c i A cube c i F is irredundant if F\{c i } f Example: f = ab + ac + bc bc ac ab c a b bc ac Not covered F\{ab} f
5
ECE 667 - Synthesis & Verification - Lecture 9b 5 Prime Cubes A literal j of cube c i F ( =f ) is prime if (F \ {c i }) {c” i } f where c” i is c i with literal j of c i deleted. A cube of F is prime if all its literals are prime. Example f = ab + ac + bc c i = ab; c” i = a (literal b deleted) F \ {c i } {c” i } = a + ac + bc bc ac a c a b Not equal to f since offset vertex is covered F=ac + bc + a = F \{c i } {c” i }
6
ECE 667 - Synthesis & Verification - Lecture 9b 6 Definitions - Prime, Irredundant, Essential Definition 1 A cube is prime if it is not contained in any other cube. A cover is prime if all its cubes are prime. Definition 2 A cover is irredundant if all its cubes are irredundant. Definition 3 A prime of f is essential (essential prime) if there is a minterm (essential vertex) in that prime that is in no other prime. Definition 4 Two cubes are orthogonal if they do not have any minterm in common – –E.g. c 1 = abc 2 = b’c are orthogonal c 1 = ab’c 2 = b’c are not orthogonal
7
ECE 667 - Synthesis & Verification - Lecture 9b 7 Prime and Irredundant Covers Example: f = abc + b’d + c’d is prime and irredundant. abc is essential since abcd’ abc, but not in b’d or c’d or ad Why is abcd not an essential vertex of abc? What is an essential vertex of abc? What other cube is essential? What prime is not essential? abc bd cd d a c b abcd abcd’
8
ECE 667 - Synthesis & Verification - Lecture 9b 8 PLAs - Multiple Output Functions A PLA is a function f : B n B m represented in SOP form: f2f2 f3f3 f1f1 n=3, m=3 aabbcc abc f 1 f 2 f 3 10- 1 - - -11 1 - - 0-0 - 1 - 111 - 1 1 00- - - 1 Personality Matrix
9
ECE 667 - Synthesis & Verification - Lecture 9b 9 PLAs (cont.) Each distinct cube appears just once in the AND-plane, and can be shared by (multiple) outputs in the OR-plane, e.g., cube (abc). Extensions from single output to multiple output minimization theory are straightforward. Multi-level logic can be viewed mathematically as a collection of single output functions.
10
ECE 667 - Synthesis & Verification - Lecture 9b 10 Shannon (Boole) Cofactors Let f : B n B be a Boolean function, and x= (x 1, x 2, …, x n ) the variables in the support of f. The cofactor f a of f w.r.t literal a=x i or a=x’ i is: f x i (x 1, x 2, …, x n ) = f (x 1, …, x i-1, 1, x i+1,…, x n ) f x’ i (x 1, x 2, …, x n ) = f (x 1, …, x i-1, 0, x i+1,…, x n ) The computation of the cofactor is a fundamental operation in Boolean reasoning ! Example: a b c f = abc + abc a b c f a = bc
11
ECE 667 - Synthesis & Verification - Lecture 9b 11 Generalized Cofactor The generalized cofactor f C of f by a cube C is f with the fixed values indicated by the literals of C, e.g. if C=x i x’ j, then x i =1, and x j =0. if C= x 1 x’ 4 x 6 f C is just the function f restricted to the subspace where x 1 =x 6 =1 and x 4 =0. As a function, f C does not depend on x 1,x 4 or x 6 anymore (However, we still consider f C as a function of all n variables, it just happens to be independent of x 1,x 4 and x 6 ). x 1 f f x 1 Example: f= ac + a’c, af = ac, f a =c
12
ECE 667 - Synthesis & Verification - Lecture 9b 12 Fundamental Theorem Theorem: Let c be a cube and f a function. Then c f f c 1. Proof. We use the fact that xf x = xf, and f x is independent of x. If : Suppose f c 1. Then cf=f c c=c. Thus, c f. f c
13
ECE 667 - Synthesis & Verification - Lecture 9b 13 Proof (cont.) Only if. Assume c f Then c cf = cf c. But f c is independent of literals i c. If f c 1, then m B n, f c (m)=0. We will construct a m’ from m and c in the following manner: m i ’=m i, if x i c and x i c, m i ’=1, if x i c, m i ’=0, if x i c. i.e. we made the literals of m’ agree with c, i.e. m’ c c(m’)=1 Also, f c is independent of literals x i,x i c f c (m’) = f c (m) = 0 f c (m’) c(m’)= 0 contradicting c cf c. m m= 000 m’= 101 m’ C=xz
14
ECE 667 - Synthesis & Verification - Lecture 9b 14 Cofactor of Covers Definition: The cofactor of a cover F is the sum of the cofactors of each of the cubes of F. Note: If F={c 1, c 2,…, c k } is a cover of f, then F c = {(c 1 ) c, (c 2 ) c,…, (c k ) c } is a cover of f c. Suppose F(x) is a cover of f(x), i.e. Then for 1 j n, is a cover of f x j (x)
15
ECE 667 - Synthesis & Verification - Lecture 9b 15 Definition: The cofactor C x j of a cube C with respect to a literal x j is C if x j and x’ j do not appear in C C\{x j } if x j appears positively in C, i.e. x j C if x j appears negatively in C, i.e. x j C Example 1:C = x 1 x’ 4 x 6, C x 2 = C (x 2 and x 2 do not appear in C ) C x 1 = x’ 4 x 6 (x 1 appears positively in C) C x 4 = (x 4 appears negatively in C) Example 2: F = abc + b’d + c’d F b = ac + c’d (Just drop b everywhere and throw away cubes containing literal b) Cofactor of Cubes
16
ECE 667 - Synthesis & Verification - Lecture 9b 16 Shannon Expansion f : B n B Shannon Expansion: Theorem: F is a cover of f. Then We say that f (F) is expanded about x i. x i is called the splitting variable.
17
ECE 667 - Synthesis & Verification - Lecture 9b 17 Example Cube bc got split into two cubes c a b c a b bc ac ab Shannon Expansion (cont.)
18
ECE 667 - Synthesis & Verification - Lecture 9b 18 List of Cubes (Cover Matrix) We often use a matrix notation to represent a cover: Example: F = ac + c’d = a b c d a b c d a c 1 2 1 2 or 1 - 1 - c’ d 2 2 0 1 - - 0 1 Each row represents a cube 1 means that the positive literal appears in the cube 0 means that the negative literal appears in the cube The 2 (or -) represents that the variable does not appear in the cube. It implicitly represents both 0 and 1 values.
19
ECE 667 - Synthesis & Verification - Lecture 9b 19 Definition: A function f : B n B is symmetric with respect to variables x i and x j iff f(x 1,…,x i,…,x j,…,x n ) = f(x 1,…,x j,…,x i,…,x n ) Definition: A function f : B n B is totally symmetric iff any permutation of the variables in f does not change the function Some Special Functions Symmetry can be exploited in searching the binary decision tree because: - That means we can skip one of four sub-cases - used in automatic variable ordering for BDDs
20
ECE 667 - Synthesis & Verification - Lecture 9b 20 Definition: A function f : B n B is positive unate in variable x i iff This is equivalent to monotone increasing in x i : for all min-term pairs (m -, m + ) where For example, m - 3 =1001, m + 3 =1011(where i=3) Unate Functions
21
ECE 667 - Synthesis & Verification - Lecture 9b 21 Similarly for negative unate monotone decreasing: A function is unate in x i if it is either positive unate or negative unate in x i. Definition: A function is unate if it is unate in each variable. Definition: A cover F is positive unate in x i iff x i c j for all cubes c j F Unate Functions
22
ECE 667 - Synthesis & Verification - Lecture 9b 22 c b a m+m+ m-m- f(m - )=1 f(m + )=0 positive unate in a,b negative unate in c Example
23
ECE 667 - Synthesis & Verification - Lecture 9b 23 The Unate Recursive Paradigm Key pruning technique based on exploiting the properties of unate functions – –based on the fact that unate leaf cases can be solved efficiently New case splitting heuristic – –splitting variable is chosen so that the functions at lower nodes of the recursion tree become unate
24
ECE 667 - Synthesis & Verification - Lecture 9b 24 Unate covers F have many extraordinary properties: – –If a cover F is minimal with respect to single-cube containment, all of its cubes are essential primes. – –In this case F is the unique minimum cube representation of its logic function. – –A unate cover represents the tautology iff it contains a cube with no literals, i.e. a single tautologous cube. This type of implicit enumeration applies to many sub-problems (prime generation, reduction, complementation, etc.). Hence, we refer to it as the Unate Recursive Paradigm. The Unate Recursive Paradigm
25
ECE 667 - Synthesis & Verification - Lecture 9b 25 Unate Recursive Paradigm Create cofactoring tree stopping at unate covers – –choose, at each node, the “most binate” variable for splitting – –recurse till no binate variable left (unate leaf) “Operate” on the unate cover at each leaf to obtain the result for that leaf. Return the result At each non-leaf node, merge (appropriately) the results of the two children. Main idea: “Operation” on unate leaf is computationally less complex Operations: complement, simplify,tautology,generate-primes,... a c b merge
26
ECE 667 - Synthesis & Verification - Lecture 9b 26 Recursive Complement Operation We have shown how tautology check (SAT check) can be implemented recursively using the Binary Decision Tree Similarly, we can implement Boolean operations recursively Example COMPLEMENT operation: Theorem: Proof :
27
ECE 667 - Synthesis & Verification - Lecture 9b 27 COMPLEMENT Operation Algorithm COMPLEMENT(List_of_Cubes C) { if(C contains single cube c) { C res = complement_cube(c) // generate one cube per return C res // literal l in c with ^l } else { x i = SELECT_VARIABLE(C) C 0 = COMPLEMENT(COFACTOR(C,^x i )) Ù ^x i C 1 = COMPLEMENT(COFACTOR(C,x i )) Ù x i return OR(C 0,C 1 ) }
28
ECE 667 - Synthesis & Verification - Lecture 9b 28 Complement of a Unate Cover Complement of a unate cover can be computed more efficiently Idea: – –variables appear only in one polarity on the original cover (ab + bc + ac) = (a+b)(b+c)(a+c) – –when multiplied out, a number of products are redundant aba + abc + aca + acc + bba + bbc + bca + bcc = ab + ac + bc – –we just need to look at the combinations for which the variables cover all original minterms – –this works independent of the polarity of the variables because of symmetry to the (1,1,1,…,1) case
29
ECE 667 - Synthesis & Verification - Lecture 9b 29 Incompletely Specified Functions F = (f, d, r) : B n {0, 1, *} where * represents a don’t care. f = onset function - f(x)=1 F(x)=1 r = offset function - r(x)=1 F(x)=0 d = don’t care function - d(x)=1 F(x)=* (f,d,r) forms a partition of B n. i.e. f + d + r = B n fd = fr = dr = (pairwise disjoint)
30
ECE 667 - Synthesis & Verification - Lecture 9b 30 A completely specified function g is a cover for F=(f,d,r) if f g f+d (Thus gr = ). Thus, if x d (i.e. d(x)=1), then g(x) can be 0 or 1, but if x f, then g(x)=1 and if x r, then g(x)=0. (We “don’t care” which value g has at x d) Incompletely Specified Functions
31
ECE 667 - Synthesis & Verification - Lecture 9b 31 Example:Logic Minimization Consider F(a,b,c)=(f,d,r), where f={abc, abc, abc} and d ={abc, abc}, and the sequence of covers illustrated below: abc is redundant a is prime F 3 = a+abc Expand abc bc Expand abc a F 2 = a+abc + abc F 4 = a+bc off on Don’t care F 1 = abc + abc+ abc
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.