Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multilevel Logic Synthesis -- Algebraic Methods. ENEE 6442 Why Algebraic Methods? > What is our goal? minimization, maximally factored form. > Algebraic.

Similar presentations


Presentation on theme: "Multilevel Logic Synthesis -- Algebraic Methods. ENEE 6442 Why Algebraic Methods? > What is our goal? minimization, maximally factored form. > Algebraic."— Presentation transcript:

1 Multilevel Logic Synthesis -- Algebraic Methods

2 ENEE 6442 Why Algebraic Methods? > What is our goal? minimization, maximally factored form. > Algebraic methods provide fast algorithms. =Algebraic methods treat logic function like a polynomial =Fast algorithms for polynomial manipulation exist. > Algebraic methods may lose the optimality, but the results are quite good in general. > Algebraic methods can be used to iterate and interleave with Boolean operations.

3 ENEE 6443 > What is Division? =7 = 2 x 3 + 1 =Divisor: what to divide with? =Quotient and remainder: how to divide? =F = G · H + R > Why Division? Division is central in many operations: =factoring and decomposition =resubstitution =extraction Division: Outline

4 ENEE 6444 Product > The product of two algebraic expressions F = X 1 +X 2 +…+X m and G = Y 1 +Y 2 +…+Y n is the SOP expression obtained by simplifying the result of (X 1 +X 2 +…+X m )(Y 1 +Y 2 +…+Y n ) using xx’=0 and xx=x. =Example: (a+b)(a+c) = a + ab + ac + bc > The product FG is algebraic if F and G are orthogonal, otherwise, it is called a Boolean product. =Example: (a+b)(c+d) = ac + ad + bc + bd(algebraic) (a+b)(a+c) = aa+ab+ac+bc(Boolean) (a+b)(a+c) = aa+ab+ac+bc(Boolean)

5 ENEE 6445 Algebraic and Boolean Expressions > f is an algebraic expression if f is a set of cubes (SOP), such that no single cube contains another (minimal with respect to single cube containment). Otherwise, f is called a Boolean expression. =Example: a+bc is algebraic, a+ab is Boolean. > The support of an expression f, supp(f), is the set of variables that f explicitly depends on. Two expressions f and g are said to be orthogonal if supp(f)  supp(g)= , denoted by f  g. =Example: a+b  c+d Recall:

6 ENEE 6446 Division > Division is an operation that takes two SOP expressions F and P, and generates SOP expressions Q and R, s.t. F = PQ +R. =The division is algebraic is PQ is an algebraic product; otherwise it is a Boolean division. =Q is called the quotient, R is called the remainder. =If R=0, P is a factor, otherwise it is called a divisor. > Example:F = ad + ae + bcd + j =For P = a, Q = d+e, R = bcd+j =For P = a+bc, Q=d, R=ae+j =Both a and a+bc are divisors, not factors.

7 ENEE 6447 Weak Division > For division F = PQ+R, it is weak if =PQ is an algebraic product; =R has as few cubes as possible; =PQ+R and F are the same expression (same cubes). {Q,R} is unique given F and P, denote Q=F/P. > Example: =For F=ad+abc+bcd, P=a+bc: Q=d, R=abc =For F=ac+ad+bc+bd+e, P=a+b: Q=c+d,R=e =For F=ad+aef+ab+b’cd+b’cef, P=a+b’c If P=a: Q=d+ef+bIf P=a: Q=d+ef+b If P=b’c, Q=d+efIf P=b’c, Q=d+ef Q=d+ef,R=ab

8 ENEE 6448 Kernel and Co-Kernel: Motivation > We know how to divide a given expression F by another expression G. (division) > How to find G? =Too many Boolean divisors: a+bc’ =Restrict to algebraic divisors, e.g. cubes > Problem: Given a set of functions, find common weak (algebraic) divisors.

9 ENEE 6449 Kernels: Definitions > An expression is cube-free if no cube divides the expression evenly (i.e. no remainder, or there is no literal that is common to all the cubes). =Example: ab+c is cube-free ab+ac is not (a is a common factor) ab+ac is not (a is a common factor) abc is not (must have two or more cubes) abc is not (must have two or more cubes) > The primary divisors of an expression F are the set of expressions D(F) = {F/c | c is a cube}. =Example: F = (a+b+c)(d+e)f + bfg + h df+ef (=F/a) is a primary divisor d+e+g (=F/bf) is a primary divisor

10 ENEE 64410 Kernels: Definitions (cont’d) > The kernels of an expression F are K(F) = {G | G  D(F) and G is cube-free}. =Example: F = (a+b+c)(d+e)f + bfg + h df+ef (=F/a)  D(F), but not a kernel. d+e+g (=F/bf)  D(F) and is cube-free. > A cube c used to obtain the kernel K=F/c is called a co-kernel of K. C(F) = {c | F/c  K(F)}. > A kernel is of level 0 if it has no kernels except itself. A kernel of level n has at least one kernel of level n-1, but no kernel (except itself) of level n or greater.

