0% found this document useful (0 votes)
63 views

Vlsi Cad:: Logic To Layout

Uploaded by

Sohini Roy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Vlsi Cad:: Logic To Layout

Uploaded by

Sohini Roy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

VLSI CAD: Lecture 2.

1
Logic to Layout Computational Boolean
Algebra: Basics

Rob A. Rutenbar
University of Illinois
Computational Boolean Algebra…?
•  Background…
•  You’ve done Boolean algebra, hand manipulations, Karnaugh maps to simplify…
•  But this is not sufficient for real designs

•  Example: simplify Boolean function of 40 variables via Kmap


•  It has 1,099,511,627,776 squares
•  You could fit this on an American
style football field...
•  …but each Kmap square would
be just 60 x 60 microns!
•  There must be a better way…

Slide 2 © 2013, R.A. Rutenbar


Need a Computational Approach
•  Need algorithmic, computational strategies for Boolean stuff
•  Need to be able to think of Boolean objects as data structures + operators
•  What will we study?
•  Decomposition strategies
•  Ways of taking apart complex functions into simpler pieces
•  A set of advanced concepts, terms you need to be able to do this
•  Computational strategies
•  Ways to think about Boolean functions that let them be manipulated by programs
•  Interesting applications
•  When you have new tools, there are some useful new things to do

Slide 3 © 2013, R.A. Rutenbar


Advanced Boolean Algebra
•  Useful analogy to calculus...
•  You can represent complex functions like exp(x) using simpler functions
•  If you only get to use 1,x,x2,x3,x4,... as the pieces...
•  ...turns out exp(x) = 1 + x + x2/2! + x3/3! + …
•  In Calculus, we tell you the general formula, the Taylor series expansion

•  f(x) = f(0) + f’(0)/1! x + f’’(0)/2! x2 + f’’’(0)/3! x3 + …


•  If you take more math, you might find out several other ways:
•  If it’s a periodic function, can use a Fourier series

•  Question: Anything like this for Boolean functions?


Slide 4 © 2013, R.A. Rutenbar
Boolean Decompositions
•  Yes. Called the Shannon Expansion

Slide 5 © 2013, R.A. Rutenbar


Shannon Expansion
•  Suppose we have a function F(x1,x2, ..., xn)
•  Define a new function if we set one of the xi=constant
•  Example: F(x1, x2, ..., xi=1, ..., xn)
•  Example: F(x1, x2, ..., xi=0, ..., xn)

•  Easy to do one by hand


F(x,y,z) = xy + xz’ +y(x’z +z’)

F(x=1,y,z) = F(x,y=0,z) =

•  Note: this is a new function, that no longer depends on this


variable (var)
Slide 6 © 2013, R.A. Rutenbar
Shannon Expansion: Cofactors
•  Turns out to be an incredibly useful idea
•  Several alternative names and notations
•  Shannon Cofactor with respect to xi
•  Write F(x1, x2, ..., xi=1, ...xn) as:

•  Write F(x1, x2, ..., xi=0, ...xn) as:

•  Often write this as just F(xi=1) F(xi=0) which is easier to type

•  Why are these useful functions to get from F?

Slide 7 © 2013, R.A. Rutenbar


Shannon Expansion Theorem
•  Why we care: Shannon Expansion Theorem
•  Given any Boolean function F(x1, x2, ..., xn) and pick any xi in F( )’s inputs
F( ) can be represented as
F(x1, x2, …, xi, …..., xn) = xi • F(xi=1) + xi’ • F(xi=0)

•  Pretty easy to prove...

Slide 8 © 2013, R.A. Rutenbar


Shannon Expansion: Another View
a
b
• function

F F

z
same as

function
0 x F mux
0
1 sel
function
1 x F x

Slide 9 © 2013, R.A. Rutenbar


Shannon Expansion: Multiple Variables
•  Can do it on more than one variable, too
•  Just keep on applying the theorem
•  Example F(x,y,z,w) = x • F(x=1) + x ’ • F(x=0) expanded around x

