Boolean Algebra and Logic Gates Chapter 2
Donia Gamal
[email protected]
Agenda
• Binary Division
• Basic Definition of Boolean Algebra
• Basic Theorems and Properties of Boolean Algebra
• Boolean Functions
• Canonical and Standard Forms
• Digital Logic Gates
2
Binary Division
12 > 8
1>8?
?
0 1 6
8 128 48 > 8
-
8 ?
-
48
48
0
3
Binary Division
1 > 110?
00011
110 1011010 > 110?
-
0
10 101 > 110?
-
0
1011 > 110?
101
- 0
1 0 11 10110 > 110?
- 110
-
0 1 0 10
110
10
4
Binary Number Ranges
While n represent number of bits.
5
6
Agenda
• Binary Division
• Basic Definition of Boolean Algebra
• Basic Theorems and Properties of Boolean Algebra
• Boolean Functions
• Canonical and Standard Forms
• Digital Logic Gates
7
Algebra
• What is an algebra?
• Mathematical system consisting of
• Set of elements/variables
• Set of operators
• Set of Axioms (Rules)
• Why is it important?
• Defines rules of “calculations”
8
Algebras
• Example: arithmetic on natural numbers
• Set of elements: X,Y,Z = {1,2,3,4,…}
• Operator: +, –, *
• Axioms: associativity, distributivity, closure, identity
elements, etc.
• Note: operators with two inputs are called binary
• Does not mean they are restricted to binary numbers!
• Operator(s) with one input are called unary
9
Boolean Algebra
• Apply algebra to Logic gates.
• Boolean Algebra is used to analyze and
simplify the digital (logic) circuits.
• It uses only the binary numbers i.e. 0 and 1.
• It is also called Binary Algebra or logical
Algebra.
• Boolean algebra was invented by George
Boole in 1854.
George Boole (1815 - 1864)
10
Boolean Algebra
AND . ^
• Set of Operations OR + ⋁
NOT ` X’
• Set of Variables Any number of Variables can be used in Boolean
algebra and have only two values.
Binary 1 for HIGH and Binary 0 for LOW
• Set of Axioms associativity, distributivity, closure, identity
elements, etc.
11
Boolean Algebra
Representations of combinational circuits:
Boolean Expression/Equation
= A.B = A ^ B
12
Boolean Algebra
Representations of combinational circuits:
Boolean Expression/Equation
x y x+y
0 0 0
0 1 1
1 0 1
1 1 1
13
Boolean Algebra
= X`
X X`
0 1
1 0
14
15
Boolean Algebra
• Set of Axioms
16
Axiomatic Definition of Boolean Algebra
17
Axiomatic Definition of Boolean Algebra
18
Axiomatic Definition of Boolean Algebra
19
Boolean Algebra
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 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
20
Absorption Property
• Theorem x + xy = x
x (1 + y) = x . 1 = x
• Theorem x (x + y) = x
x.x + x.y = x + xy = x
By means of a truth table (another way to prove)
x y xy x+xy
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
21
DeMorgan’s Theorem
• Theorem: (x + y)’ = x’y’
• Theorem: (xy)’ = x’ + y’
By means of truth table
x y x’ y’ x+y (x+y)’ x’y’ xy x’+y' (xy)’
0 0 1 1 0 1 1 0 1 1
0 1 1 0 1 0 0 0 1 1
1 0 0 1 1 0 0 0 1 1
1 1 0 0 1 0 0 1 0 0
22
DeMorgan’s Theorem
NAND
NOR
23
Simplification Of The Logic Function
24
Algebraic Manipulation Example
F=
1 1
F= )+x
F=
25
Simplification Example
Another Solution
F=
1 1
F=
F=
1
F=
F=
26
Boolean Functions
The truth table of 23 entries
x y z F1 F2 F3 F4
0 0 0 0 0 0 0
0 0 1 0 1 1 1
0 1 0 0 0 0 0
0 1 1 0 0 1 1
1 0 0 0 1 1 1
1 0 1 0 1 1 1
1 1 0 1 1 0 0
1 1 1 0 1 0 0
Two Boolean expressions may specify the same
function F3 = F4 27
Boolean Functions
• Implementation with logic gates
• F4 is more economical
F3 = x' y' z + x' y z + x y'
F4 = x y' + x' z
28
28
How to Get the
Boolean
Expression from
Truth Table?
29
30
Algebraic Forms Of Representing
Boolean Functions
Also, Called
Canonical Form
31
Algebraic Forms Of Representing
Boolean Functions
Also, Called
Canonical Form
Any Boolean function can be expressed as
A sum of minterms (“sum” meaning the ORing of terms).
A product of maxterms (“product” meaning the ANDing of terms).
Both boolean functions are said to be in Canonical form.
32
SUM OF PRODUCTS (SOP)
33
SUM OF PRODUCTS (SOP)
34
SUM OF PRODUCTS (SOP)
And Term
35
Sum of Minterms
Express F = A+BC' as a sum of minterms.
This can be solved in two ways:
• By Building the truth table: F(A, B, C) = ∑(1, 4, 5, 6, 7)
• Or F = A + B’C = A (B+B') + B’C = AB +AB' + B’C
= AB(C+C') + AB'(C+C') + (A+A')B’C
= ABC + ABC’ + AB’C + AB'C’ + AB’C + A'B’C
F = A'B’C + AB'C’ + AB’C + ABC’ + ABC = m1 + m4 +m5 + m6 + m7
F(A, B, C) = ∑(1, 4, 5, 6, 7)
36
PRODUCT OF SUM (POS)
37
PRODUCT OF SUM (POS)
38
PRODUCT OF SUM (POS)
39
PRODUCT OF SUM (POS)
40
Product of Sum (Maxterms) Also, the
Truth table
will work
Express Product of maxterms:
we can use the distributive law to expand.
F(x,y,z) = x + yz = (x + y)(x + z)
= (x+y+zz')(x+z+yy’)
= (x+y+z)(x+y+z')(x+y’+z)(x+y+z)
= (x+y+z)(x+y+z')(x+y’+z)
41
Product of Maxterms
Example: Express F = xy + x'z as a product of maxterms.
F = xy + x'z = (xy + x')(xy +z)
= (x+x')(y+x')(x+z)(y+z)
= (x'+y)(x+z)(y+z)
x'+y = x' + y + zz’ = x’ + (y+z)(y+z’) =(x'+y+z)(x'+y+z’)
x+z = x + z + yy’ = x + (z+y)(z+y') = (x+z+y)(x+z+y’)
y+z = y+z +xx’ = y + (z+x)(z+x’) = (y+z+x)(y+z+x’)
F = (x'+y+z)(x'+y+z’) (x+z+y)(x+z+y’) (y+z+x)(y+z+x’)
F = (x+y+z)(x+y'+z)(x'+y+z)(x'+y+z') = M0M2M4M5
F(x, y, z) = ∏(0, 2, 4, 5)
42
Index
0
1
2
3
4
5
6
7
43
POS VS. SOP
44
Minterms and Maxterms
Each maxterm is the complement of its corresponding minterm, and vice
versa.
45
Minterms and Maxterms
An Boolean function can be expressed by
• A truth table
• Sum of minterms
• f1 = x'y'z + xy'z' + xyz = m1 + m4 +m7 (Minterms)
• f2 = x'yz+ xy'z + xyz'+xyz = m3 + m5 +m6 + m7 (Minterms)
46
Minterms and Maxterms Conversion
The complement of a Boolean function
f1 = x'y'z + xy'z' + xyz = m1 + m4 +m7 (Minterms)
f1' = m0 + m2 +m3 + m5 + m6
= x'y'z'+ x'yz'+ x'yz + xy'z + xyz' 1
(f1')' = f1 = (x+y+z)(x+y'+z)(x+y'+z')(x'+y+z')(x'+y'+z)
= M0 M2 M3 M5 M 6 2
47
Conversion between Canonical Forms
• The complement of a function expressed as the sum of minterms equals the sum
of minterms missing from the original function.
• F(A, B, C) = S(1, 4, 5, 6, 7)
• Thus, F'(A, B, C) = S(0, 2, 3)
• By DeMorgan's theorem
F(A, B, C) = P(0, 2, 3)
F'(A, B, C) =P (1, 4, 5, 6, 7)
• (mj`) ` = Mj
• Interchange the symbols S and P and list those numbers missing from the
original form
• S of 1's
• P of 0's
48
49