11 ENEE 64411 Kernels: Example F = adf + aef + bdf + bef + cdf + cef + bfg + h F = adf + aef + bdf + bef + cdf + cef + bfg + h = (a+b+c)(d+e)f + bfg + h cube Prim. Div. KernelCo-kernellevel adf+efNONO-- bdf+ef+fgNONO-- bfd+e+gYESYES0 cfd+eYESYES0 dfa+b+cYESYES0 fgbNONO-- f(a+b+c)(d+e)+bgYESYES1 1FYESYES2

12 ENEE 64412 Kernel Computation: Cube Intersection Given F = X 1 +X 2 +…+X n, compute K(F) and C(F) > C*(F) = {c | c= X i  X j for some i and j} (This contains all the level-0 co-kernels.) > weak_div(F,c) = F/c is a kernel with c as the corresponding co-kernel. Example: F = abcd + abce + efg =C*(F) = {abc, e} =F/abc = d+e,F/e = abc+fg > Problem: gives only level-0 co-kernels, to get for example level-1 co-kernels,

13 ENEE 64413 Kernel Computation: Example Find all the level-0 co-kernels for abc+abd’+bcd’+ade+cde+a’ce -ceec-ca’ce -dec-ccde --aaade -bd’bcbcd’ -ababd’ -abca’cecdeadebcd’abd’abc 0a’+dce 1ad+cd+a’ce 0a+cde 0a+cbd’ 1 ab+bd’+de +a’e c 1bc+bd’+dea 0a+d’bc 0c+d’ab lev el primary divisor cube How about level-1 kernels? Repeat Above Recursively by comparing 3-way.. N-way cube intersections

14 ENEE 64414 Fundamental Theorem > Theorem: If two expressions F and G have the property that  k F  K(F), k G  K(G)  | k G  k F |  1 (k G and k F have at most one term in common), then F and G have no common nontrivial algebraic divisors (i.e. with at least two terms) else it does. > Importance: If we “kernel” all functions and there are no nontrivial intersections, then the only common algebraic divisors left are single cube divisors. This is used for quickly finding common subfunctions.

15 ENEE 64415 Factoring and Factoring Algorithm > Factoring is the process of deriving a factored form for a given logic function in SOP form. > A factoring algorithm is algebraic if it guarantees an algebraic factored form from an algebraic SOP expression; otherwise it is Boolean. F = ab+ac+bcF = a(b+c)+bc factoring SOP form factored form goal: minimize the number of literals

16 ENEE 64416 Generic Factoring Algorithm Factor(F) { if (F has no factor) return F; D = Divisor(F); (could be a kernal or co-kernal or literal) D = Divisor(F); (could be a kernal or co-kernal or literal) (Q,R) = Divide(F,D); (Q,R) = Divide(F,D); return return Factor(Q)Factor(D) Factor(Q)Factor(D) + Factor(R); + Factor(R);}Example: F = abc+abd+ae+af+g D = c+d F = DQ+R Q = ab R = ae+af+g = a(e+f) + g = a(e+f) + g (Factor(R)) O = ab(c+d) + a(e+f)+g

17 ENEE 64417 Maximal Factorizations > A factored form is maximally factored if =For every sum of products, there are no two syntactically equivalent factors in the products; =For every product of sums, there are no two syntactically equivalent factors in the sums. > Example: =ab+ac is not maximally factored, a(b+c) is. =(a+b)(a+c) is not maximally factored, a+bc is. b + · ca a ·Recall:

18 ENEE 64418 Problem with Algorithm Factor > O = ab(c+d) + a(e+f)+g is not optimal since it is not maximally factored. a(b(c+d)+e+f)+g > The problem occurs when =Quotient Q is a single cube, and =Some of the literals of Q appear in the remainder R > Solution to the problem: =If the quotient Q is not a single cube, done; else =Pick a literal l in Q that occurs most frequently in the cubes of F; =Divide F by l to obtain a new divisor D 1 ; F = l D 1 + R 1, where literal l does not appear in R 1. Lemma: partial factored form l D 1 + R 1 is maximally factored if Q is a single cube

19 ENEE 64419 Another Example F=ace+ade+bce+bde+cf+df D=a+b Q=ce+de R=cf+df P=QD+R =(ce+de)(a+b)+(cf+df) =(ce+de)(a+b)+(cf+df) O=e(c+d)(a+b)+(c+d)f Problem: O=e(c+d)(a+b)+(c+d)f O=e(c+d)(a+b)+(c+d)f is not maximally factored because it can be further factored to (c+d)(e(a+b)+f). The problem occurs when Q and R have a common factor. (c+d in this case).