Expand each F(x=1) = y • F(x=1, y=1) + y ’ • F(x=1,y=0)


cofactor
around y F(x=0) = y • F(x=1, y=1) + y ’ • F(x=1,y=0)
F(x,y,z,w) = xy • F(x=1,y=1) + x’y • F(x=0,y=1)
+ xy’ • F(x=1,y=0) + x’y’ • F(x=0,y=0)

= expanded around variables x and y


Slide 10 © 2013, R.A. Rutenbar
Shannon Cofactors: Multiple Variables
•  BTW, there is notation for these as well
•  Shannon Cofactor with respect to xi and xj
•  Write F(x1, x2, ..., xi=1, ..., xj=0, ..., xn) as Fxi xj’ or Fxi xj
•  Ditto for any number of variables xi, xj, xk, ...

•  Notice also that order does not matter: (Fx)y = (Fy)x = Fxy
•  For our example

F(x,y,z,w) = xy • Fxy + x’y • Fx’y + xy’ • Fxy’ + x’y’ • Fx’y’

•  Again, remember: each of the cofactors is a function, not a number

Fxy = F(x=1, y=1, z, w) = a Boolean function of z and w


Slide 11 © 2013, R.A. Rutenbar
VLSI CAD: Lecture 2.2
Logic to Layout Computational Boolean
Algebra: Boolean Difference

Rob A. Rutenbar
University of Illinois
Next Question: Properties of Cofactors

•  What else can you do with cofactors?
•  Suppose you have 2 functions F(X) and G(X), where X=(x1,x2,...xn)
•  Suppose you make a new function H, from F and G, say…
•  H = F
•  H = (F • G) ie, H(X) = F(X) • G(X)
•  H = (F + G) ie, H(X) = F(X) + G(X)

•  H = (F ⊕ G) ie, H(X) = F(X)⊕G(X)

•  Interesting question
•  Can you tell anything about H’s cofactors from those of F, G…?
(F•G)x = what? (F ’)x = what? etc.
Slide 13 © 2013, R.A. Rutenbar
Nice Properties of Cofactors
•  Cofactors of F and G tell you everything you need to know
•  Complements
•  (F’ )x =
•  In English: cofactor of complement is complement of cofactor

•  Binary boolean operators


•  (F • G)x = Fx • Gx cofactor of AND is AND of cofactors
•  (F + G)x = Fx + Gx cofactor of OR is OR of cofactors

•  (F ⊕ G)x = Fx ⊕ Gx cofactor of EXOR is EXOR of cofactor

•  Very useful: can often help in getting cofactors of complex formulas


Slide 14 © 2013, R.A. Rutenbar
Combinations of Cofactors
•  OK, now consider operations on cofactors themselves
•  Suppose we have F(X), and get Fx and Fx’
•  Fx ⊕ Fx = ?

•  Fx • Fx’ = ?
•  Fx + Fx’ =?
•  Turns out these are all useful new functions
•  Indeed – they even have names!

•  Next: let’s go look at these interesting, useful new things


•  First up: the EXOR of the cofactors

Slide 15 © 2013, R.A. Rutenbar


Calculus Revisited: Derivatives
•  Remember way back to how you defined derivatives?
•  Suppose you have y = f(x)
y=f(x)
defined as slope of curve as
a function of point x

Considered f(x + Δ) - f(x) f(x+Δ)


Δ
f(x)

x x+Δ

Let Δ go to 0 in the limit and you got df(x)
Slide 16 dx © 2013, R.A. Rutenbar
Boolean Derivatives
•  So, do Boolean functions have “derivatives”…?
•  Actually, yes. Trick is how to define them...

•  Basic idea
•  For real-valued f(x), df/dx tell how f changes when x changes
•  For 0,1-valued Boolean function, we cannot change x by small delta
•  Can only change 0 ßà 1, but can still ask how f changes with x ...

Boolean f(x): Compares value of f( ) when


x=0 against when x=1 ;
∂f/∂x = ==1 just if these are different

Slide 17 © 2013, R.A. Rutenbar


