ĐẠI HỌC
CÔNG NGHỆ
VIETNAM NATIONAL UNIVERSITY, HANOI
University of Engineering & Technology
Digital Design
Lecture 3: Boolean and Switching Algebra
Xuan-Tu Tran, PhD
Faculty of Electronics and Telecommunication
Smart Integrated Systems (SIS) Laboratory
Email:
www.uet.vnu.edu.vn/~tutx
ĐẠI HỌC
CÔNG NGHỆ
History
Developed by George Boole
in his book (a treatise): “An Investigation of the Laws of Thought”
no application was made of Boolean Algebra until the late 1930s
Nakashima in Japan (1937) and Shannon at MIT (1938), each
independently applied the algebra of Boole to the analysis of networks of
relays (in telephone systems).
10/8/2010
Xuan-Tu Tran
2
ĐẠI HỌC
CÔNG NGHỆ
The Huntington postulates
In 1904, Huntington found that
all of the results and implications of the algebra described by Boole could
be derived from only six basic postulates.
Huntington postulates: The set {B, +, ·, ¯ }
B is the set of elements or constants of the algebra
the symbols + and · are two binary operators(*)
the overbar ¯ is a unary operator(*)
is a Boolean algebra if the following hold true:
(*)
10/8/2010
The terms binary operator and unary operator refer to the number of arguments
involved in the operation: two or one, respectively.
Xuan-Tu Tran
3
ĐẠI HỌC
CÔNG NGHỆ
1.
The Huntington postulates
Closure (khép kín)
For all elements a and b in the set B,
a+b∈B
a·b∈B
2.
Existing 0 and 1 elements
There exists a 0 element in B such that
for every element a in B, 0 + a = a + 0 = a
There exists a 1 element in B such that
for every element a in B, a = a · 1 = a
10/8/2010
Xuan-Tu Tran
4
ĐẠI HỌC
CÔNG NGHỆ
3.
The Huntington postulates
Commutativity (giao hoán)
a+b=b+a
a·b=b·a
4.
Distributivity (phân phối)
a · (b + c) = a · b + a · c
a + (b · c) = (a + b) · (a + c)
10/8/2010
Xuan-Tu Tran
5
The Huntington postulates
ĐẠI HỌC
CÔNG NGHỆ
5.
∀a ∈ B, there exists an element a-bar in the set B such that
a + a =1
a⋅a = 0
6.
There exists at least two distinct elements in B
Switching algebra is a Boolean algebra in which the number of
elements in the set B is precisely 2.
10/8/2010
Xuan-Tu Tran
6
ĐẠI HỌC
CÔNG NGHỆ
Switching Algebra
is a Boolean algebra in which the number of elements in the set B is
precisely 2
The two binary operators, represented by the signs + and ·, are called
the OR and the AND, respectively.
The unary operator, represented by the overbar ¯ , is called the NOT or
the complement operator.
10/8/2010
Xuan-Tu Tran
7
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications
Theorem 1 – idempotence
(i)
a+a = a
(ii)
a⋅a = a
(Định lý hấp thụ)
Proof
a + a = (a + a ) ⋅1
= (a + a ) ⋅ (a + a )
= a + a⋅a
= a+0
=a
10/8/2010
P-2(ii)
P-5(i)
P-4(ii)
P-5(ii)
P-2(i)
Xuan-Tu Tran
a ⋅ a= a ⋅ a + 0
= a⋅a + a⋅a
= a ⋅ (a + a )
= a ⋅1
=a
P-2(i)
P-5(ii)
P-4(i)
P-5(i)
P-2(ii)
8
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications
Theorem 2
(i)
(ii)
Proof
a ⋅0 = 0 + a⋅0
= a⋅a + a ⋅0
= a ⋅ ( a + 0)
= a ⋅ (a )
=0
a ⋅0 = 0⋅a = 0
a +1 = 1+ a = 1
a +1
P-2(i)
P-5(ii)
Principle
of duality
P-4(i)
P-2(ii)
P-5(i)
P-4(ii)
P-2(i)
P-2(ii)
P-5(ii)
P-5(i)
Exercise for students
10/8/2010
Xuan-Tu Tran
9
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications
Theorem 3
Let a be an element of B. Then a-bar is unique.
Proof
Assume that a has 2 distinct
complements (not equal), a-bar and b.
Then by P-5, we must have that:
a +b =1
and
a + a =1
and
a⋅a = 0
and
a ⋅b = 0
10/8/2010
a = a ⋅1
b = b ⋅1
= a ⋅ ( a + b ) = b( a + a )
= a ⋅a + a ⋅b = b⋅a + b⋅a
= 0 + a ⋅b
= 0+b⋅a
= a ⋅b
= a ⋅b
Xuan-Tu Tran
a =b
P-2(ii)
P-4(i)
P-2(i)
10
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications – Basic logic operations
From this point, we will restrict our attention to switching algebras
only.
Switching algebra is basically a two-element Boolean algebra which,
obviously, has the two elements 0 and 1.
AND operation
x
y
z=x·y
0
0
0
Theorem 1(ii)
0
1
0
Theorem 2(i)
1
0
0
Postulate 3(ii)
1
10/8/2010
Symbols
1
1
Theorem 1(ii)
Xuan-Tu Tran
x
y
x
y
z
&
&
z
11
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications – Basic logic operations
Symbols
OR operation
x
y
z=x+y
0
0
0
Derived from which
0
1
1
theorem, postulate?
1
0
1
Exercise for Students
1
1
1
x
y
x
y
≥1
≥1
z
Symbols
NOT operation
10/8/2010
z
x
z = x-bar
Derived from which
0
1
theorem, postulate?
1
0
Exercise for Students
Xuan-Tu Tran
x
x
z
11
z
12
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications – Basic logic operations
NAND operation
Symbols
x
y
z=x·y
0
0
1
0
1
1
1
0
1
1
1
0
x
y
z=x+y
0
0
1
0
1
0
1
0
0
1
1
0
x
y
z
x
y
&
&
z
NOR operation
10/8/2010
Symbols
x
y
x
y
Xuan-Tu Tran
z
≥1
≥1
z
13
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications – Basic logic operations
XOR operation
x
y
z=x⊕y
0
0
0
0
1
1
1
0
1
1
1
Symbols
x
y
x
y
0
z
=1
=1
z
z = x ⊕ y = xy + x y
- Construct XOR gate from NOT, AND, and OR ?
10/8/2010
Xuan-Tu Tran
14
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications – Basic logic operations
NXOR operation
x
y
z=x⊕y
0
0
1
0
1
0
1
0
0
1
1
Symbols
x
y
x
y
1
z
=1
=1
z
z = x ⊕ y = x y + xy
- Construct NXOR gate from NOT, AND, and OR ?
10/8/2010
Xuan-Tu Tran
15
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications
Theorem 4 – Involution
Định lý phủ định của phủ định
(x ) = x
Let x be a switching variable. Then
Proof
10/8/2010
x
x
(x )
0
1
0
1
0
1
Since the left column is identical to the
right column and we have listed all
possibilities, we have proved the result.
Xuan-Tu Tran
16
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications
Theorem 5
(i)
Let x and y be two switching variables. Then
(ii)
x+ x⋅ y = x
x ⋅ (x + y ) = x
Proof
10/8/2010
x
y
x⋅ y
x
+
x⋅ y
0
0
0
0
+
0
0
0
1
0
0
+
0
0
1
0
0
1
+
0
1
1
1
1
1
+
1
1
Xuan-Tu Tran
17
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications
Theorem 6
Let x, y, and z be switching variables. Then
1.
(i)
Associativity (định lý kết hợp)
(ii)
2.
(i)
(ii)
3.
x+x⋅y = x+ y
x ⋅ (x + y ) = x ⋅ y
Consensus (đồng tâm)
(i)
(ii)
10/8/2010
x ⋅ ( y ⋅ z ) = (x ⋅ y ) ⋅ z
x + ( y + z ) = (x + y ) + z
x⋅ y + x ⋅z + y⋅z = x⋅ y + x ⋅z
(x + y ) ⋅ (x + z ) ⋅ ( y + z ) = (x + y ) ⋅ (x + z )
Xuan-Tu Tran
18
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications – De Morgan’s Theorem
De Morgan’s Theorem
Let x and y be two switching variables. Then
(x + y ) = x ⋅ y
(x ⋅ y ) = x + y
Proof
This theorem may easily verified by complete enumeration.
Exercise for Students
10/8/2010
Xuan-Tu Tran
19
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications – De Morgan’s Theorem
Used for the evaluation of complements of switching expressions.
For example,
(x + y ⋅ (z + w ))
= ( x ) ⋅ ( y ⋅ ( z + w ))
(
)
= ( x ) ⋅ (y + ( z ) ⋅ w )
= (x ) ⋅ y + (z + w )
= x ⋅ (y + z ⋅ w )
= x⋅ y + x⋅z⋅w
10/8/2010
Xuan-Tu Tran
20
ĐẠI HỌC
CÔNG NGHỆ
Algebra Implications – De Morgan’s Theorem
Corollary of De Morgan’s Theorem
(x1 + x 2 + L + x n ) = x1 ⋅ x 2 ⋅ L ⋅ x n
(x1 ⋅ x 2 ⋅ L ⋅ x n ) = x1 + x 2 + L + x n
Expand the following function:
((x ⋅ ( y + z ))⋅ ( y + w ⋅ z )⋅ (x + z ))
10/8/2010
Xuan-Tu Tran
21
ĐẠI HỌC
CÔNG NGHỆ
Truth tables
Truth table
a simple way of representing a switching function is to make a list of the
possible variable assignments and note the value the function takes on for
each assignment. This list is called Truth Table.
How to create the Truth Table of a switching function?
For example,
10/8/2010
F ( x , y , z ) = x + yz
Xuan-Tu Tran
22
ĐẠI HỌC
CÔNG NGHỆ
Truth tables
F ( x , y , z ) = x + yz
x
y
z
F (x, y, z)
0
0
0
1
0
0
1
1
0
1
0
1
0
1
1
1
2n assignment
1
0
0
0
possibilities
1
0
1
0
1
1
0
1
1
1
1
0
- Write the Truth Table for the following switching function: F (x, y, z) =
10/8/2010
Xuan-Tu Tran
x⋅ y⋅z + x⋅ y
23
ĐẠI HỌC
CÔNG NGHỆ
Truth tables
Find a switching function from a truth table
10/8/2010
x
y
F (x, y)
0
0
0
0
1
0
1
0
0
1
1
1
Xuan-Tu Tran
F (x, y) ???
24
ĐẠI HỌC
CÔNG NGHỆ
Canonical forms: Minterm - Maxterm
Alternatives to the tabular representation
To list only the assignments for which a function is 1 or,
To list those for which the function is 0
Canonical representation
F = 1 whenever x = 1 and y = 1
F ( x , y ) = xy
10/8/2010
Xuan-Tu Tran
x
y
F (x, y)
0
0
0
0
1
0
1
0
0
1
1
1
25