You are on page 1of 23

Multilevel Logic Synthesis

-- Introduction

Multilevel Logic Synthesis: Outline


Introduction
What is multilevel logic? Why we need it? Problems and challenges.

Multilevel Logic Synthesis and Minimization


Restructuring Technology Independent Local Optimization

Technology Mapping Delay Analysis and Optimization (*)

ENEE 644

Multilevel Logic vs. Two-Level Logic TwoExample: Let F=ab+ab, define G and H as follows:
if F is true, then G=cd+ad, H=cd+ad+e(f+b), else G=e(f+b), H=(cd+ad)e(f+b).

MultiMulti-Level Implementation:
G=F(cd+ad)+Fe(f+b) H=F(cd+ad+e(f+b))+F(cd+ad)e(f+b)
c d a d f b
ENEE 644 3

4-level 5-level

F F e

Multilevel Logic vs. Two-Level Logic TwoExample: Let F=ab+ab, define G and H as follows:
if F is true, then G=cd+ad, H=cd+ad+e(f+b), else G=e(f+b), H=(cd+ad)e(f+b). G = F(cd+ad)+Fe(f+b) = (ab + ab)(cd + ad) + (ab + ab)(e)(f + b) = abcd + abd + acdb + e(f+b)(a+b)(a +b) = abcd + abd + acdb + (efa + efb + eba)(a+b) = abcd + abd + acdb + efab + efba + eba THIS IS MORE COMPLICATED TO IMPLEMENT

ENEE 644

Multilevel Logic vs. Two-Level Logic TwoTwoTwo-level:


At most two gates between a primary input and a primary output. Real life circuits: PLA. Exact optimization methods: well-developed, feasible. wellHeuristics.

MultiMulti-level:
Any number of gates between a primary input and a primary output. Most circuits in real life are multilevel (e.g. standard cells, FPGA). Smaller, less power, and (in many cases) faster. Exact optimization methods: few, high complexity, impractical. Heuristics.

ENEE 644

Optimization Objectives
1. Area: occupied by the logic gates and interconnect, e.g.
measured by one literal = one transistor in technology independent optimization.

2. Delay: measured by the longest path (critical path) through


the logic.

3. Power Consumption
Optimization is performed while simultaneously satisfying upper/lower bound constraints placed on these physical quantities.

ENEE 644

Optimization Cost Criteria

(Figure source: Prof. Braytons lecture notes.)


ENEE 644 7

Technology Independent
A design is technology independent when the formula (function, system) has no connection with the building blocks in the implementation. Advantage: cost can be simply estimated by the number of logic
symbols (I.e. one literal = one transistor), delay is the length of the critical path, better for local optimization.

Example: Full Adder z(x,y,c) = XOR(x,y,c) = xyc+xyc+xyc+xyc cnew(x,y,c) = Majority(x,y,c) = xy+(x+y)c The literal count is 12+5=17 The critical path delay is 3: xpx+yp(x+y)cpcnew xpx+yp(x+y)cp
ENEE 644 8

Technology Dependent
A design is technology dependent if the formula (function, circuit, system) is implemented by one or more logic gates in a pre-designed preset of gates (called technology library or cell library). library). Advantage: gates in the cell library
have a highly optimized, pre-defined prepath to silicon, so that the area and delay parameters are known and accurate.
signal formula gate transi stors

g a b e z d h f j cnew

(xy) g (x+y) (a+b) ec+ec b (dc) h (a+f) j

NAND NOT NOR NOR XOR NOT NAND NOT NOR NOT

4 2 4 4 8 2 4 2 4 2
9

Example: Full Adder


ENEE 644

Multilevel Logic Synthesis Problem


Goal:
Model the multilevel logic Optimize the logic based on the cost criteria

Difficulty:
Multilevel gives more design freedom and increases the design complexity Technology dependent/independent views

Models:
Algebraic forms Boolean networks

Optimization Techniques: HARD


Exact method: few, exponential complexity, impractical Approximation method: heuristic algorithm, rules-based methods rulesENEE 644 10

Sum of Products (SOP)


Example: Advantages:
abc+abd+bd+bef

Easy to manipulate and minimize. Algorithms available (e.g. AND, OR, TAUTOLOGY). TwoTwo-level theory applies.

Disadvantages:
Not representative of logic complexity. For example
f=ad+ae+bd+be+cd+ce f=abc+de which differ in their implementation by an inverter.

Difficult to estimate logic and to estimate progress during logic manipulation.


ENEE 644 11

Factored Forms: Overview


Example: Advantages:
(ad+bc)(c+d(e+ac))+(d+e)fg

Good representative of logic complexity


f=ad+ae+bd+be+cd+ce=(a+b+c)(d+e) f=ad+ae+bd+be+cd+ce=(a+b+c)(d+e) f=abc+de

Good estimator of logic implementation complexity Implicitly Imply Multi-Level Computation (Computation Multiusing tree)

Disadvantages:
Not many algorithms available for manipulation Not canonical: ab+c(a+b)=bc+a(b+c)=ac+b(a+c)
ENEE 644 12