It’s Got a Name: Boolean Difference
•  Hey, we have seen these pieces before!
•  ∂f/∂x = exor of the Shannon cofactors with respect to x
•  But… for Boolean variables, it’s usually written with the “∂” symbol
•  It also behaves sort of like regular derivatives...
•  Order of variables (vars) does not matter
•  ∂f / ∂x∂y = ∂f / ∂y∂x
•  Derivative of exor is exor of derivatives

•  ∂( f ⊕ g ) / ∂x = ∂f/∂x ⊕ ∂g/∂x
•  If function f is actually constant (f=1 or f=0, always, for all inputs)
•  ∂f/∂x = 0 for any x

Slide 18 © 2013, R.A. Rutenbar


Boolean Difference
•  But some things are just more complex, though...
•  Derivatives of (f •g) and (f + g) do not work the same...

∂ ⎡ ∂g ⎤ ⎡ ∂ f ⎤ ⎡ ∂ f ∂g ⎤
( f • g) = ⎢ f • ⎥ ⊕ ⎢g • ⎥ ⊕ ⎢ • ⎥
∂x ⎣ ∂x ⎦ ⎣ ∂x ⎦ ⎣ ∂x ∂x ⎦
∂ ⎡ ∂g ⎤ ⎡ ∂ f ⎤ ⎡ ∂ f ∂g ⎤
( f + g) = ⎢ f • ⎥ ⊕ ⎢g • ⎥ ⊕ ⎢ • ⎥
∂x ⎣ ∂x ⎦ ⎣ ∂x ⎦ ⎣ ∂x ∂x ⎦
•  Why?
•  Because AND and OR on Boolean values do not always behave like
ADDITION and MULTIPLICATION on real numbers

Slide 19 © 2013, R.A. Rutenbar


Boolean Difference: Gate-level View
•  Try the obvious “simple” examples for ∂f/∂x

x x
f f
y

x x
f y f
y

Meaning: when ∂f/∂x = 1, then f changes if x changes(!)


Slide 20 © 2013, R.A. Rutenbar
Interpreting the Boolean Difference
a
b
c
• A BIG F(a,b,c,....,w, x)
• BLOB OF

LOGIC
w
x
When ∂F / ∂x (a,b,c, ..., w) = 1, it means that ...

If you apply a pattern of other inputs (not X) that makes ∂F / ∂x = 1,


Any change in X will force a change in output F( )

Slide 21 © 2013, R.A. Rutenbar


Boolean Difference: Example
a 1 bit s sum s = a ⊕ b ⊕ cin
b
Cin full add Cout Cout = ab + (a + b)Cin

∂Cout / ∂Cin = ?

Slide 22 © 2013, R.A. Rutenbar


Boolean Difference
•  Things to remember about Boolean Difference
•  Not like the physical interpretation of the ordinary calculus derivative
(ie, no “slope of the curve” sort of stuff)…
•  …but it explains how an input-change can cause output-change for a Boolean F( )

•  ∂f / ∂x is another Boolean function, but it does not depend on x


•  It cannot; it is made out of the cofactors with respect to (“wrt”) x
•  …and they eliminate all the x and x’ terms by setting them to constants

•  Surprisingly useful (we will see more, later…)


Slide 23 © 2013, R.A. Rutenbar
VLSI CAD: Lecture 2.3
Logic to Layout Computational Boolean
Algebra: Quantification
Operators
Rob A. Rutenbar
University of Illinois
Computational Boolean Algebra, Cont…
•  What you know
•  Shannon expansion lets you decompose a Boolean function
•  Combinations of cofactors do interesting things, e.g., the Boolean difference

•  What you don’t know


•  Other combinations of cofactors that do useful things
•  The big ones: Quantification operators (this lecture)
•  Applications: Being able to do something impressive (next lecture)

Slide 25 © 2013, R.A. Rutenbar


