Anda di halaman 1dari 5

Brief Notes related to discussion related to Shannon-Booles expansion

Lecture-15,16 of ee-677 ( Thu-18thSept, Mon-22ndSept 2014)


- Sachin B. Patkar
----------------------------------------------------------------
Recall the well-known typical form of Shannon-Booles expansion of a
Boolean Function. .. ( read Hachtel Somenzis text )
f(x
1
,x
2
,x
3
,..,x
n
) = x
1

.
f(0,x
2
,x
3
,..,x
n
) + x
1
. f(1,x
2
,x
3
,..,x
n
)
More generally, we can expand around any variable, x
i
, rather than just x
1

The reduced / projected functions f(0,
2
,x
3
,..,x
n
) and f(1,x
2
,x
3
,..,x
n
) are
called cofactors of f(x
1
,x
2
,x
3
,..,x
n
) with respect to x
1
and x
1
respectively .
In general, there is a notion of cofactor of a function f(x
1
,x
2
,x
3
,..,x
n
) with
respect to a cube c. Let l(x
i1
), l(x
i2
), l(x
i3
), , l(x
ik
) denote the literals whose
product make up the cube. Then the cofactor of f(x
1
,x
2
,x
3
,..,x
n
) w.r.t cube c
is the function obtained by substituting 0-1 values for variables x
i1
, x
i2
, x
i3
,
, x
ik
, assigned according to the polarity of the literals l(x
i1
), l(x
i2
), l(x
i3
), ,
l(x
ik
) of the cube ( positive / uncomplemented literal means value 1, and
negative / complemented literal means value 0 ).
Example : f( x,y,z ) = xy + yz + xz , and let c=xz, then what is cofactor of
f(x,y,z) with respect to cube xz ? Answer : f
c
(x,y,z) = 1.y + y.0 + 1.0 = y +
0 + 0 = y
Generalization of Shannon-Booles expansion :
f(x
1
,x
2
,x
3
,..,x
n
) =

( read as summation alpha into


f_subscript_alpha ), where the summation is taken over all possible k-
literal cubes over the specified set of k-variables.
For instance
f(x
1
,x
2
,x
3
,..,x
n
) = x
1

.
f(0,x
2
,x
3
,..,x
n
) + x
1
. f(1,x
2
,x
3
,..,x
n
)
is an instance of generalized Shannon-Booles expansion taken over all
cubes of only one-literal in the variable from {x
1
}
f(x
1
,x
2
,x
3
,..,x
n
) = x
1
.

x
2

.
f(0,0,x
3
,..,x
n
) + x
1
. x
2
. f(0,1,x
3
,..,x
n
)
+ x
1 ..
x
2

