EE221 Lecture 2 - 1
EE221 Lecture 2 - 1
EE-221
Chapter 2:
Boolean Algebra and Logic Gates
1
Boolean Algebra : Basics
• Algebra: Mathematics of generalized arithmetical operations - Reunion of broken
parts
– Study of mathematical symbols and the rules for manipulating these symbols
in formulas; it is a unifying thread of almost all of mathematics.
– Elementary, Linear algebra
• Boolean algebra : The values of the variables are the truth values true and false,
usually denoted 1 and 0, respectively.
– Instead of elementary algebra, where the values of the variables are numbers and
the prime operations are addition and multiplication, the main operations of
Boolean algebra are the conjunction (and) denoted as ∧, the disjunction (or)
denoted as ∨, and the negation (not) denoted as ¬.
– A formalism for describing logical operations, in the same way that elementary
algebra describes numerical operations.
– A convenient and systematic way of expressing and analyzing the operations of
digital logic circuits
WHY Boolean Algebra with Binary Logic?
• Binary Logic is used in all digital devices:
4. Identity Element. A set S is said to have an identity element w.r.t a binary operation
“*” on set S if there exists an element, e ϵ S with the property:
» e * x = x * e = x for every x ϵ S
• Additive “+” identity is “0” and multiplicative “.” identity is “1”
Basic Postulates
5. Inverse. A set S having the identity element “e” w.r.t a binary operator “*”
is said to have an inverse whenever, for every x ϵ S, there exists an element
y ϵ S such that
» x*y=e
• The additive inverse of element “a” is “–a” and it defines subtraction, since
a + (–a) = 0. Multiplicative inverse of “a” is “1/a” and defines division,
since a . 1/a = 1
6. Distributive Law. If “*” and “.” are two binary operators on a set S, “*” is
said to be distributive over “.” when
» x * ( y · z) = (x * y) · (x * z)
• Huntington postulates include the identity law, the complement law, the
commutative law and the distributive law. The theorems of boolean algebra
can be proved using these postulates. Each postulate and theorem of boolean
algebra has two parts; one is dual of another.
• Show that Huntington Postulates are valid for the set B= {1,0} and the two
operators “+” “.”:
1. Closure
a) with respect to the binary operation OR (+)
b) with respect to the binary operation AND (·)
2. Identity
a) with respect to OR (+) is 0:
x + 0 = 0 + x = x, for x = 1 or x = 0
b) with respect to AND (·) is 1:
x · 1 = 1 · x = x, for x = 1 or x =0
Two-valued Boolean Algebra and Huntington Postulates
3. Commutative Law
a) With respect to OR (+):
x + y = y + x
b) With respect to AND (·):
x · y = y · x
4. Distributive Law
a) with respect to the binary operation AND (.):
x . (y + z) = (x . y) + (x . z) “.” is distributive over “+”
b) with respect to the binary operation OR (+):
x + (y . z) = (x + y) . (x + z) “+” is distributive over “.”
5. Complement
a) x + x’ = 1, for x = 1 or x = 0
b) x · x’ = 0 , for x = 1 or x = 0
6. Membership
There exists at least two elements, x and y, of the set such that x ≠ y
0 ≠ 1
Two-valued Boolean Algebra
• Boolean Algebra with two elements “0” and “1”
• “Two-value Boolean Algebra” which is defined by:
– set of two elements B = {0, 1}
– operators of “·” and “+”
– Can be used for Gate type circuits
• Operator Tables
x y x.y x y x+y x x’
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
• Rules are exactly the same as the three operations
• AND “.”
• OR “+”
• NOT (‘) complement
Proving the Distributive Law 4(a)
4. Distributive Law
a) with respect to the binary operation AND (.):
x . (y + z) = (x . y) + (x . z) “.” is distributive over “+”
b) with respect to the binary operation OR (+):
x + (y . z) = (x + y) . (x + z) “+” is distributive over “.”
Proving the Distributive Law 4(b)
x y z y.z x+(y.z) x+y x+z (x+y).(x+z)
0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1
1 1 1 1 1 1 1 1
4. Distributive Law
a) with respect to the binary operation AND (.):
x . (y + z) = (x . y) + (x . z) “.” is distributive over “+”
b) with respect to the binary operation OR (+):
x + (y . z) = (x + y) . (x + z) “+” is distributive over “.”
Two-valued Boolean Algebra Established
• Based on these postulates now we can develop the Theorems and properties of
Two-valued Boolean Algebra
• Duality
– The duality principle states that every algebraic expression deducible from
the postulates of Boolean algebra remains valid if the operators and identity
elements are interchanged
– If the dual of an algebraic equation is required, we interchange the OR and
AND operators and replace 1’s by 0’s and 0’s by 1’s
Postulates and Basic Theorems of Boolean Algebra
– Postulates are the basic axioms of the algebraic structure and need no proof
– Theorems must be proved from the postulates or other theorems
P2 x+0 =x x1=x
P5 x+x‘ = 1 x x‘ = 0
T1 x+x=x xx=x
T2 x+1=1 x0=0
T3 involution (x‘)’ = x
P3 commutative x+y = y+x xy = yx
T4 associative x+(y+z)=(x+y)+z x(yz) =(xy)z
P4 distributive x(y+z)=xy+xz x+yz=(x+y)(x+z)
T5 DeMorgan (x+y)‘ =x’y‘ (xy)‘=x’+y‘
T6 absorption x+xy = x x(x+y) =x
Basic Theorems of Boolean Algebra
• The following six theorems can be deduced from the Huntington
postulates:
– Theorem 1(a): x+x=x
– Theorem 1(b): x·x=x
– Theorem 2(a): x+1=1
– Theorem 2(b): x·0=0
– Theorem 3 (involution): (x’)’ = x
– Theorem 4(a) (associative): x + ( y + z) = (x + y) + z
– Theorem 4(b) (associative): x · (y · z) = (x · y) · z
– Theorem 5(a) (DeMorgan): (x + y)’ = (x’ · y’)
– Theorem 5(b) (DeMorgan): (x · y)’ = (x’ + y’)
– Theorem 6(a) (absorption): x+x·y=x
– Theorem 6(b) (absorption): x · (x + y) = x
Proving Theorem 1(a)
x · (x + y) = x P2 x+0 =x x1=x
= (x + 0) · (x + y) by p5 x+x‘ = 1 x x‘ = 0
postulate:2(a) T1 x+x=x xx=x
T2 x+1=1 x0=0
=x+0·y
T3 (x‘)’ = x
4(b)
p3 x+y = y+x xy = yx
=x+y·0 T4 x+(y+z)=(x+y)+z x(yz) =(xy)z
3(b) P4 x(y+z)=xy+xz x+yz=(x+y)(x+z)
=x+0 by theorem: T5 (x+y)‘ =x’y‘ (xy)‘=x’+y‘
2(b) T6 x+xy = x x(x+y) =x
=x by
postulate:2(a)
Proving Theorem by Truth Table
• Boolean Algebra Theorems can be proved by means of Truth Tables
• Specially in case the Algebraic proofs are long we can use truth
tables to verify
• Both sides of the relation are checked to see whether they yield
identical results for all possible combinations of the variables
involved:
Theorem 6(a) & (b)
Theorem 4(a) & (b) (long algebraic proof)
Theorem 5(a) & (b)
Proving Theorem 6(a) by Truth Table
x y x.y x+xy x
0 0 0 0 0
0 1 0 0 0
1 0 0 1 1
1 1 1 1 1
Proving Theorem 6(b) by Truth Table
x y x+y x(x+y) x
0 0 0 0 0
0 1 1 0 0
1 0 1 1 1
1 1 1 1 1
Proving Theorem 4(a) by Truth Table
• (x. y)’ = x’ + y’
– Boolean Algebra can help in simplifying the same expression and thus reducing the complexity of a circuit
by reducing the number of gates in the circuit and the number of inputs to the gates. This significantly
reducing the cost of the digital logic circuits
Gate Implementation (Examples)
A A B C F
B 0 0 0 0
F 0 0 1 0
A 0 1 0 0
C F = AB + AC
0 1 1 0
B 1 0 0 0
C 1 0 1 1
F 1 1 0 1
A
F = A(B + C) 1 1 1 1
Gate Implementation (Examples)
A
A B F
F
0 0 1
B F = A’ B’ 0 1 0
1 0 0
A 1 1 0
F
B
F = (A + B)’
Minimization of Algebraic Expression
• Functions in algebraic form can be
represented in various ways P2 x+0 =x x1=x
– Remember the postulates and theorems p5 x+x‘ = 1 x x‘ = 0
that allows us to represent a function in T1 x+x=x xx=x
various ways T2 x+1=1 x0=0
• We must keep in mind that the algebraic T3 (x‘)’ = x
expression is representative of the gates and p3 x+y = y+x xy = yx
circuitry used in a hardware piece T4 x+(y+z)=(x+y)+z x(yz) =(xy)z
– We want to be able to minimize circuit P4 x(y+z)=xy+xz x+yz=(x+y)(x+z)
T5 (x+y)‘ =x’y‘ (xy)‘=x’+y‘
design to reduce cost, power
consumption, and package count, and to T6 x+xy = x x(x+y) =x
increase speed
• By manipulating a function using the
postulates and theorems, we may be able to
minimize an expression
Non-Minimized F2
F2 = x’y’z+x’yz+xy’
Circuit Boolean
Expression
Truth
Table