AND: Fx • Fx’ is Universal Quantification
•  Have F(x1, x2, …, xi, … xn)
•  AND cofactors: Fxi • Fxi’
•  Name: Universal Quantification of
function F with respect to (wrt) x F(x=0)
variable xi 0
AND
(∀xi F) [x1,x2, …, xi-1, xi+1, … xn]
1 x F(x=1)

•  “(∀xi F)” is a new function


•  Yes, the “∀” sign is the “for all”
symbol from logic (predicate calculus)
•  And, it does not depend on xi…
Slide 26 © 2013, R.A. Rutenbar
OR: Fx + Fx’ is Existential Quantification
•  Have F(x1, x2, …, xi, … xn)
•  OR the cofactors: Fxi +Fxi’
•  Name: Existential Quantification of
function F wrt variable xi 0 x F(x=0)
•  (∃xi F) [x1, x2, …, xi-1, xi+1, … xn] OR

1 x F(x=1)
•  “(∃xi F)” is a new function
•  “∃” sign is “there exists” from logic;
and function also does not depend on xi

Note, like anything involving cofactors, both these new functions do not depend on xi
So: (∀xi F) and (∃xi F) both omit xi
Slide 27 © 2013, R.A. Rutenbar
Quantification Notation Makes Sense…
(∀x F) ( all original vars but x) ==1 when?
0 x F(x=0)

AND

1 x F(x=1)

(∃x F) ( all original vars but x) ==1 when?


0 x F(x=0)

OR

1 x F(x=1)

Slide 28 © 2013, R.A. Rutenbar


Extends to More Variables in Obvious Way
•  Additional properties
•  Like Boolean difference, can do with respect to more than 1 var
•  Suppose we have F(x,y,z,w)
•  Example: (∀xy F)[z,w] = (∀x (∀y F)) = Fxy • Fx’y • Fxy’ • Fx’y’
•  Example: (∃xy F)[z,w] = (∃x (∃y F)) = Fxy + Fx’y + Fxy’ + Fx’y’

•  Remember!
•  (∀x F), (∃x F), and ∂F / ∂x are all functions...
•  ..but they are functions of all the vars except x
•  We got rid of variable x and made 3 new functions
Slide 29 © 2013, R.A. Rutenbar
Quantification Example
•  Consider this circuit, it adds X=0 or X=1 to a 2-bit number A1A0
•  It’s just a 2-bit adder, but instead of B1B0 for the second operand, it is just 0X
•  It produces a carry out called C
and also has a carry in called D A1 0 A0 X

C a1 b1 a0 b0 D
adder
•  What is (∀A1,A0 C)[X,D]…?
•  A function of only X,D. Makes a 1 for values of X,D that make carry C=1 for
all values of operand input A1A0, i.e., makes a carry C=1 for all values of A1A0
•  What is (∃A1,A0 C)[X,D]…?
•  A function of just X,D. Makes a 1 for values of X,D that make carry C=1, for
some value of A1A0, i.e., there exists some A1A0 that, for this X,D makes C=1
Slide 30 © 2013, R.A. Rutenbar
Quantification Example
A1 0 A0 X
Do the math: C = A1A0X + A1(A0+X)D
C a1 b1 a0 b0
adder
D Need all 4 CA1A0 CA1’A0 CA1A0’ CA1’A0’
cofactors:

•  Compute (∀A1,A0 C)[X,D] •  Compute (∃A1,A0 C)[X,D]


•  CA1A0 • CA1’A0 • CA1A0’ • CA1’A0’ •  CA1A0 + CA1’A0 + CA1A0’ + CA1’A0’ BUG fix.
C=1 for
some
values
of A1,A0
•  In words: No values of X,D that •  In words: Yes, if at least one of
make C=1 independent of A1,A0 X,D =1 à C=1 for some A1,A0
Slide 31 © 2013, R.A. Rutenbar
VLSI CAD: Lecture 2.4
Logic to Layout Computational Boolean
Algebra: Application to
Logic Network Repair
Rob A. Rutenbar
University of Illinois
Quantification App: Network Repair
•  Suppose ...
•  I specified a logic block for you to implement... f(a,b) = ab + b’
•  …but you implemented it wrong: in particular, you got ONE gate wrong