.
f(1,0,x
3
,..,x
n
) + x
1
. x
2
. f(1,1,x
3
,x
3
,..,x
n
)
is an instance of generalized Shannon-Booles expansion taken over all
cubes of two-literals on distinct variables from {x
1
, x
2
}
Now, we ask ourselves What is a Boolean function ( over a general
Boolean algebra ) ?.
A Boolean function is defined to be a function that can be represented by a
Boolean formula. So then we ask, what is a Boolean formula ?. There is
no catch here ! A Boolean formula is, precisely, what you expect it to be: an
expression that combines Boolean constants and Boolean variables via the
Boolean operators Boolean-AND, Boolean-OR, Boolean-NOT.
In digital logic, one almost always deals with the switching Boolean
algebra, that is the one in which B={0,1}. And you would be able to check
that every one of the functions from the domain {0,1)
n
to the co-domain
{0,1} is indeed a function that can be represented by switching Boolean
expression ( that is, those expressions involving switching Boolean
constants 0,1, and switching Boolean variables, combined using the
Boolean algebra operators, namely. Boolean-AND, Boolean-OR, Boolean-
NOT.
But this does not hold for more general non-switching Boolean algebra,
for instance, a a Boolean algebra with 4 elements (recall example of such
bigger Boolean algebras. ) That is to say, that not every function that maps
an element in B
n
( that is the set of n-tuples over B) to an element of B, is a
function indeed, but not necessarily one that can be represented by a
Boolean formula.
Let me help you develop a concrete example of this. Firstly, let us take a
simple example of a non-switching Boolean algebra. In particular, let B={
emptyset, {a,b}, {a}, {b}}, be the set of these 4 elements ( which are all
possible subsets of {a,b} ). Recall Stones representation theorem for finite
Boolean algebras. Every finite Boolean algebra is isomorphic to the
Boolean algebra over the powerset of a finite set, wherein the set-
intersection, set-union, set-complementation operations play the role of
Boolean-AND, Boolean-OR and Boolean-NOT respectively. To illustrate
with examples:
{a} Boolean-AND {b} = emptyset
{a} Boolean-AND {a,b} = {a}
{a} Boolean-OR {b} = {a,b}
Boolean-NOT ( {a} ) = {b}
Boolean-NOT( emptyset ) = {a,b}

So this is an example of a 4-element Boolean algebra, that is a non-
switching Boolean algebra.
Let x,y,z denote three variables taking any one of the values from the
above 4-element Boolean-algebra ground set.
An example of a Boolean formula involving,the variables x,y z, and the 4
constants of the the above Boolean algebra would be
{a} . x . y + {a,b} . ( x + (y . z) ) + emptyset . ( (x . y) + (z + y ) )
Exercise : evaluate the above for the assignment of boolean values to the
variables, that is given as follows : x={b}, y={a,b}, z=emptyset
Fortunately, I will get to avoid these simple, but messy things in this
course.
But you need not get put off by this. It is certainly useful for perspective and
would have its applications too.
So let me get back to the notion of Boolean functions ( over general
Boolean algebra ).
What is the number of distinct switching boolean functions mapping an n-
tuple of switching-boolean constants to a switching-boolean constant
? Answer : two-raised-to-<pause>-( two-raised-to-n ).
What is the number of distinct Boolean functions mapping an n-tuple of
Boolean-constants of B to a Boolean constant of B ? Succintly put, we are
asking for the number of distinct Boolean functions of n-boolean variables (
here we are referring to general non-switching Boolean algebra ). Is your
guess |B|-raised-to-<pause>-( |B|-raised-to-n) ? That would not be
correct ..
Using laws of Boolean-algebra, we can flatten-out any boolean formula
into a sum of products. You can imagine this process easily. Only minor
generalization is that each product term might have a Boolean constant too
( in case of switching-boolean algebra, the only constants were 0, 1, and
they were implicit in an SOP representation ). For general (non-switching)
Boolean formulae however we would get Boolean-sum of Boolean-products
of Boolean constants and literals in some Boolean variables . In the
extreme sum-of-minterm type form, we would have the representation of
the given Boolean formula as a Boolean-sum of minterms in the n
variables, scaled by some Boolean constants.
A corollary of Shannon-Booles expansion would be that these scale-
factors appearing with minterms are precisely the values of the given
Boolean formula, when evaluated at an assignment of 0-1 values to the
Boolean variables, according to the polarity of literals in the corresponding
minterm.

That is, any n-variable Boolean formula f(x
1
,x
2
, x
3
,..,x
n
) can be expressed
uniquely as follows :



f(x
1
,x
2
,x
3
,..,x
n
) = f(0,0,0,0,0) . x
1
.x
2
.x
3
x
n-1 .
x
n

+ f(0,0,0,,0,1) . x
1
.x
2
.x
3
x
n-1
. x
n

+

f(0,0,0,0,1,0) . x
1
.x
2
.x
3
x
n-1
. x
n

+ f(0,0,0,,0,1,1) . x
1
.x
2
.x
3
x
n-1
.x
n

..
+ f(1,1,1,,1,1,1) . x
1
.x
2
.x
3
x
n-1
.x
n.

Please note that the coefficients which appear in the above, are value of
the function, which could be any of the possible elements of the ground
set underlying the Boolean-algebra, and thus need not just be 0, 1.
Isnt it clear from the above that there are exactly |B|-raised-to-(two-raised-
to-n) different Boolean functions ? Think about it.
Later ( hopefully soon ) I will post some notes related to discussion ( during
lecture-15,16, Thu-18
th
,Mon-22
nd
Sept-2014) on ideas such as the ones
below.
Lemma : Given a cube c and a function f, the following holds : c.f = c.f
c

Lemma : : Given a cube c and and function f, the following holds : if
and only if

is a tautology ( that is f
c
evaluates to 1 for all possible values
of variables ).

Anda mungkin juga menyukai