Factored Forms: Definition


A factored form is defined recursively by the rules:
1. A product is either a single literal or a product of factored form. 2. A sum is either a single literal or a sum of factored forms. 3. A factored form is either a product or a sum

Another point of view: Example:


p pl p pf*f s pl s pf+f f pp f ps (1) (base case) (2) (3) (base case) (4) (5) (6)

Factored forms: x, y, abc, ab+c, ((a+b)cd+e)(a+b)+e. However, (a+b)c is not, although it equals abc. This is because internal complement in not allowed
ENEE 644 13

Factoring Tree
Factored forms can be graphically represented as labeled trees, called factoring trees, in which trees, each internal node including the root is labeled with either + or , and each leaf has a label of either a variable or its complement.
+

Example: ((a+b)cd+e)(a+b)+e
+

e b

e a

c d b
14

a
ENEE 644

Equivalent Factorizations
Two factored forms are equivalent if they represent the same logic function.
Example: a(b+c)+bc and ab+c(a+b)

Two factored forms are syntactically equivalent if their factoring tree are isomorphic. (WHAT IS ISOMOSRPHIC?)
Example: (a+b)(c+d)e and a(b+c)+bc and
+

(c+d)e(a+b) ab+c(a+b)
+

a b
+

b c
ENEE 644

c a b c

b
15

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

a b a

ENEE 644

16

Optimum Factored Forms


The size of a factored form f, V(f), is the number of literals in the factored form. Example:
V((a+b)ca) = 4 V((a+b+cd)(a+b)) = 6

A factored form is optimum if no other equivalent factored form has fewer literals. Example:
ab+ac+bc is not optimum (ab+ac+bc = ab+ac).

ENEE 644

17

Unate Factored Forms


A factored form F is positive unate in x, if x appears in F, but x does not. A factored form is negative unate in x, if x appears in F, but x does not. F is unate in either case, and is binate if it is not unate. Example:
(a+b)c+a is (positive) unate in c, (negative) unate in b, and binate in a.

ENEE 644

18

Cofactor of Factored Forms


The cofactor of a factored form F with respect to a literal x (or x ) is the factored form Fx= Fx=1(x) (or Fx=Fx=0(x) ) obtained by: replacing all occurrences of x by 1, and x by 0 simplifying the factored form using the Boolean algebra identities 1y=y 1+y=1 0y=0 0+y=y after constant propagation (all constants are removed), part of the factored form may appear as G + G. In general, G is another factored form, and the G. Gs may have different factored forms.

ENEE 644

19

Cofactor of Factored Forms


The cofactor of a factored form F with respect to a cube c is a factored form obtained by successively cofactoring F with each literal in c. Example:
F = (x+y+z)(xu+zy(v+u)) and c = vz
Fz = (x+y)(xu+y(v+u)) Fz v = (x+y)(xu+y)

ENEE 644

20

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 expression. a Boolean expression.
Example: a+bc is algebraic, a+ab is Boolean. (ab+ac+bc???)

Special Properties of Boolean Algebra:


a+a = aa = a aa a+bc = (a+b)(a+c) a+ab = a

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)=J, supp(f)supp(g)=J denoted by fBg.
Example: a+b B c+d
ENEE 644 21

Algebraic and Boolean Factored Forms


A factored form f is said to be algebraic if the SOP expression obtained by multiplying f out directly (I.e. without using aa=a+a=a, aa=0, a+ab=a) Boolean. is algebraic, otherwise it is Boolean. Example: abg+acg+adf+aef+afg+bd+ce+be+cd
(b+c)(d+e)+((d+e+g)f+(b+c)g)a =(bd+be+cd+ce)+(df+ef+gf+bg+cg)a = bd+ce+be+cd+abg+acg+adf+aef+afg (b+c)(d+e+ag)+(d+e+g)af (af+b+c)(ag+d+e) afag+afd+afe+bag+bd+be+cag+cd+ce =afag+afd+afe+bag+bd+be+cag+cd+ce =afg+adf+aef+abg+acg+bd+be+cd+ce afg+adf+aef+abg+acg+bd+be+cd+ce
ENEE 644

(algebraic) (algebraic)

(Boolean)
22

Value of a Factorization
Given an algebraic factorization F=G1G2+R, its +R, factorization value is given by:
fact_val(F,G2) = lits(F)-(lits(G1)+lits(G2)+lits(R)) lits(F)-

where lits(F) and cubes(F) are the number of literals and cubes in SOP form of F respectively, G1,G2, and R are algebraic expressions.
F = ae+af+ag+bce+bcf+bcg+bde+bdf+bdg can be expressed in the form F = (a+b(c+d))(e+f+g), which requires 7 (a+b(c+d))(e+f+g), literals, rather than 24, a save of 17 literals. If G1=(a+bc+bd) and G2=(e+f+g), then R= and fact_val(F,G2) = =(e+f+g), R= 2v3+2v5=16. Where the extra literal saving comes from? 3+2v5=16.
ENEE 644 23

Example: The algebraic expression

You might also like