Specified Got
b
ab + b’ f(a,b) b ?? g(a,b)
a a
•  Goal
•  Can we deduce how precisely to change this gate to restore correct function?
•  Lets go with this very trivial test case to see how mechanics work...
Slide 33 © 2013, R.A. Rutenbar
Network Repair
•  Clever trick
•  Replace our suspect gate by a
4:1 mux with 4 arbitrary new vars ?? g(a,b)
b
•  By cleverly assigning values to a
d0 d1 d2 d3, we can fake any gate
•  Question is: what are the right values
of d’s so g is repaired (==f) Replace with

b
a s1 s0
d0 00
d1
d2
01 mux G(a,b,d0,d1,d2,d3)
10
d3 11

Slide 34 © 2013, R.A. Rutenbar


Aside: Faking a Gate with a MUX
•  Remember...
•  You can do any function of 2 vars with one 4 input multiplexor (MUX)

y
x s1 s0
0 00
0 01
mux
0 10
1 11

y
x s1 s0
0 00
1 01
mux
1 10
0 11
Slide 35 © 2013, R.A. Rutenbar
Network Repair: Using Quantification
•  Next trick
•  Make new function Z(a,b,d0,d1,d2,d3) that =1 just when G == f

b
a s1 s0
d0 00
d1 01 G(a,b,d0,d1,d2,d3)
d2 mux
10
d3 11
exnor
(==) Z(a,b,d0,d1,d2,d3)

b f(a,b)
a
known good version of logic
Slide 36 © 2013, R.A. Rutenbar
Using Quantification
•  What now?
•  Think hard about exactly what we want:

•  Want to know values for (d0 d1 d2 d3) that,


independent of whatever a, b are, force Z(a,b,d0,d1,d2,d3) = 1

•  But this is something we have seen!


•  Universal quantification of function Z wrt variables a,b!
•  Any pattern of (d0 d1 d2 d3) that makes (∀ab Z)(d0,d1,d2,d3)==1 will do it!
•  (Aside: do you know where a, b went??)
Slide 37 © 2013, R.A. Rutenbar
Network Repair via Quantification: Try It…
d0s1’s0’ + d1s1’s0 + d2s1s0’ + d3s1s0
b
a s1 s0
d0 00

d1 01
mux G(a,b,d0,d1,d2,d3)
d2 10
d3 11

exnor Z(a,b,d0,d1,d2,d3)
(==)

b f(a,b)
a

ab+b’

Slide 38 © 2013, R.A. Rutenbar


Network Repair via Quantification: Continued
G f Reminder:
Q exnor 0 = Q’
Z = [d0a’b + d1b’ + d2ab] ⊕ [ab +b’] = G exnor f
Q exnor 1 = Q
Use nice property: cofactor of exnor is exnor of cofactors!

Za’b’ = Ga’b’ ⊕ fa’b’ à set a=0,b=0 à


Za’b = Ga’b ⊕ fa’b à set a=0,b=1 à
Zab’ = Gab’ ⊕ fab’ à set a=1,b=0 à
Zab = Gab ⊕ fab à set a=1,b=1 à

Slide 39 © 2013, R.A. Rutenbar


Repair via Quantification: Continued
•  So, we got this: (∀ab Z)[d0,d1,d2,d3] = d0’ •d1•d2
•  And know this: if can solve (∀ab Z)[d0,d1,d2,d3]==1 à repaired!

•  Hey – this one is not very hard…

Slide 40 © 2013, R.A. Rutenbar


Network Repair
•  Does it work? What do these d’s represent?

b
d0= 00
a
d0 00
s1 s0
d1= 01 mux
d1
d2
01
10
mux G(a,b,d0,d1,d2,d3)
d2= 10
d3 11
d3= 11
exnor Z(a,b,d0,d1,d2,d3)
(==)

b f(a,b)
a

•  This example is tiny...


