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

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Factored Forms.
Multilevel Logic Synthesis -- Introduction. ENEE 6442 Multilevel Logic Synthesis: Outline > Introduction =What is multilevel logic? =Why we need it? =Problems.
ECE 667 Synthesis & Verification - Algebraic Division 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Multi-level Minimization Algebraic.
1 Outline Division is central in many operations. –What is it (in the context of Boolean functions)? –What to divide (divisor) with? –How to divide (quotient.
Chapter 3 Simplification of Switching Functions
Penn ESE353 Spring DeHon 1 ESE535: Electronic Design Automation Day 14: March 16, 2009 Multi-level Synthesis.
104 Closure Properties of Regular Languages Regular languages are closed under many set operations. Let L 1 and L 2 be regular languages. (1) L 1  L 2.
ECE Synthesis & Verification - Lecture 9b 1 ECE 697B (667) Fall 2004 ECE 697B (667) Fall 2004 Synthesis and Verification of Digital Systems Boolean.
ECE Synthesis & Verification - Lecture 9 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Multi-level.
ECE Synthesis & Verification - Lecture 14 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems BDD-based.
Logic Synthesis 3 1 Logic Synthesis Part III Maciej Ciesielski Univ. of Massachusetts Amherst, MA.
ECE 667 Synthesis & Verification - Multi-level Optimization 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Multi-level Minimization (Kernel-based)
ECE 667 Synthesis and Verification of Digital Systems
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
ECE 667 Synthesis and Verification of Digital Systems
ECE Synthesis & Verification - Lecture 8 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Multi-level.
1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Based on slides by: Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 9 – Multilevel Optimization.
Chapter 3 Simplification of Switching Functions. Simplification Goals Goal -- minimize the cost of realizing a switching function Cost measures and other.
Department of Computer Engineering
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC. K-Map (1)  Karnaugh Mapping is used to minimize the number of logic gates that are required in a digital circuit.
State university of New York at New Paltz Electrical and Computer Engineering Department Logic Synthesis Optimization Lect19: Multi Level Logic Minimization.
Zvi Kohavi and Niraj K. Jha 1 Multi-level Logic Synthesis.
Copyright © Cengage Learning. All rights reserved. Fundamentals.
1 Multi-Level Logic Synthesis Slides courtesy of Andreas Kuehlmann (Cadence)
Optimization Algorithm
Penn ESE353 Spring DeHon 1 ESE535: Electronic Design Automation Day 22: April 15, 2015 Multi-level Synthesis.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Algebraic Division.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
1 Minterm and Maxterm Expressions Definition: a minterm of n variables is a product of the variables in which each appears exactly once in true or complemented.
Multi-Level Logic Optimization. Multi-Level Logic Synthesis Two Level Logic : –Espresso –Programmable Logic Array (PLA) Multilevel Logic : –Standard Cell.
05 BA2 Page 1 ECEn/CS 224 Boolean Algebra – Part 2.
1 BOOLEAN ALGEBRA Basic mathematics for the study of logic design is Boolean Algebra Basic laws of Boolean Algebra will be implemented as switching devices.
© BYU 03 BA1 Page 1 ECEn 224 Boolean Algebra – Part 1.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Module –I Boolean Algebra Digital Design Amit Kumar Assistant Professor SCSE, Galgotias University, Greater Noida.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
1 3- De-Morgan’s Theorems 1.The complement of a product of variables is equal to the sum of the complements of the variables. 2. The complement of a sum.
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)
Chapter 3 Simplification of Switching Functions. Simplification Goals Goal -- minimize the cost of realizing a switching function Cost measures and other.
State university of New York at New Paltz Electrical and Computer Engineering Department Logic Synthesis Optimization Lect18: Multi Level Logic Minimization.
©2010 Cengage Learning SLIDES FOR CHAPTER 3 BOOLEAN ALGEBRA (continued) Click the mouse to move to the next page. Use the ESC key to exit this chapter.
Logic Synthesis Boolean Division.
ECE 331 – Digital System Design
Lecture 7 Multi-Level Gate Networks
Lecture 3: Incompletely Specified Functions and K Maps
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
Computer Organisation
ECE 667 Synthesis and Verification of Digital Systems
Boolean Expressions Lecture No. 10.
Karnaugh Maps.
Optimized Implementation of Logic Function
Lecture 3: Incompletely Specified Functions and K Maps
Optimized Implementation of Logic Function
BASIC & COMBINATIONAL LOGIC CIRCUIT
ECE 331 – Digital System Design
EECS 465: Digital Systems Lecture Notes # 2
ECE 667 Synthesis and Verification of Digital Systems
Lecture 13 Logistics Last lecture Today HW4 up, due on Wednesday PLDs
Optimization Algorithm
EECS150 - Digital Design Lecture 7 - Boolean Algebra II
Optimized Implementation of Logic Function
Overview Part 2 – Circuit Optimization
VLSI CAD Flow: Logic Synthesis, Placement and Routing Lecture 5
Laws & Rules of Boolean Algebra
ECE 331 – Digital System Design
Presentation transcript:

Multilevel Logic Synthesis -- Algebraic Methods

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.

ENEE 6443 > What is Division? =7 = 2 x =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

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)

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:

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.

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

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.

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

ENEE 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.

ENEE 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

ENEE 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,

ENEE 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

ENEE 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.

ENEE 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

ENEE 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

ENEE 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:

ENEE 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

ENEE 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).

ENEE 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.

ENEE 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).

ENEE 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

ENEE 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.

ENEE 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

ENEE > 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

ENEE 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’)

ENEE 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;

ENEE 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)