Sie sind auf Seite 1von 10

Boolean algebra

Boolean algebra, Boolean expressions, Boolean functions


Boolean algebra as an algebraic structure:
Definition: A non-empty set B together with two binary operations denoted by + and . ,
and a unary operation ' is said to be a Boolean algebra if the following axioms are
satisfied:
x, y B

(B1)

For all

xy yx
(a)

(Commutative law of +)

x. y y.x
(b)

(Commutative law of . )

xB
(B2)

There exist elements denoted by 0 and 1 in B such that for all


(a)

x0 x

(0 is identity for + )

x .1 x
(b)
(B3)

(1 is identity for . )

For all x, y and z in B,


x (y.z) (x y).(x z)

(a)

(Distributive law of + over . )


x .(y z) (x . y) (x .z)

(b)

(Distributive law of . over + )

xB
(B4)

For each
, there exists an element denoted by
of x in B such that
(a)

, called the complement

x x' 1

x .x ' 0
(b)

(Complement laws)

( B, , . , ' , 0 , 1 )
We sometimes designate a Boolean algebra by
in order to emphasize its six
parts:
the non-empty set B,
the two binary operations ' + ' and ' . ',
the complement operation '
two special elements 0 and 1 called zero and unit elements respectively.

Boolean algebra

( P(A), , , ' , , A)
Example:

If A is a non-empty set. Then the algebraic structure


a Boolean algebra.

B {0,1}
Example:

Given that

is

.
with the binary operations of + and , and the unary

'
operation defined as below. Show that B is a Boolean algebra.

'
+
1
0

1
1
1

0
1
0

.
1
0
0

1
1
1
0

0
0
0

Boolean algebra

D6 {1, 2,3, 6}
Example:

Let

be the set of all positive divisors of 6. Define the

D6
operations + , . and ' in

by

a b lcm{a, b}

a .b gcd{a, b} a, b D 6

a
a

( D 6 , , . , ' ,1, 6 )
Show that

is a Boolean algebra.

D 4 {1, 2, 4}
Example:

Let

be the set of all positive divisors of 4. Define the operations

D4
+ , . and ' in

by

a b lcm{a, b}

a .b gcd{a, b} a, b D 4

a
a

( D 4 , , . , ' ,1, 4 )
Show that

is not a Boolean algebra.

Principle of duality
The dual of any statement in a Boolean algebra B is the statement obtained by changing
the operation + to . , and . to + ,
the element 0 to 1, and 1 to 0.
Principle of duality: Dual of any theorem in a Boolean algebra is a theorem.
Theorem:

In a Boolean algebra B, the zero element 0 and the unit element 1 are unique.

Theorem:

In a Boolean algebra B, each element in B has a unique complement.

Theorem:

Let B be a Boolean algebra. Then, for any x and y in B, we have


(a)
(b)

xx x

x .x x

x 1 1

x .0 0

(Idempotent laws)
(Boundedness laws)

Boolean algebra

x (x .y) x

x .(x y) x

(c)

(Absorption laws)

0 1

1 0

(d)
(x ) x

(e)

(Involution law)
(x y) x . y

(x . y) x y

(f)
Theorem:

(De Morgan's law)

In a Boolean algebra B, the binary operations + and . are associative i.e.


a (b c) a b) c

(i)

a.(b.c) (a.b).c

(ii)

a, b, c B
, for any

Boolean expressions

x1 , x 2 , K , x n B

(B, , . ,' , 0 ,1)


Let

be a Boolean algebra and

. The Boolean expressions in

x1 , x 2 , K , x n
are defined recursively as:

0,1, x1 , x 2 , K , x n
(i)
(ii)

are all Boolean expressions.


If x and y are Boolean expressions, then
x
(a)
xy
(b)
x. y
(c)
are also Boolean expressions.

x1 , x 2 , K , x n
We denote Boolean expression X in

X(x1 , x 2 , K , x n )
by

Boolean function:

f (x1 , x 2 , K , x n ) X(x1 , x 2 , K , x n )
The function of the form

X(x1 , x 2 , K , x n )
where

is a

x1 , x 2 , K , x n
Boolean expression in

is called a Boolean function.

f :Bn B
In other words, a function

is called a Boolean function.

f (x1 , x 2 ) x1 x 2.

f :{0, 1}2 {0,1}


Example:

The function
function.

defined by

is a Boolean
4

Boolean algebra

f (x1 , x 2 ) x1 x 2.

{0,1}2
The Boolean function on the set
, defined by
a table called input/output table as follows:

Input

, can be represented by

Output

x1

x1

x1 x 2.

0
0
1
1

0
1
0
1

0
1
1
1

Boolean algebra

Example:

Input

Find

Output

f :{0,1}3 {0,1}

x1

x2

x3

f (x1 , x 2 , x 3 )

input/output table:

1
1
1
1
0
0
0
0

1
1
0
0
1
1
0
0

0
1
0
1
0
1
0
1

0
0
1
1
0
0
1
0

Hint:

the Boolean function


given by the

Identify the rows with output 1 for expressing Boolean function in DNF (Sum of Products form)

f (x1 , x 2 , x 3 ) x1.x2 .x3 x1.x 2 .x 3 x1 .x 2 .x 3


Identify the rows with output 0 for expressing Boolean function in CNF (Product of Sums form))

f (x1 , x 2 , x 3 ) (x1 x 2 x 3 ).(x1 x 2 x 3 ).(x1 x 2 x 3 ).(x1 x 2 x 3 ).(x1 x 2 x 3 )


Note that

An AND gate is the Boolean function defined by

f (x1 , x 2 ) x1 .x 2.

An OR gate is the Boolean function defined by

f (x1 , x 2 ) x1 x 2.

x1 , x 2 {0,1}

x1 , x 2 {0,1}

A NOT gate is the Boolean function defined by

f (x) x

x {0,1}

Boolean algebra

A NAND gate is the Boolean function defined by

f (x1 , x 2 ) (x1 .x 2. ) x1 , x 2 {0,1}

A NOR gate is the Boolean function defined by

f (x1 , x 2 ) (x1 x 2. ) x1 , x 2 {0,1}

Boolean algebra

Minterms (Standard Products) and Maxterms (Standard Sums):

x1 , x 2 , K , x n
A minterm in n variables
*
1

*
2

*
3

x .x .x K x
x*i
where each

is a Boolean expression of the form

*
n

x i (i 1, 2,K , n)

xi
is either

or

x1 , x 2 , K , x n
A maxterm in n variables

x x x K x
*
1

*
2

*
3

x*i
where each

is a Boolean expression of the form

*
n

x i (i 1, 2,K , n)

xi
is either

or

Disjunctive Normal form (DNF) of a Boolean expression:

f (x1 , x 2 , x 3 ,K , x n ) m i

Sum of product form

mi

where

is a minterm for each i.

Conjunctive Normal form (CNF) of a Boolean expression:

f (x1 , x 2 , x 3 ,K , x n ) M i

Product of sum form

Mi

where

is a maxterm for each i.

Representation of Boolean expression in Disjunctive Normal Form (DNF):

Simplify the given Boolean expression so that it has minimum number of terms in the
sum

Multiply each term by as many 1's as the number of missing literals

xi x
Replace each 1 in the terms by

x *i
in that term.

*
i

xi
if this 1 corresponds to the missing literal

Now simplify the function by applying laws of Boolean algebra.


The resulting function is in DNF.

Representation of Boolean expression in Conjunctive Normal Form (CNF):

Simplify the given Boolean expression so that it has minimum number of factors.

Add 0 to each factor as many times as the number of missing literals

x *i
in that

factor.
8

Boolean algebra

x i .x *i
Replace each 0 in the terms by

xi
if this 0 corresponds to the missing literal

Now simplify the function by applying laws of Boolean algebra.


The resulting function is in CNF.

f (x1 , x 2 , x 3 ) x1.x 3 x 2 .x 3
Example:

Write the Boolean function

f (x1 , x 2 , x 3 )

in DNF.

x1.x 3 x 2 .x 3

Solution:
x1.x 3 .1 x 2 .x 3.1
x1.x 3 .(x 2 x 2 ) x 2 .x 3.(x1 x1 )
(x1.x 3 .x 2 x1.x 3 .x 2 ) (x 2 .x 3.x1 x 2 .x 3.x1 )
(x1.x 2 .x 3 x1.x 2 .x 3 ) (x1 .x 2 .x 3 x1.x 2 .x 3 )
x1.x 2 .x 3 x1.x 2 .x 3 x1 .x 2 .x 3 x1.x 2 .x 3

f (x1 , x 2 , x 3 ) x1.x 2 x1.x 3 x 2 .x 3


Example:

Write the Boolean function

f (x1 , x 2 , x 3 )

in CNF.

x1.x 2 x1.x 3 x 2 .x 3

Solution:

x1 .x1 x1 .x 2 x1. x 3 x 2 . x 3
x1 .(x1 x 2 ) (x 3 .x1 x 3 .x 2 )
x1 .(x1 x 2 ) x 3 .(x1 x 2 )
(x1 x 2 ). x1 (x1 x 2 ).x 3
(x1 x 2 ).(x1 x 3 )
(x1 x 2 0).(x1 x 3 0)
((x1 x 2 ) x 3 .x 3 ).((x1 x 3 ) x 2 . x 2 )
(x1 x 2 x 3 ).( x1 x 2 x 3 ).(x1 x 3 x 2 ).( x1 x 3 x 2 )
(x1 x 2 x 3 ).( x1 x 2 x 3 ).(x1 x 2 x 3 ).( x1 x 2 x 3 )

Practice Problems
1. Consider the Boolean expressions (x1, x2) = (x1 + x2) and (x1, x2) = x1.x2. Show
that and are equal.
9

Boolean algebra

2. Show that the following two Boolean expressions

X1 (x1.x 2 ) (x1.x 3 )

X 2 x1.(x 2 x 3 )

and
are equivalent over the two element Boolean algebra {0, 1}.
3. Simplify the following Boolean expressions
(a.b) (a.b.c) ( b.c)
(a.b) (a.b.c) (b.c)
(i)
(ii)
(ab)

(B, , . , ' , 0 , 1)

4. Let

be a Boolean algebra with 0 and 1 as identities for the operations

+ and respectively and a, b B prove that


(i)

ab = a implies

(B, , . , ' , 0 , 1)

a.b 0

(ii)

a.b 0

implies a + b = b

5. Let
be a Boolean algebra and x, y, z B. Prove that
1
(x + y)(x + z)(y + z) = xz + yz + x1y;
f x1 , x 2 , x 3 x1 x 2 . x 3
3
6. Let B = {0, 1} and f: B B be the function defined by
.
Find all the functional values of f.

10

Das könnte Ihnen auch gefallen