•  But in a real example, you have a big network-- 100 inputs, 50,000 gates
•  When it doesn’t work, it’s a major hassle to go thru in detail
•  This is a mechanical procedure to answer: Can we change 1 gate to repair?
Slide 41 © 2013, R.A. Rutenbar
Computational Boolean Alg Strategies
•  What haven’t we seen yet? Computational strategies
•  Example: find inputs to make (∀ab Z)(d0,d1,d2,d3)==1 for gate debug
•  This computation is called Boolean Satisfiability (also called SAT)

•  Ability to do Boolean SAT efficiently is a big goal for us


•  We will see how to do this in later lectures…

Slide 42 © 2013, R.A. Rutenbar


VLSI CAD: Lecture 2.5
Logic to Layout Computational Boolean
Algebra: Recursive
Tautology
Rob A. Rutenbar
University of Illinois
Important Ex Computation: Tautology
•  Let’s build a real computational strategy for a real problem
•  Tautology:
•  I will give you a representation – a data structure -- for a Boolean function f( )
•  You build an algorithm to tell– yes or no – if this function f( ) == 1 for every input

•  You might be thinking: Hey, how hard can that be…??


•  Very, very hard.
•  What happens if I give you a function with 50 variables…?
•  Turns out this is a great example: illustrates all the stuff we need to know...

Slide 44 © 2013, R.A. Rutenbar


Start with: Representation
•  We use a simple, early representation scheme for functions
•  Represent a function as a set of OR’ed product terms (i.e., a sum of products)
•  Simple visual: use a 3-var Boolean cube, with solid circles where f() = 1
•  So: each product term (circle in a Kmap) called a “cube” == 2k corners circled

111
011

001 101

c
b 010 110

a 000 100
Cube is just a “graph”
of a Boolean function,
but only vertices have
Slide 45 values for the function © 2013, R.A. Rutenbar
Positional Cube Notation (PCN)
•  So, we say ‘cube’ and mean ‘product term’
•  So, how to represent each cube? PCN: one slot per variable, 2 bits per slot
•  Write each cube by just noting which variables are true, complemented, or absent
•  In slot for var x: put 01 if product term has ...x... in it
•  In slot for var x: put 10 if product term has ...x’... in it
•  In slot for var x: put 11 if product terms has no x or x’ in it

111
011

001 101

c 010 110
b
a 000 100
Slide 46 © 2013, R.A. Rutenbar
PCN Cube List = Our Representation
•  So, we represent a function as a cover of cubes (circle its 1’s)
•  This is a list of cubes (this is the ‘sum’) in positional cube notation (of products)

•  Ex: f(a,b,c)=a’ +bc +ab => [10 11 11], [11 01 01], [01 01 11]

BUG fix.
[10 11 11] 111
011
First slot is
for a’ 001 101

Other are c
don’t care b 010 110

a 000 100

Slide 47 © 2013, R.A. Rutenbar


Tautology Checking
•  How do we approach tautology as a computation?
•  Input = cube-list representing products in an SOP cover of f
•  Output = yes/no, f ==1 always or not

•  Cofactors to the rescue


•  Great result: f is a tautology if and only if fx and fx’ are both tautologies
•  This makes sense:
•  If function f() = 1 à then cofactors both obviously = 1
•  If both cofactors = 1 à x•F(x=1) + x’•F(x=0) = x•1 + x’•1 = x+x’ = 1

Slide 48 © 2013, R.A. Rutenbar


Recursive Tautology Checking
•  Suggests a recursive computation strategy:
•  If you cannot tell immediately that f==1 ...go try to see if each cofactor == 1 !

f=1?? split on x
(fx =1 AND fx’ =1)??
y/n y/n
fx=1?? fx’=1??
•  What else do we need here?
•  Selection rules: which x is good to pick to split on?
•  Termination rules: how do we know when to quit splitting, so we can
answer ==1 or !=1 for function at this node of tree?
•  Mechanics: how hard is it to actually represent the cofactors?

Slide 49 © 2013, R.A. Rutenbar


