You are on page 1of 21

Boolean Algebra

Also known as Switching Algebra


Invented by mathematician George Boole in 1849
Used by Claude Shannon at Bell Labs in 1938
To describe digital circuits built from relays

Digital circuit design is based on


Boolean Algebra
Attributes
Postulates
Theorems

These allow minimization and manipulation of logic


gates for optimizing digital circuits
C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

Boolean Algebra Attributes


Binary

AND operation

A1a: X=0 if X=1


A1b: X=1 if X=0

A3a: 00=0
A4a: 11=1
A5a: 01=10=0

Complement
aka invert, NOT
A2a: if X=0, X=1
A2b: if X=1, X=0
X X
0

- The tick mark means


complement, invert, or
NOT
- Other symbol for
complement: X=X

C. E. Stroud

X Y XY
0

- The dot means AND 1 1


- Other symbol for AND:
XY=XY (no symbol)

OR operation

X Y X+Y
0

- The plus + means OR 1

A3b: 1+1=1
A4b: 0+0=0
A5b: 1+0=0+1=1

Boolean Algebra & Switching


Functions (9/07)

Boolean Algebra Postulates


OR operation

Identity Elements
P2a: X+0=X
P2b: X1=X

Commutativity
P3a: X+Y=Y+X
P3b: XY=YX

Complements
P6a: X+X=1
P6b: XX=0
C. E. Stroud

X Y X+0 X+Y Y+X X X+X


0

AND operation
X Y X1 XY

YX

X X

Boolean Algebra & Switching


Functions (9/07)

Boolean Algebra Postulates


Associativity
P4a: (X+Y)+Z=X+(Y+Z)
P4b: (XY)Z=X(YZ)
X Y Z X+Y (X+Y)+Z Y+Z X+(Y+Z)

XY (XY)Z YZ X(YZ)

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

Boolean Algebra Postulates


Distributivity
P5a: X+(YZ) = (X+Y)(X+Z)
P5b: X(Y+Z) = (XY)+(XZ)
X Y Z X+Y X+Z

XY+
X+
(X+Y)
(X+Z) YZ (YZ) XY XZ XZ Y+Z

X
(Y+Z)

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

Boolean Algebra Theorems


Idempotency
T1a: X+X=X
T1b: XX=X

Null elements
T2a: X+1=1
T2b: X0=0

OR AND
X Y X+Y XY X+X XX X+1 X0 X X
0 0

0 1

1 0

1 1

Involution
T3: (X)=X=X
C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

Boolean Algebra Theorems


Absorption (aka covering)

T4a: X+(XY)=X
T4b: X(X+Y)=X
T5a: X+(XY)=X+Y
T5b: X(X+Y)=XY

OR AND
X
X
X+
X+
X Y X+Y XY (XY) (X+Y) X XY (XY) X+Y (X+Y)
0 0

0 1

1 0

1 1

C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

Boolean Algebra Theorems


Absorption (aka combining)
T6a: (XY)+(XY)=X
T6b: (X+Y)(X+Y)=X
OR AND
(XY)+
(X+Y)
X Y X+Y XY Y XY (XY) X+Y (X+Y)
0 0

0 1

1 0

1 1

C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

Boolean Algebra Theorems


Absorption (aka combining)
T7a: (XY)+(XYZ)=(XY)+(XZ)
T7b: (X+Y)(X+Y+Z) = (X+Y)(X+Z)
(XY)+
(XY)+
(X+Y)
X+Y (X+Y)
X Y Z Y XY XYZ (XYZ) XZ (XZ) X+Y +Z (X+Y+Z) X+Z (X+Z)
0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

Boolean Algebra Theorems


DeMorgans theorem (very important!)
T8a: (X+Y)= XY
X+Y = XY

break (or connect) the bar & change the sign

T8b: (XY)= X+Y


XY = X+Y

break (or connect) the bar & change the sign

