Professional Documents
Culture Documents
03 BooleanAlgebra
03 BooleanAlgebra
Boolean Algebra
and Logic Gates
Charles Kime & Thomas Kaminski
© 2008 Pearson Education, Inc.
(Edited by Dr. Muhamed Mudawar for COE 202 & EE 200 at KFUPM)
Binary Logic and Gates
Binary variables take on one of two values.
Logical operators operate on binary values and
binary variables.
Basic logical operators are the logic functions
AND, OR and NOT.
Logic gates implement logic functions.
Boolean Algebra: a useful mathematical system
for specifying and transforming logic functions.
We study Boolean algebra as a foundation for
designing and analyzing digital systems!
Boolean Algebra and Logic Gates 2
Binary Variables
Recall that the two binary values have
different names:
• True/False
• On/Off
• Yes/No
• 1/0
We use 1 and 0 to denote the two values.
Variable identifier examples:
• A, B, y, z, or X1 for now
• RESET, START_IT, or ADD1 later
Boolean Algebra and Logic Gates 3
Logical Operations
The three basic logical operations are:
• AND
• OR
• NOT
AND is denoted by a dot (·).
OR is denoted by a plus (+).
NOT is denoted by an overbar ( ¯ ), a
single quote mark (') after, or (~) before
the variable.
Boolean Algebra and Logic Gates 4
Notation Examples
Examples:
• Y = A B is read “Y is equal to A AND B.”
• z = x + y is read “z is equal to x OR y.”
• X = A is read “X is equal to NOT A.”
Note: The statement:
1 + 1 = 2 (read “one plus one equals two”)
is not the same as
1 + 1 = 1 (read “1 or 1 equals 1”).
AND OR NOT
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
AND OR NOT
X Y Z = X·Y X Y Z = X+Y X Z=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
Boolean Algebra and Logic Gates 7
Truth Tables – Cont’d
Used to evaluate any logic function
Consider F(X, Y, Z) = X Y + Y Z
X Y Z XY Y YZ F=XY+YZ
0 0 0 0 1 0 0
0 0 1 0 1 1 1
0 1 0 0 0 0 0
0 1 1 0 0 0 0
1 0 0 0 1 0 0
1 0 1 0 1 1 1
1 1 0 1 0 0 1
1 1 1 1 0 0 1
Boolean Algebra and Logic Gates 8
Logic Function Implementation
Using Switches Switches in parallel => OR
• Inputs:
logic 1 is switch closed
logic 0 is switch open
• Outputs: Switches in series => AND
logic 1 is light on
logic 0 is light off.
• NOT input: Normally-closed switch => NOT
logic 1 is switch open C
logic 0 is switch closed
Light is on (L = 1) for
L(A, B, C, D) = A (B C + D) = A B C + A D
and off (L = 0), otherwise.
Useful model for relay and CMOS gate circuits,
the foundation of current digital logic circuits
Y 0 1 0 1
(AND) X ·Y 0 0 0 1
(OR) X+ Y 0 1 1 1
(NOT) X 1 1 0 0
Boolean Algebra and Logic Gates 12
Logic Diagrams and Expressions
Truth Table Logic Equation
XYZ F = X + Y Z
000 0 F = X +Y Z
001 1
010 0 Logic Diagram
011 0 X
100 1
Y F
101 1
110 1 Z
111 1
Boolean equations, truth tables and logic diagrams describe
the same function!
Truth tables are unique, but expressions and logic diagrams
are not. This gives flexibility in implementing functions.
Boolean Algebra and Logic Gates 13
Gate Delay
In actual physical gates, if an input changes that
causes the output to change, the output change
does not occur instantaneously.
The delay between an input change and the
output change is the gate delay denoted by tG:
1
Input
0
tG tG tG = 0.3 ns
1
Output
0
0 0.5 1 1.5 Time (ns)
Boolean Algebra and Logic Gates 14
Boolean Algebra
Invented by George Boole in 1854
An algebraic structure defined by a set B = {0, 1}, together with two
binary operators (+ and ·) and a unary operator ( )
X+Y=X·Y X·Y=X+Y
X Y X·Y X+Y X Y X+Y X · Y X·Y X+Y
0 0 0 0 1 1 1 1 1 1
0 1 0 1 1 0 0 0 1 1
1 0 0 1 0 1 0 0 1 1
1 1 1 1 0 0 0 0 0 0
Generalized DeMorgan’s Theorem:
X1 + X2 + … + Xn = X1 · X2 · … · Xn
X1 · X2 · … · Xn = X1 + X2 + … + Xn
Boolean Algebra and Logic Gates 22
Complementing Functions
Use DeMorgan's Theorem:
1. Interchange AND and OR operators
2. Complement each constant and literal
Example: Complement F = xy z + x y z
F = (x + y + z)(x + y + z)
Example: Complement G = (a + bc)d + e
G = (a (b + c) + d) e
Boolean Algebra and Logic Gates 23
Expression Simplification
An application of Boolean algebra
Simplify to contain the smallest number
of literals (variables that may or may not
be complemented)
A B + ACD + A BD + AC D + A BCD
= AB + ABCD + A C D + A C D + A B D
= AB + AB(CD) + A C (D + D) + A B D
= AB + A C + A B D = B(A + AD) +AC
= B (A + D) + A C (has only 5 literals)
Boolean Algebra and Logic Gates 24
Next … Canonical Forms
Minterms and Maxterms
F = m1 + m6 + m7 = ∑ (1, 6, 7) = x y z + x y z + x y z
Boolean Algebra and Logic Gates 32
Sum-Of-Minterm Examples
F(a, b, c, d) = ∑(2, 3, 6, 10, 11)
F(a, b, c, d) = m2 + m3 + m6 + m10 + m11
abcd+abcd+abcd+abcd+abcd
G(a, b, c, d) = ∑(0, 1, 12, 15)
G(a, b, c, d) = m0 + m1 + m12 + m15
abcd+abcd+abcd+abcd
F = m1+m2+m3+m5+m7 = ∑(1, 2, 3, 5, 7) =
xyz+xyz+xyz+xyz+xyz
F = M0 · M4 · M6 = ∏(0, 4, 6) =
(x+y+z)(x+y+z)(x+y+z) Boolean Algebra and Logic Gates 39
Algebraic Conversion to Sum-of-Minterms