VLSI CAD: Lecture 2.6
Logic to Layout Computational Boolean Algebra:
Recursive Tautology—
URP Implementation
Rob A. Rutenbar
University of Illinois
Recursive Tautology Checking
•  So, we think a recursive computation strategy will do it:
•  If you cannot tell immediately that f==1 ...go try to see if each cofactor == 1 !

f=1?? split on x
(fx =1 AND fx’ =1)??
y/n y/n
fx=1?? fx’=1??
•  We need these:
•  Selection rules: which x is good to pick to split on?
•  Termination rules: how do we know when to quit splitting, so we can
answer ==1 or !=1 for function at this node of tree?
•  Mechanics: how hard is it to actually represent the cofactors?

Slide 51 © 2013, R.A. Rutenbar


Recursive Cofactoring
•  Do mechanics first (easy!). For each cube in your list:
•  If you want cofactor wrt var x=1, look at x slot in each cube:
•  [... 10 ...] => just remove this cube from list, since it’s a term with an x’
•  [... 01 ...] => just make this slot 11 == don’t care, strike the x from product term
•  [... 11 ...] => just leave this alone, this term doesn’t have any x in it
•  If you want cofactor wrt var x=0, look at x slot in each cube:
•  [...01 ...] => just remove this cube from list, since it’s a term with an x
•  [...10 ...] => just make this slot 11 == don’t care, strike the x’ from product term
•  [...11 ...] => just leave this alone, this term doesn’t have any x in it

f = abd+bc’ fa fc

[01 01 11 01]
[11 01 10 11]
Slide 52 © 2013, R.A. Rutenbar
Unate Functions
•  Selection / termination, another trick: Unate functions
•  Special class of Boolean functions
•  f is unate if a SOP representation only has each literal in exactly one polarity,
either all true, or all complemented
•  Ex: ab + ac’d + c’de’ is …
•  Ex: xy + x’y + xyz’ + z’ is ...

•  Terminology
•  f is positive unate in var x -- if changing x 0à1 keeps f constant or makes f: 0à1
•  f is negative unate in var x -- if changing x 0à1 keeps f constant or makes f: 1à0
•  Function that is not unate is called binate
Slide 53 © 2013, R.A. Rutenbar
Unate Functions
•  Analogous to monotone continuous functions

y
This function is monotone non-decreasing,
whenever x2 ≥ x1, then f(x2) ≥ f(x1)
x
•  Example: for a Boolean function f positive unate in x

Boolean
function f( ... x ...)
variable x
f

Slide 54 © 2013, R.A. Rutenbar


Can Exploit Unate Func’s For Computation
•  Suppose you have a cube-list for f
•  A cube-list is unate if each var in each cube only appears in one polarity, not both
•  Ex: f(a,b,c)=a +bc +ac à [01 11 11], [11 01 01], [01 11 01] is unate
•  Ex: f(a,b,c)=a +b’c +bc à [01 11 11], [11 10 01], [11 01 01] is not
•  Easier to see if draw vertically

a+b’c+ac UNATE a+b’c+bc NOT

[01 11 11] [01 11 11]


[11 10 01] [11 10 01]
[01 11 01] [11 01 01]
a
b b , b’
Slide 55 c © 2013, R.A. Rutenbar
Using Unate Functions in Tautology Checking
•  Beautiful result
•  It is very easy to check a unate cube-list for tautology
•  Unate cube-list for f is tautology iff it contains all don’t care cube = [11 ... 11]

•  Reminder: what exactly is [11 11 11 ... 11] as a product term?


[01 01 01] = abc [01 01 11] = ab [01 11 11] = a [11 11 11] =
cd
ab 00 01 11 10
•  This result actually makes sense... 00
•  Cannot make a “1” with only product terms 01
where all literals are in just one polarity. (Try it!) 11
10
Slide 56 © 2013, R.A. Rutenbar
So, Unateness Gives Us Termination Rules
•  We can look for tautology directly, if we have a unate cube-list
•  If match rule, know immediately if ==1, or not
•  Rule 1: ==1 if cube-list has all don’t care cube [11 11 ... 11]
Why: function at this leaf is (stuff + 1 + stuff) == 1
•  Rule 2: !=1 if cube-list unate and all don’t care cube missing
Why: unate ==1 if and only if has [11 11 ... 11] cube