Generalized DeMorgans theorem:


GT8a: (X1+X2++Xn-1+Xn)= X1X2Xn-1Xn
GT8b: (X1X2Xn-1Xn)= X1+X2++Xn-1+Xn

OR AND
X Y X+Y XY X Y (X+Y) XY (XY) X+Y
0 0

0 1

1 0

1 1

C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

10

Boolean Algebra Theorems


Consensus Theorem
T9a: (XY)+(XZ)+(YZ) = (XY)+(XZ)
T9b: (X+Y)(X+Z)(Y+Z) = (X+Y)(X+Z)
(XY)+
(X+Y)
(XZ)+ (XY)+
(X+Z) (X+Y)
X Y Z X XY XZ YZ (YZ) (XZ) X+Y X+Z Y+Z (Y+Z) (X+Z)
0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

11

More Theorems?
Shannons expansion theorem (also very important!)
T10a: f(X1,X2,,Xn-1,Xn)=
(X1f(0,X2,,Xn-1,Xn))+(X1f(1,X2,,Xn-1,Xn))
Can be taken further:
- f(X1,X2,,Xn-1,Xn)= (X1X2f(0,0,,Xn-1,Xn))
+ (X1X2f(1,0,,Xn-1,Xn)) + (X1X2f(0,1,,Xn-1,Xn))
+(X1X2f(1,1,,Xn-1,Xn))

Can be taken even further:


- f(X1,X2,,Xn-1,Xn)= (X1X2Xn-1Xnf(0,0,,0,0))
+ (X1X2Xn-1Xnf(1,0,,0,0)) +
+ (X1X2Xn-1Xnf(1,1,,1,1))

T10b: f(X1,X2,,Xn-1,Xn)=
(X1+f(0,X2,,Xn-1,Xn))(X1+ f(1,X2,,Xn-1,Xn))
Can be taken further as in the case of T10a

Well see significance of Shannons expansion theorem later


C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

12

Principle of Duality

Any theorem or postulate in Boolean algebra


remains true if:

Operator precedence order:


1)
2)
3)
4)

0 and 1 are swapped, and


and + are swapped
- BUT, be careful about operator precedence!!!
Left-to-right
Complement (NOT)
AND
OR

Use parentheses liberally to ensure correct Boolean


logic equation
C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

13

Postulates w/ Precedence & Duality


P.
2
3
4
5
6

C. E. Stroud

a. expression
a+0=a
a+b=b+a
(a+b)+c=a+(b+c)
a+(bc) = (a+b)(a+c)
a+a=1

b. dual
a1=a
ab=ba
(ab)c=a(bc)
a(b+c) = (ab)+(ac)
aa=0

Boolean Algebra & Switching


Functions (9/07)

14

Theorems w/ Precedence & Duality


Th.
1
2
3
4
5
6
7
8
9
10

a. expression
a+a=a
a+1=1
a=a
a+ab=a
a+ab=a+b
ab+ab=a
ab+abc=ab+ac
(a+b)=ab
ab+ac+bc=ab+ac

b. dual
aa=a
a0=0
a(a+b)=a
a(a+b)=ab
(a+b)(a+b)=a
(a+b)(a+b+c)=(a+b)(a+c)
(ab)=a+b
(a+b)(a+c)(b+c)= (a+b)(a+c)

f(X)=x1f(0,,xn)+x1f(1, ,xn) f(X)=(x1+f(0,,xn))(x1+ f(1, ,xn))

C. E. Stroud

Boolean Algebra & Switching


Functions (9/07)

15

Switching Functions
For n variables, there are 2n possible
combinations of values
From all 0s to all 1s

There are 2 possible values for the output of a


function of a given combination of values of n
variables
0 and 1
n
2
2

There are
n variables
C. E. Stroud

different switching functions for


Boolean Algebra & Switching
Functions (9/07)

16

Switching Function Examples


n
2
2 =

