Logic and Boolean Algebra
Logic and Boolean Algebra
AQ010-3-1 (Version E)
n(n 1)
2
AQ010-3-1-MCFC Logic and Boolean Algebra SLIDE 4
Introduction-Logic
• To understand mathematics, we must understand what makes up a correct
mathematical argument, that is, a proof.
• Once we prove a mathematical statement is true, we call it a theorem.
• It is the basis of the correct mathematical arguments, that is, the proofs.
• Logic defines a formal language for representing knowledge and for making
logical inferences.
• It helps us to understand how to construct a valid argument.
Example 1:
a) “Listen!" is
b) "What time is it?" is
c) "x + 2 = 2 and x + y = z" is
d) Read this carefully
e) "x + 2 = x*2 when x = 2" is a
f) 2 is a prime number. is a
g) She is very talented.
h) How are you?
Example 1:
a) “Listen!" is not a proposition.
b) "What time is it?" is not a proposition.
c) "x + 2 = 2 and x + y = z" is not a proposition.
d) Read this carefully is not a proposition.
e) "x + 2 = x*2 when x = 2" is a proposition.
f) 2 is a prime number. is a proposition.
g) She is very talented. is not a proposition.
h) How are you? is not a proposition.
if…then…. → Implication/conditional
p ﹁ p
T F
F T
3. “2 is a prime number.”
“ 2 is not a prime number”.
p q p q
T T T
T F F
F T F
F F F
• Let p and q be propositions. The proposition "p or q" denoted by p q , is false when
both p and q are false and is true otherwise. The proposition p q is called the
disjunction of p and q.
Truth table
p q pq
T T T
T F T
F T T
F F F
p q p ⊕ q
T T F
T F T
F T T
F F F
• p only if q
(if ~q, then ~p which equivalent to if p then q)
• p is sufficient for q
(in order to get q, it is sufficient to get p) equivalent to
(to get q, (if) get p)
• q is necessary for p
(in order to get p, it is necessary to get q) equivalent to
(get p only if get q) (if not get q, then not get p)
• q whenever p
(whenever get p, get q) equivalent to (if get p then get q)
Express the specification “The automated reply cannot be sent when the file
system is full” using logical connectives.
Example: ¬ p ∧ q means (¬ p) ∧ q
p ∧ q → r means (p ∧ q) → r
F T T T F
T T F F T
T F T F T
T F F F T
Truth table:
OR
AND
p q / + p q / .
0 0 0 NOT
0 0 0
0 1 1 p / ‘
0 1 0
1 0 1 0 1
1 0 0
1 1 1 1 0
1 1 1
Boolean Algebra
Example 14
The OR gate is an electronic circuit that gives a high output (1) if one or
more of its inputs are high. A plus (+) is used to show the OR operation.
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The
outputs of all NOR gates are low if any of the inputs are high. The symbol is an OR
gate with a small circle on the output. The small circle represents inversion.
The 'Exclusive-OR' gate is a circuit which will give a high output if either, but
not both, of its two inputs are high. An encircled plus sign ⊕ is used to show
the EOR operation.
2. A + BC + D’
AB C D
AQ010-3-1-MCFC Logic and Boolean Algebra SLIDE 52
Quick Review Question 6
What is the final output of the given logical circuit?
Identity Name
(x')' = x Involution Law
x + x' = 1 Complementarity Laws
x • x' = 0
x+x=x Idempotent Laws
x•x=x
x+0=x Identity Laws
x•1=x
x+1=1 Dominance Laws
x•0=0
x+y=y+x Commutative Laws
xy = yx
(A + B) (A + B’) (AC’)’
= (A + B) (A + B’) (A’ + C) Involution & DeMorgan’s Law
= A (A’ + C) Idempotent
= AC Redundancy
x y z y’ xy’ xy’+z
0 0 0 1 0 0 The NOT operator
has highest priority,
0 0 1 1 0 1 followed by AND
0 1 0 0 0 0 and then OR.
0 1 1 0 0 1
1 0 0 1 1 1
1 0 1 1 1 1
1 1 0 0 0 0
1 1 1 0 0 1
Quick Review Question 8
Use a truth table to express the values of each of these Boolean function.
SOP POS
the output and the the output and the
0 0 0 0 corresponding corresponding
0 0 1 0 binary value are binary value are
011, 100, 110, and 000, 001, 010, and
0 1 0 0
111. 101.
0 1 1 1 011 A BC 000 A B C
100 AB C 001 A B C
1 0 0 1
110 ABC 010 A B C
1 0 1 0 101 A B C
111 ABC
1 1 0 1
1 1 1 1
• Karnaugh Maps (K-Maps) are a graphical method of visualizing the 0’s and 1’s of a
Boolean function.
• K-Maps are very useful for performing Boolean minimization – SOP expansions.
• Karnaugh maps can be easier to use than Boolean equation minimization once you
get used to it.
• 1 is placed in the square representing a minterm if the minterm is present in the
expansion.
• The goal is to identify the largest blocks of 1s in the map and to cover all the 1s
using the fewest blocks needed, using the largest blocks first.
• Must group 1s in either 1, 2, 4, 8, or 16 and must be adjacent.
Two-variable map
Ex: A’B’ + A’B + AB
Plotting Functions on K-Maps
Two-variable map
Ex: A’B’ + A’B + AB
A A’
B 1 1
0 1
B’
Plotting Functions on K-Maps
On a two-variable map, look
for a pair of 1's that are
either in the same row or
• Two-variable map column. If we find such a
pair, we record the common
Ex: A’B’ + A’B + AB variable.
A A’
B 1 1
0 1
B’
= B + A’
Rule: 1
• A group of four will have one common variable. A pair must have two
common variables.
• In the examples below, the common variable for the left map is C’ and the
common variable for the right group is B.
• In the examples below, the left pair has the common variables BC, while the right pair has
the common variables AB’.
• A solo / single 1 must have all 3 variables.
• Three-variable map
Ex: X’Y’Z’ + X’YZ + XYZ’ + XY’Z + XYZ + X’YZ’
Z
Z’
Plotting Functions on K-Maps
• Three-variable map
Ex: X’Y’Z’ + X’YZ + XYZ’ + XY’Z + XYZ + X’YZ’
Z 1 1 1
Z’ 1 1 1
Plotting Functions on K-Maps
• Three-variable map
Ex: X’Y’Z’ + X’YZ + XYZ’ + XY’Z + XYZ + X’YZ’
Z 1 1 1
Z’ 1 1 1
= Y + XZ + X’Z’
Summary / Recap of Main Points