20 ENEE 64420 Solution to the Problem > Make Q cube-free to obtain Q 1 ; > Divide F by Q 1 to obtain a new divisor D 1 ; > If D 1 is cube-free, we get a partial factored form F=Q 1 D 1 +R 1 and recursively factor Q 1,D 1, and R 1 ; > If D 1 is not cube-free, let D 1 =cD 2 and D 3 =Q 1 D 2, we have the partial factoring F=cD 3 +R 1 and can recursively factor D 3 and R 1. Lemma: if Q is not a single cube, F is maximally factored at this level.

21 ENEE 64421 Application: Decomposition > Given an expression F and one of its divisors D, the decomposition associates a new variable, G, with the divisor and reduce F to QG+R, where Q=F/G and R is the remainder in the division. > Decomposition vs. factorization =Divisor is added as a new variable. =The new variable may fan out elsewhere in both regular or complement forms. > Why decomposition: reduce the size of the expression (e.g. to typical library cells).

22 ENEE 64422 Example: Decomposition F=ace+bce+de+g F = Ge+g G=ac+bc+d decomposition SOP form factored form goal: minimize the size of the expression F = ab+ac+bcF = a(b+c)+bc factoring SOP form factored form goal: minimize the number of literals

23 ENEE 64423 Application: Algebraic Resubstitution > Goal: reduce number of literals > Idea: (Reuse) For multi-output function, one output (or its complement) may be a useful divisor in another output. > Procedure: substitution of F j into F i =Divide F i by F j : F i = QF j + R =Divide R by F’ j : R = Q C F’ j +R C =Result: F i = QF j + Q C F’ j +R C fifififi fjfjfjfj fjfjfjfj > In practice : this is tried for each output pair, therefore requires O(n 2 ) divisions when there are n outputs. > Filters: criteria that reduce the number of divisions. For example, don’t try F i /F j if 1) F j contains a literal not in F i, or 2) F j has more terms than F i, or 3) there is a literal occurs more often in F j than in F i.

24 ENEE 64424 Example: Algebraic Resubstitution > F/G: =F/ab’ = d+fg =F/c = d+fg F = (d+fg)G + (a’c’e+bc’e+aef) = QG + R > R/G’: =G’ = (ab’+c)’ = (a’+b)c’ = a’c’ + bc’ =R/a’c’ = e =R/bc’ = e R = eG’ + aef F = (d+fg)G + eG’ + aef 9 literals 21 literals saving of 12 literals (#23 on Page 448) Resubstitution of G=ab’+c into F=ab’d+cd+ab’fg+cfg+a’c’e+bc’e+aef

25 ENEE 64425 > Idea: replace a literal (and its complement) in an expression by its algebraic SOP form. > Goal: prepare for a different factorization or decomposition. > Elimination value:F i = Q i G + Q iC G’ + R i =Let n i be the number of times that G or G’ appears in the factored form F i, L G be the number of literals in the factored form for G, then approximately, (n i L G -n i )- literals will be added after the elimination. This value is defined as the elimination value of G. =In practice, don’t eliminate node with large e_value. Application: Node Elimination

26 ENEE 64426 Example: Node Elimination > F = e(af+c’G) + (d+fg)(c+G’) > G = a’+b > e_value G = (n i L G -n i ) = 2x2-2 = 2 elimination of G (and G’)

27 ENEE 64427 Application: Extraction > Idea: identifies common sub-expressions and manipulates the Boolean network. > We can combine decomposition, substitution, and node elimination to provide an effective extraction algorithm: Quick_Extraction =For each node in the network, apply decomposition; =For all profitable pairs, apply algebraic substitution; =Eliminate all single literal functions; =Eliminate all functions with small e_value;

28 ENEE 64428 Example: Extraction Decomposition: O 1 = aY 1 + g Y 1 = bX 1 + e + f X 1 = c + d O 2 = X 2 Z 2 Z 2 = eY 2 + f Y 2 = a + b X 2 = c + d (18 literals) F 1 = abc+abd+ae+af+gF 2 = ace+ade+bce+bde+cf+df (11+16 = 27 literals) Resubstitution: (X 1 = X 2 ) O 1 = aY 1 + g Y 1 = bX 1 + e + f X 1 = c + d O 2 = X 1 Z 2 Z 2 = eY 2 + f Y 2 = a + b (16 literals) Node Elimination: (e_value Y2 =-1) O 1 = aY 1 + g Y 1 = bX 1 + e + f X 1 = c + d O 2 = X 1 Z 2 Z 2 = e(a+b) + f (15 literals)


Download ppt "Multilevel Logic Synthesis -- Algebraic Methods. ENEE 6442 Why Algebraic Methods? > What is our goal? minimization, maximally factored form. > Algebraic."

Similar presentations


Ads by Google