n=0 (no inputs)

0
2
2

21

=2

Output can be either 0 or 1

n=1 (1 input, A)

n
2
2 =

1
2
2

switch output
function
n=0

= 22 = 4

Output can be 0, 1, A, or A
A

C. E. Stroud

switch output
function
n=1

A f0 f1 f2 f3
0 0 1 0 1
1 0 0 1 1

Boolean Algebra & Switching


Functions (9/07)

f0 = 0
f1 = A
f2 = A
f3 = 1
17

Switching Function Examples


n=2 (2 inputs, A and B)
A
B

AB
switch output
00
function
01
n=2
10
11

n
2
2 =

C. E. Stroud

= 24 = 16

f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15


0 1 0 10 10 1 0 1 0 1 0 1 0 1
0 0 1 10 01 1 0 0 1 1 0 0 1 1
0 0 0 01 11 1 0 0 0 0 1 1 1 1
0 0 0 00 00 0 1 1 1 1 1 1 1 1

f0 = 0
f1 = AB = (A+B)
f2 = AB
f3 = AB+AB = A(B+B) = A
Most frequently used

2
2
2

Less frequently used


Boolean Algebra & Switching
Functions (9/07)

logic 0
NOT-OR or NOR
invert A
Least frequently used
18

Switching Function Examples


n=2 (2 inputs, A and B)

n
2
2 =

2
2
2

= 24 = 16

A B f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15


switch output
00 0 1 0 10 10 1 0 1 0 1 0 1 0 1
function
B
01 0 0 1 10 01 1 0 0 1 1 0 0 1 1
n=2
10 0 0 0 01 11 1 0 0 0 0 1 1 1 1
11 0 0 0 00 00 0 1 1 1 1 1 1 1 1
f4 = AB
invert B
f5 = AB+AB = (A+A)B = B
f6 = AB+AB
exclusive-OR
f7 = AB+AB+AB = A(B+B)+(A+A)B
= A+B = (AB)
NOT-AND or NAND
Most frequently used
C. E. Stroud

Less frequently used


Boolean Algebra & Switching
Functions (9/07)

Least frequently used


19

Switching Function Examples


n=2 (2 inputs, A and B)
A
B

AB
switch output
00
function
01
n=2
10
11

n
2
2 =

2
2
2

= 24 = 16

f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15


0 1 0 10 10 1 0 1 0 1 0 1 0 1
0 0 1 10 01 1 0 0 1 1 0 0 1 1
0 0 0 01 11 1 0 0 0 0 1 1 1 1
0 0 0 00 00 0 1 1 1 1 1 1 1 1

f8 = AB
AND
f9 = AB+AB
exclusive-NOR
f10 = AB+AB = (A+A)B = B
buffer B
f11 = AB+AB+AB = A(B+B)+(A+A)B = A+B
Most frequently used
C. E. Stroud

Less frequently used


Boolean Algebra & Switching
Functions (9/07)

Least frequently used


20

Switching Function Examples


n=2 (2 inputs, A and B)

n
2
2 =

2
2
2

= 24 = 16

A B f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15


switch output
00 0 1 0 10 10 1 0 1 0 1 0 1 0 1
function
B
01 0 0 1 10 01 1 0 0 1 1 0 0 1 1
n=2
10 0 0 0 01 11 1 0 0 0 0 1 1 1 1
11 0 0 0 00 00 0 1 1 1 1 1 1 1 1
f12 = AB+AB = A(B+B) = A
buffer A
f13 = AB+AB+AB = A(B+B)+AB = A+AB = A+B
f14 = AB+AB+AB = A(B+B)+(A+A)B = A+B
OR
f15 = AB+AB+AB+AB = A(B+B)+A(B+B)
= A+A = 1
logic 1
Most frequently used
C. E. Stroud

Less frequently used


Boolean Algebra & Switching
Functions (9/07)

Least frequently used


21

You might also like