Adapted from Dr. Bassam Kahhaleh’ Slides by Prof. Iyad Jafar
Digital Logic
0907231
Chapter 2
Boolean Algebra and
Logic Gates
Outline
2
Introduction
Introduction
4
Logic Signals
5
of binary signals
Example
Binary Logic and Logic Operations
Binary Logic
7
Logic Operators
8
Z = X AND Y 🡺 Z = X • Y 🡺 Z = XY
Z = X • Y
0 = 0 • 0
0 = 0 • 1
0 = 1 • 0
1 = 1 • 1
x | y | z |
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Truth Table
2-input AND Gate
We say that Z is a function of X and Y
Z = F(X,Y)
Logic Operators
9
Z = X OR Y 🡺 Z = X + Y
Z = X + Y
0 = 0 + 0
1 = 0 + 1
1 = 1 + 0
1 = 1 + 1
x | y | z |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Truth Table
2-input OR Gate
We say that Z is a function of X and Y
Z = F(X,Y)
Logic Operators
10
Z = X’
1 = 0
Truth Table
Z = ~X = X’ = X
0 = 1
x | z |
0 | 1 |
1 | 0 |
NOT Gate (Invertor)
We say that Z is a function of X
Z = F(X)
Logic Operations as Switches
that:
11
Switches in series => AND
Switches in parallel => OR
C
Normally-closed switch => NOT
Logic Operators
12
(b) Timing diagram
X
0
0
1
1
Y
0
1
0
1
X
·
Y
(AND)
0
0
0
1
X
+
Y
(OR)
0
1
1
1
(NOT)
X
1
1
0
0
(a) Graphic symbols
OR gate
X
Y
Z
=
X
+
Y
X
Y
Z
=
X
·
Y
AND gate
X
Z
=
X
NOT gate or
inverter
Gate Delay
13
tG
tG
Input
Output
Time (ns)
0
0
1
1
0
0.5
1
1.5
tG = 0.3 ns
Gate Delay
14
0.3 ns
0.3 ns
0.2 ns
0.2 ns
Logic Gates
15
Real Stuff
16
Real Stuff
17
Real Stuff
18
Boolean Algebra
Boolean Algebra
20
Operator Precedence
Parentheses ( . . . ) • ( . . .)
NOT x’
AND x • y
OR x + y
21
1
2
3
4
Logic Expressions/Function
F(w,x,y) = w • x + y’
22
w | x | y |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
F(w,xy) |
|
|
|
|
|
|
|
|
1
0
1
0
1
0
1
1
Logic Expressions/Function
23
F(w,x,y) = w • x + y’
x
y
w
w • x
y’
F(w,x,y)
Example
24
F(A,B,C,D) = A C’ + B’D
D
C
B
F(A,B,C,D)
A
Example
25
F(A,B,C,D) = A C’ + B’D
A | B | C | D |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
0 0 0 0
F(A,B,C,D) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
0
1
0
1
0
0
0
0
1
1
0
1
1
1
0
0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
26
F1(w,x,y) = w’x’ + w
F2(w,x,y) = w+x’
x
w
F1
F2
x
w
w | x | y | F1 |
0 | 0 | 0 | 1 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
w | x | y | F2 |
0 | 0 | 0 | 1 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
??
Logic Expressions/Function
27
Boolean Algebra
Postulates and Theorems
Boolean Algebra
x • 1 = x x + 0 = x
x • 0 = 0 x + 1 = 1
x • x = x x + x = x
x • x’ = 0 x + x’ = 1
29
Boolean Algebra
( x’ )’ = x
x • y = y • x x + y = y + x
x • ( y + z ) = ( x • y ) + ( x • z ) x + ( y • z ) = ( x + y ) • ( x + z )
30
Boolean Algebra
( x • y ) • z = x • ( y • z ) ( x + y ) + z = x + ( y + z )
31
Boolean Algebra
( x • y )’ = x’ + y’ ( x + y )’ = x’ • y’
x • ( x + y ) = x x + x • y = x
32
Proof
|
|
|
|
|
|
|
|
|
|
|
|
Boolean Algebra
x + x’y = x + y x • (x’+y) = x • y
33
Proof
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Boolean Algebra
x y+ x’y = y (x+y) • (x’+y) = y
34
Proof
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
x’ y’ + x’y+ xy’+ xy = 1
35
x | y | |
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
By truth table
By algebra
|
|
|
|
|
|
|
Example
ABC + A’C’+AC’ = AB + C’
36
Proof
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
wy + wy’ + x’z + w’z = w + z
37
Proof
|
|
|
|
|
|
|
Dual and Complement of Logic Functions
Dual of a Function
39
Applied to a valid equation produces a valid equation
Complement of a Function
40
F(w,x,y)
F(w,x,y)
Complement
w | x | y |
0 | 0 | 0 |
0 | 0 | 1 |
0 | 1 | 0 |
0 | 1 | 1 |
1 | 0 | 0 |
1 | 0 | 1 |
1 | 1 | 0 |
1 | 1 | 1 |
F |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
1 |
F’ |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
0 |
Complement of a Function
41
F(w,x,y)
F(w,x,y) = w’ • x’ + w
F(w,x,y)
Complement
F’(w,x,y) = (w’ • x’ + w)’
= (w’ • x’)’ • w’
= (w’’ + x’’ ) • w’
= (w + x ) • w’
= w • w’ + x • w’
= 0 + x • w’
= x • w’
DeMorgan’s Theorem
Duality and Complement
42
Find the Dual of a function
Complement individual literals
Example
43
Example
44
F(A,B,C,D) = A(B’C+A’B) + D
|
|
|
|
|
|
|
|
|
Canonical Forms
Canonical Forms
46
Sum of Minterms (SoM)
47
x | y | F(x,y) |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 0 |
1 | 1 | 1 |
0 • 1
0 • 1
x • y
1 • 1
1 • 1
x • y
+
F(x,y) = x’ • y + x • y
F(x,y) = m1 + m3
F(x,y) = ∑ (1,3)
0
1
2
3
m
m
m
m
Sum of minterms (SOM)
minterm
Product (AND) term that contains all variables
Example
48
A | B | C | F |
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 0 |
0 • 0 • 1
A • B • C
1 • 0 • 0
1 • 1 • 0
1 • 1 • 0
0 • 0 • 1
1 • 0 • 0
+
+
0
1
2
3
4
5
6
7
F(A,B,C) = A’B’C + AB’C’+ABC’
F(A,B,C) = m1 + m4 + m6
F(A,B,C) = ∑ (1,4,6)
A • B • C
A • B • C
m
m
m
m
m
m
m
m
Example
49
F(x,y,z) = ∑ (0,3,5,6)
x | y | z | F |
0 | 0 | 0 | |
0 | 0 | 1 | |
0 | 1 | 0 | |
0 | 1 | 1 | |
1 | 0 | 0 | |
1 | 0 | 1 | |
1 | 1 | 0 | |
1 | 1 | 1 | |
F(x,y,z) = x’y’z’+ x’yz + xy’z + xyz’
|
|
|
|
|
Example
50
F(x,y,z) = ∑ (0,3,5,6)
F(x,y,z) = x’y’z’+ x’yz + xy’z + xyz’
Example
51
A | B | C | F |
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 0 |
F’ |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
|
|
|
|
|
|
|
|
Example
52
A | B | C | D |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
0 0 0 0
F |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
0
0
0
1
0
1
0
0
1
0
0
0
1
0
0
0
F(A,B,C,D) = A’B’CD+A’BC’D+AB’C’D’+ABC’D’
|
|
|
|
|
|
|
Example
53
2, 5, 7
0, 1, 3, 4, 6
Using Algebra to find SOM
F(A,B,C,D) = A(BC + BC’) + A’B’C
54
|
|
|
|
|
|
|
|
Product of Maxterms (PoM)
55
F(x,y) = ∏ (0,2)
x | y | F(x,y) |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 0 |
1 | 1 | 1 |
0 + 0
0 + 0
x + y
1 + 0
•
F(x,y) = (x + y) • (x’ + y)
F(x,y) = M0 • M2
0
1
2
3
M
M
M
M
Product of Maxterms (POM)
maxterm
Sum (OR) term that contains all variables
1 + 0
x + y
Example
56
A | B | C | F |
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
0 + 0 + 0
A + B + C
0 + 1 + 0
1 + 0 + 1
0 + 0 + 0
0 + 1 + 0
•
•
0
1
2
3
4
5
6
7
F(A,B,C) = (A+B+C)(A+B’+C)(A’+B+C’)
F(A,B,C) = M0 • M2 • M5
F(A,B,C) = ∏(0,2,5)
A + B + C
M
M
M
M
M
M
M
M
1 + 0 + 1
A + B + C
Example
57
F(x,y,z) = ∏ (1,7)
x | y | z | F |
0 | 0 | 0 | |
0 | 0 | 1 | |
0 | 1 | 0 | |
0 | 1 | 1 | |
1 | 0 | 0 | |
1 | 0 | 1 | |
1 | 1 | 0 | |
1 | 1 | 1 | |
F(x,y,z) = (x+y+z’)(x’+y’+z’)
|
|
|
|
Example
58
F(x,y,z) = ∏ (1,7)
F(x,y,z) = (x+y+z’)(x’+y’+z’)
Example
59
A | B | C | F |
0 | 0 | 0 | 0 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 0 |
F’ |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
|
|
|
|
|
|
Example
60
A | B | C | D |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
0 0 0 0
F |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
1
0
1
1
0
1
1
0
1
1
1
1
1
1
0
1
|
|
|
|
|
|
F(A,B,C,D) =
(A+B+C+D’)(A+B’+C+D)(A+B’+C’+D’)(A’+B’+C’+D)
Example
61
0,3,5,6,7,8,10,11,14
0,3,5,6,7,8,10,11,14
1,2,4,9,12,13,15
Note
Example
F(A,B,C) = A+BC’
62
|
|
|
|
|
|
|
Relationship between Minterms and Maxterms
63
m3 = A’BC
M3 = A + B’ + C’
mj = (Mj)’
(mj)’ = Mj
Exercise
64
|
|
|
|
|
|
|
Why Learn both SoM and PoM?
65
Standard Forms
Standard Forms
67
Standard Forms
68
Example
69
Example - Write F(A,B,C) into SOP
70
Example – Write F(A,B,C) as PoS
71
Non-standard Forms
Nonstandard Forms
73
Summary of Forms
74
(A+B+C)(A+B+C)
Other Types of Gates
Logic Operators
76
x | y | NAND |
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
x | y | AND |
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Logic Operators
77
x | y | OR |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
x | y | NOR |
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
Logic Operators
78
x | y | XOR |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
x | y | XNOR |
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Logic Operators
79
x | NOT |
0 | 1 |
1 | 0 |
x | Buffer |
0 | 0 |
1 | 1 |
Real Stuff
80
Exercises
Suggested Problems (5th Edition)
82
Exercises
83
Exercises
84
Exercises
85