Boolean Algebra
Boolean Algebra
CD 10 1 1 1 1
Rules and laws of Boolean simplification
• We will be going through the five
De Morgan's rules that the exam board wants you
law to know about, shown in red.
Double
negation
General rules of Boolean simplification: AND rules
• These general rules are all quite
With AND, both terms have to be 1/TRUE basic and can be applied easily
AND without having to use more
for the result to be 1/TRUE.
advanced simplification techniques.
XɅ1=
X AND 1 is the same as X
X
2
Or to put it another way… X AND TRUE has to equal the value of X
XɅX=
X AND X is the same as X
X
3
Or to put it another way… X AND X has to equal the value of X
X Ʌ ¬X =
X AND not X is the same as 0
0
4
General rules of Boolean simplification: OR rules
• These general rules are all quite
With OR, only one terms gas to be 1/TRUE basic and can be applied easily
OR without having to use more
for the result to be 1/TRUE.
advanced simplification techniques.
10 • XɅ0=0
• Don’t forget, X is just a placeholder –
X it could be any variable. Also, the
Variations that match this rule: variables could be swapped, and this
0 • YɅ0=0 rule would still work.
• AɅ0=0
• 0ɅX=0
0
• 0ɅE=0
• etc…
Understanding the general rules
• Consider the rule: X Ʌ 1 = X
With AND, both terms have to be 1/TRUE
AND • Once again, this is an AND rule, so
for the result to be 1/TRUE.
both inputs need to be TRUE/1 for
the output to be TRUE/1.
Absorption Commutation
Double
negation
De Morgan's law
• De Morgan's law is a way of
simplifying Boolean expressions by
inverting all the variables, changing
ANDs to ORs and vice versa, and
then inverting the whole expression.
A B A∨B ¬(A ∧ B) ¬A ∧ ¬B ¬B ¬A
0 0 1
0 1 1
1 0 0
1 1 0
De Morgan's law
• There are two versions of this law.
¬(A ∧ B) ≡ ¬A V ¬B • De Morgan’s first law:
NOT(A AND B) is the same as (NOT A) OR (NOT B) NOT (A AND B)
is the same as (≡)
(NOT A) OR (NOT B)
A • If we draw the logic diagrams and
R associated truth tables for these
A
R X X Boolean expressions, we can prove
B S that the same set of inputs, A and B,
B results in the same output, X.
A B A∨B ¬(A ∨ B) ¬A ∧ ¬B ¬B ¬A
0 0 0 1 1 1 1
0 1 1 0 0 0 1
1 0 1 0 0 1 0
1 1 1 0 0 0 0
De Morgan's law
• There are two versions of this law.
¬(A V B) ≡ ¬A ∧ • De Morgan’s first law:
¬B
NOT(A OR B) is the same as (NOT A) AND (NOT B) NOT (A AND B)
is the same as (≡)
(NOT A) OR (NOT B)
A • De Morgan’s second law:
R NOT (A OR B)
A
R X X is the same as (≡)
B S (NOT A) AND (NOT B)
B
• Again, the logic diagrams and truth
tables prove that these expressions
are logically equivalent.
A B A∧B ¬(A ∧ B) ¬A ∨ ¬B ¬B ¬A
0 0 1
0 1 1
1 0 0
1 1 0
De Morgan's law
• There are two versions of this law.
¬(A V B) ≡ ¬A ∧ • De Morgan’s first law:
¬B
NOT(A OR B) is the same as (NOT A) AND (NOT B) NOT (A AND B)
is the same as (≡)
(NOT A) OR (NOT B)
A • De Morgan’s second law:
R NOT (A OR B)
A
R X X is the same as (≡)
B S (NOT A) AND (NOT B)
B
• Again, the logic diagrams and truth
tables prove that these expressions
are logically equivalent.
A B A∧B ¬(A ∧ B) ¬A ∨ ¬B ¬B ¬A
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 1 1 0
1 1 1 0 0 0 0
De Morgan's law
• Let's look at the steps for
¬(A V B) ≡ ¬A ∧ successfully applying De Morgan’s
law to turn ¬(A V B) into ¬A ∧ ¬B.
¬B
NOT(A OR B) is the same as (NOT A) AND (NOT B)
• Remember, you can only apply this
rule to one operator at a time.
¬(A V B)
¬B
NOT(A OR B) is the same as (NOT A) AND (NOT B) • So, by following these three steps,
we have an expression that logically
behaves exactly the same way but
now uses an AND instead of an OR.
¬(A V B)
Step
1:
Change OR to AND (or vice versa) ¬(A ∧ B)
Step NOT the terms on either side of the
2: operator ¬(¬A ∧ ¬B)
Step
3:
NOT everything that has changed ¬¬(¬A ∧ ¬B)
Step Change OR to AND (or vice • In this case, we will convert the AND
1: versa)
X = ¬(¬A V ¬B) V B operator into an OR – so, we are
applying De Morgan’s law to the
Step NOT the terms on either side of part of the expression in red.
2: the operator
• Why this part? Simply because it has
Step more NOT operators surrounding it
NOT everything that has changed
3: and De Morgan’s law might provide
us with a way to get rid of some.
Using De Morgan's law
• We then NOT the terms on either
X = ¬(¬A ∧ ¬B) V B side of the operator.
X = ¬(¬A ∧ ¬B) V B
Step Change OR to AND (or vice
1: versa) X = ¬(¬A V ¬B) V B
Step
2:
NOT the terms on either side of
the operator
X = ¬(¬¬A V ¬¬B) V B
Step
NOT everything that has changed
3:
Using De Morgan's law
• We then NOT everything that has
X = ¬(¬A ∧ ¬B) V B been changed.
X = ¬(¬A ∧ ¬B) V B
Step Change OR to AND (or vice
1: versa) X = ¬(¬A V ¬B) V B
Step NOT the terms on either side of X = ¬(¬¬A V ¬¬B) V
X = ¬¬(¬¬ABV ¬¬B) V B
2: the operator
Step
NOT everything that has changed
3:
Using De Morgan's law
• We are done with De Morgan’s law,
X = ¬(¬A ∧ ¬B) V B and now our expression only
contains ORs.
X equals NOT(NOT A AND NOT B) OR B
• Having done so, we can easily spot
other areas to simplify.
X = ¬(¬A ∧ ¬B) V B • Let's start by removing all the double
Step Change OR to AND (or vice negation.
1: versa) X = ¬(¬A V ¬B) V B
Step NOT the terms on either side of X = ¬(¬¬A V ¬¬B) V
2: the operator B
Step
NOT everything that has changed
X = ¬¬(¬¬A V ¬¬B)
3: X = (AVVBB) V B
Step NOT the terms on either side of X = ¬(¬¬A V ¬¬B) V • Consider these three phrases:
o “Craig and his friends James
2: the operator B and Tom are coming to the
party.”
Step
NOT everything that has changed
X = ¬¬(¬¬A V ¬¬B) o “James and Tom and their
friend Craig are coming to the
3: VB party.”
o “Craig, James and Tom are
X=AVBVB coming to the party.”
Get rid of any double negation X = (A V B) V B • Essentially, all these phrases mean
the same thing.
Using De Morgan's law
• Finally, we can use one of the
X = ¬(¬A ∧ ¬B) V B general OR rules we covered at the
start of the video.
X equals NOT(NOT A AND NOT B) OR B
• X V X = X – or to put it another way, X
OR X has to equal the value of X.
X = ¬(¬A ∧ ¬B) V B • We can apply this rule to B V B and
Step Change OR to AND (or vice simplify it to just B.
1: versa) X = ¬(¬A V ¬B) V B
• We have simplified this Boolean
Step NOT the terms on either side of X = ¬(¬¬A V ¬¬B) V expression from X = ¬(¬A ∧ ¬B) V B
to: X = A V B
2: the operator B
Step
NOT everything that has changed
X = ¬¬(¬¬A V ¬¬B)
3: VB
laws
Absorption Commutation
Double
negation
Double negation
What
does it reverse something twice, you end up
• If you
mean?
back where you started.
• NOT NOT A
• Double negative = A
In
Boolea
n
algebr ¬(¬A) = A
a
Real-
life
“I don’t not like you,”
analo
is the same as,
gy
“I like you.”
Association
In Boolean algebra
The OR association rule: The AND association rule:
A V (B V C) ≡ (A V B) V C ≡ A V B V C A ∧ (B ∧ C) ≡ (A ∧ B) ∧ C ≡ A ∧ B ∧ C
A OR (B OR C) is the same as A AND (B AND C) is the same as
(A OR B) OR C is the same as (A AND B) AND C is the same as
A OR B OR C A AND B AND C
Real-life analogy
Commutation
In Boolean algebra
The OR commutation rule: The AND commutation rule:
AVB ≡ BVA A∧B ≡ B∧A
A OR B is the same as A AND B is the same as
B OR A B AND A
Real-life analogy
Distribution
In Boolean algebra
Real-life analogy
The OR distribution rule:
A ∧ (B V C) ≡ (A ∧ B) V (A ∧ C)
A AND (B OR C) is the same as
(A AND B) OR (A AND C)
laws
Absorption Commutation
Double
negation
Absorption
In Boolean algebra
The OR absorption rule: The AND absorption rule:
A V (A ∧ B) ≡ A A ∧ (A V B) ≡ A
A OR (A AND B) is the same as A AND (A OR B) is the same as
A A
C ats Commutation
A nnoy Association
D ogs Distribution
A fter Absorption
9. notnotx
Anything NOT TWICE is just itself
Simplifying expressions
Q Expression = Rule
1. X ∧ 0= 0 Anything AND with 0 is false
Distributive Laws:
¬P ^ (P v Q) 1. A ^ (B V C) ≡ A^B V A^C
A V B^C ≡ (A V B) ^ (A V C)
Associative Laws:
1. Multiply out (Distributive) (A V B) V C ≡ A V (B V C) ≡ A V B V C
(A^B)^C ≡ A^(B^C) ≡ A^B^C
¬P ^ P v ¬P ^ Q de Morgan’s Laws:
¬(A V B) ≡ ¬A^¬B
¬(A^B) ≡ ¬A V ¬B
2. ¬P ^ P = 0 OR Rules:
AV0≡A
0 v ¬P ^ Q
AV1≡1
AVA≡A
A V ¬A ≡ 1
em em b er
R Re-Write AND Rules:
u r m a th s : A^0≡0
yo A^1≡A
Expanding ¬P ^ Q 2.
A^A≡A
A^¬A ≡ 0
Distributive Laws:
1. Use de Morgan’s 2. A ^ (B V C) ≡ A^B V A^C
A V B^C ≡ (A V B) ^ (A V C)
de Morgan’s Laws:
OR Rules:
3. ¬P ^ ¬P = ¬P AV0≡A
AV1≡1
4. ¬Q ^ Q = 0 5.
AND Rules:
A^0≡0
A^1≡A
¬P^¬Q v ¬P^0 3.
4.
A^A≡A
A^¬A ≡ 0
5. ¬p ^ 0 = 0 Other Rules:
¬¬A ≡ A
AVA^B≡A
¬P^¬Q A V ¬A ^ B ≡ A V B
Commutative Laws:
AVB≡ BVA
Distributive Laws:
2. A ^ (B V C) ≡ A^B V A^C
1. Use de Morgan’s A V B^C ≡ (A V B) ^ (A V C)
OR Rules:
AV0≡A
3. ¬P ^ ¬P = ¬P (& same for Q) AV1≡1
4. AVA≡A
¬P^Q v ¬P^Q A V ¬A ≡ 1
AND Rules:
4. ¬P^Q v ¬P^Q = ¬P^Q A^0≡0
A^1≡A
3. A^A≡A
¬P^Q A^¬A ≡ 0
Other Rules:
¬¬A ≡ A
AVA^B≡A
A V ¬A ^ B ≡ A V B