f==1? f==1?

split split
fx=1?? fx=1??
... ==1 YES 01 11 10 ==1 NO
11 11 ... 11 Rule 1 11 01 10 Rule 2 - It’s unate but
... 01 01 10 all don’t care
cube is not here
Slide 57 © 2013, R.A. Rutenbar
Recursive Tautology Checking
•  Lots more possible rules...
•  Rule 3: ==1 if cube list has single var cube that appears in both polarities
Why: function at this leaf is (stuff + x + x’ + stuff) == 1

•  You get the idea...


f==1?

fx=1?? split

01 11 11 ==1 YES
10 11 11 Rule 3 -
11 11 10 = ... + x + x’ + ...

Slide 58 © 2013, R.A. Rutenbar


Recursive Tautology Checking
•  But can’t use easy termination rules unless unate cubelist
•  Selection rule...? Pick splitting var to make unate cofactors!
•  Strategy: pick “most not-unate” (binate) var as split var
•  Pick binate var with most product terms dependent on it (Why? Simplify more cubes)
•  If a tie, pick var with minimum | true var - complement var | (L-R subtree balance)
x y z w
A 01 01 01 01 (If no binate variables? Pick a unate
B 10 11 01 01 variable that appears in most cubes)
C 10 11 11 10
D 01 01 11 01
binate, in 4 cubes, | true - compl | = 3-1 = 2
unate
unate
binate, in 4 cubes, | true - compl | = 2-2 = 0
Slide 59 © 2013, R.A. Rutenbar
Recursive Tautology Checking: Done!
•  Algorithm tautology(f represented as cubelist) {
/* check if we can terminate recursion */
if (f is unate) {
apply unate tautology termination rules directly
if (==1) return (1)
else return (0)
}
else if (any other termination rules, like rule 3, work?) {
return the appropriate value if ==1 or ==0
}
else { /* can’t tell from this -- find splitting variable */
x = most-not-unate variable in f
return ( tautology( fx ) && tautology( fx’ ) )
}
Slide 60 } © 2013, R.A. Rutenbar
Recursive Tautology Checking: Example
•  Tautology example: f = ab + ac + ab’c’ + a’
Dear Courserians: a b c
ab 01 01 11 All vars are binate, var a
Small bug fix to “c’ ” ac 01 11 01 affects most implicants, so
label on the side ab’c’ 01 10 10 split on a...
a’ 10 11 11
fa fa’

Same bug fix to “c’ ” 0b [ ]


label for this cube 0c [ ]
b 11 01 11 0b’c’ [ ]
c 11 11 01 0’=1 [11 11 11]
b’c’ 11 10 10
= tautology YES
Same bug fix:
it’s “c’ ” not “c “
Slide 61 © 2013, R.A. Rutenbar
Recursive Tautology Checking: Example
b 11 01 11
No unate vars yet, no simplifications.
c 11 11 01
Let’s split again, now on b.
b’c’ 11 10 10
fab fab’

‘1’ 11 11 11 c 11 11 01
c 11 11 01 c’ 11 11 10

f
•  So we are done:
fa fa’ ==1
•  Our tree has tautologies at all leaves!
•  Note -- if any leaf !=1, then f != 1 too,
this is how tautology fails fab ==1 fab’ ==1
Slide 62 © 2013, R.A. Rutenbar
Computational Boolean Algebra
•  Computational philosophy revisited
•  Strategy is so general and useful it has a name: Unate Recursive Paradigm
•  Abbreviated usually as “URP”

•  Summary
•  Cofactors and functions of cofactors are important and useful
•  Boolean difference, quantifications; real applications like network repair
•  Representations (data structures) for Boolean functions are critical
•  Truth tables, Kmaps, equations cannot be manipulated by software

•  Saw one real representation: Cube-list, positional cube notation


Slide 63 © 2013, R.A. Rutenbar

You might also like