Download as pdf or txt
Download as pdf or txt
You are on page 1of 52

OAKLAND

UNIVERSITY

Boolean Algebra and Venn Diagrams

EGR 2400
Instructor: Steven Louis
This presentation includes physical representation of:
? 1. Gates, practice
2. Basic Boolean algebra notation
3. Boolean axioms and theorems from text
4. Venn diagram introduction
5. Axioms
6. Theorems

Boolean Algebra and Venn Diagrams 1


Some figures from Dean, Llamocca Introduction to Analog & Digital Circuits, 2019
All logic gates & truth tables
~X X&Y X|Y X^Y
X X
X X
Y Y Y XOR
NOT AND OR
X NOT X Y AND X Y OR X Y XOR
0 1 0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 1 1 0 1 1
1 0 0 1 0 1 1 0 1
1 1 1 1 1 1 1 1 0

~(X & Y) ~(X | Y) ~(X ^ Y)


X X X
Y Y Y
NAND NOR XNOR
X Y NAND X Y NOR X Y XNOR
0 0 1 0 0 1 0 0 1
0 1 1 0 1 0 0 1 0
1 0 1 1 0 0 1 0 0
1 1 0 1 1 0 1 1 1
Boolean Algebra and Venn Diagrams 2
Example #1

Boolean Algebra and Venn Diagrams 3


Example #2 – Skip intermediate columns?
Because final output is an OR gate, intermediate columns can be skipped.
(OR gate’s output is “1” if a single one of its inputs “1”.)

Boolean Algebra and Venn Diagrams 4


OAKLAND
UNIVERSITY

Boolean Algebra and Venn Diagrams

EGR 2400
Instructor: Steven Louis


This presentation includes physical representation of:
1. Gates, practice
? 2. Basic Boolean algebra notation
3. Boolean axioms and theorems from text
4. Venn diagram introduction
5. Axioms
6. Theorems

Boolean Algebra and Venn Diagrams 5


NOT Boolean notation
X Y

NOT Boolean notation


X Y
Y=~X (Verilog)
0 1
1 0
Y=𝑋ത (Textbook)
Y=X’
Y=!X (ABEL)
Y=not X (VHDL)
Y=¬X
not(Y,X) (Verilog)

Boolean Algebra and Venn Diagrams 6


AND Boolean notation
X
AND Boolean notation
Y XY Handwritten
AND X&Y (Verilog and ABEL)
X Y AND X⋅Y (textbook)
0 0 0
X and Y (VHDL)
0 1 0
X∧Y
1 0 0
X⋂Y
1 1 1
and(Z,X,Y) (Verilog)

X Y NAND
X 0 0 1
~(X & Y)
Y 0 1 1

NAND 1 0 1
1 1 0

Boolean Algebra and Venn Diagrams 7


OR Boolean notation
X OR Boolean notation
X|Y (Verilog)
Y
OR X + Y (textbook)
X Y OR X#Y (ABEL)
0 0 0 X or Y (VHDL)
0 1 1 X ∨ Y
1 0 1 X ⋃ Y
1 1 1
or(Z,X,Y) (Verilog)

X Y NOR
0 0 1
X ~(X|Y)
0 1 0
Y
1 0 0
NOR
1 1 0
Boolean Algebra and Venn Diagrams 8
XOR Boolean notation
X XOR Boolean notation
X^Y (Verilog)
Y XOR
X⊕Y (textbook)
X Y XOR X$Y (ABEL)
0 0 0 X@Y
0 1 1 xor(Z,X,Y) (Verilog)
1 0 1
1 1 0

X Y XNOR
0 0 1
X ~(X^Y) 0 1 0
Y 1 0 0
XNOR 1 1 1

Boolean Algebra and Venn Diagrams 9


All logic gates & truth tables
~X X&Y X|Y X^Y
X X
X X
Y Y Y XOR
NOT AND OR
X NOT X Y AND X Y OR X Y XOR
0 1 0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 1 1 0 1 1
1 0 0 1 0 1 1 0 1
1 1 1 1 1 1 1 1 0
~(X&Y) ~(X|Y) ~(X^Y)
X X X
Y Y Y
NAND NOR XNOR
X Y NAND X Y NOR X Y XNOR
0 0 1 0 0 1 0 0 1
0 1 1 0 1 0 0 1 0
1 0 1 1 0 0 1 0 0
1 1 0 1 1 0 1 1 1
Boolean Algebra and Venn Diagrams 10
Precedence of Logical Operators

1. All ~ operations are done first


2. All & operations are done next
3. All | operations are done last

For example,

Is ~(X&Y) the same as ~X&Y ? (No)

What’s the difference?


~(X&Y) is a NOT of everything, while ~X&Y =(~X)&Y

Boolean Algebra and Venn Diagrams 11


Precedence of Logical Operators

1. All ~ operations are done first


2. All & operations are done next
3. All | operations are done last

Second question,

Is ~(X&Y) the same as ~X&~Y ?


This can be said another way, is the same as ?

The answer is no; ~(X&Y)≠~X&~Y .


Said another way,

Boolean Algebra and Venn Diagrams 12


OAKLAND
UNIVERSITY

Boolean Algebra and Venn Diagrams

EGR 2400
Instructor: Steven Louis


This presentation includes physical representation of:
1. Gates, practice
✓ 2. Basic Boolean algebra notation
? 3. Boolean axioms and theorems from text
4. Venn diagram introduction
5. Axioms
6. Theorems

Boolean Algebra and Venn Diagrams 13


Boolean algebra axioms and theorems

Boolean Algebra and Venn Diagrams 14


OAKLAND
UNIVERSITY

Boolean Algebra and Venn Diagrams

EGR 2400
Instructor: Steven Louis


This presentation includes physical representation of:
1. Gates, practice

2. Basic Boolean algebra notation

3. Boolean axioms and theorems from text
? 4. Venn diagram introduction
5. Axioms
6. Theorems

Boolean Algebra and Venn Diagrams 15


Two alphabets
English = A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Greek = Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω

Which letters have the same shape?


English & Greek = A B E Z H I K M N O P T Y X

Which of these letters are only in Greek?


~English & Greek = Γ Δ Θ Λ Ξ Π Σ Φ Ψ Ω

Which of these letters are only in English?


English & ~Greek = C D F G J L Q R S U V W

What is a good way to show this?

Boolean Algebra and Venn Diagrams 16


Two alphabets, Venn diagram
English: = A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Greek = Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω

Greek English

ΑΒΕ
ΖΗΙ CDFGJL
ΓΔΘΛΞΠ ΣΦ
ΚΜΝ QRSUV
ΨΩ
ΟΡΤ W
ΥΧ

~English & Greek = Γ Δ Θ Λ Ξ Π Σ Φ Ψ Ω English & ~Greek = C D F G J L Q R S U V W

Boolean Algebra and Venn Diagrams 17


Three alphabets, Venn diagram example
English: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Greek: Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω
Russian: А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я

English
Greek
ΖΙ DFGJLQ
ΔΘΛΞΣΨΩ ΚΝΥ RSUVW

ΑΒΕ
ΗΜΟ
ΡΤΧ

Γ ΦΠ С
English&Russian&~Greek = C

Greek&Russian&~English = Γ Φ Π
БДЁЖЗИЙКЛУЦЧ
Greek&Russian&English = Α Β Ε Η Μ Ο Ρ Τ Χ ШЩЪЫЬЭЮЯ

~(Greek | Russian | English) = 0 Russian


~(Greek&Russian&English) = Δ Θ Λ Ξ Σ Ψ Ω C D F G J L Q R S U V W Ζ Ι Κ Ν Υ Γ Φ Π Б Д Ё Ж З И Й К Л У Ц Ч Ш Щ Ъ Ы Ь Э Ю Я
Or : “Everything that isn't A, B, E, H, M, O, P, T, X” 18
F = X Venn diagram

X Y F=X

Legend:
With color means
“true” or “1”

No color means
“False” or “0”

X Y F=X

Boolean Algebra and Venn Diagrams 19


F = X vs F=~X Venn diagram

X Y F=X

Legend:
With color means
“true” or “1”

No color means
“False” or “0”

X Y F = ~X

Boolean Algebra and Venn Diagrams 20


F = Y vs F=~Y Venn diagram

X Y F=Y

X Y F = ~Y

Boolean Algebra and Venn Diagrams 21


F = X|Y vs F=~(X|Y) Venn diagram

X Y F = X|Y

X Y F = ~(X|Y)

Boolean Algebra and Venn Diagrams 22


F = X&Y vs F=~(X&Y) Venn diagram

X Y F = X&Y

X Y F = ~(X&Y)

Boolean Algebra and Venn Diagrams 23


F = ~X&Y Venn diagram

X Y
F = ~X

Next slide:

X Y F=X&~Y
F=Y
F=~X&~Y
F=~(X&Y)

X Y
F = ~X&Y = (~X)&Y

Boolean Algebra and Venn Diagrams 24


More Venn diagram examples

X Y
F = X&~Y

Next slide:
F = ~X&~Y
X Y F=1
(This one looks a
lot like F=~(X|Y) ! ) F=0

X Y
F = ~(X&Y)

Boolean Algebra and Venn Diagrams 25


More Venn diagram examples

X Y
F=1

F=0
X Y

Boolean Algebra and Venn Diagrams 26


Boolean algebra axioms and theorems

Boolean Algebra and Venn Diagrams 27


OAKLAND
UNIVERSITY

Boolean Algebra and Venn Diagrams

EGR 2400
Instructor: Steven Louis


This presentation includes physical representation of:
1. Gates, practice

2. Basic Boolean algebra notation

3. Boolean axioms and theorems from text

4. Venn diagram introduction
? 5. Axioms
6. Theorems

Boolean Algebra and Venn Diagrams 28


Axioms #1
~F
F

F
NOT
NOT F
~ X Y
= X Y

0 1
1 0

~0 = 1

~1 = 0

~ X Y
= X Y

Boolean Algebra and Venn Diagrams 29


Axioms #2

&

0&0=0
=
0&1=0
1&0=0

1&1=1
Boolean Algebra and Venn Diagrams 30
Axioms #2

&

0&0=0
=
0&1=0
1&0=0

1&1=1
Boolean Algebra and Venn Diagrams 31
Axioms #2

&

0&0=0
=
0&1=0
1&0=0

1&1=1
Boolean Algebra and Venn Diagrams 32
Axioms #3

0|0=0
=
0|1=1
1|0=1

1|1=1
Boolean Algebra and Venn Diagrams 33
Axioms #3

0|0=0
=
0|1=1
1|0=1

1|1=1
Boolean Algebra and Venn Diagrams 34
Axioms #3

0|0=0
=
0|1=1
1|0=1

1|1=1
Boolean Algebra and Venn Diagrams 35
OAKLAND
UNIVERSITY

Boolean Algebra and Venn Diagrams

EGR 2400
Instructor: Steven Louis


This presentation includes physical representation of:
1. Gates, practice

2. Basic Boolean algebra notation

3. Boolean axioms and theorems from text

4. Venn diagram introduction

?

5. Axioms
6. Theorems

Boolean Algebra and Venn Diagrams 36


Theorem: Variable dominant rule
X&Y
X
Y
AND X Y & X Y = X Y
X Y AND
0 0 0
0 1 0
1 0 0
X&1 = X
1 1 1

X X|0 = X
Y
OR
X Y OR X Y | X Y = X Y
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 37
Theorem: Identity element
X&Y
X
Y
AND X Y & X Y = X Y
X Y AND
0 0 0
0 1 0
1 0 0 X&0 = 0
1 1 1
X|1 = 1
X
Y
OR
X Y OR X Y | X Y = X Y
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 38
Theorem: Double negation
~X
X

NOT
X NOT
0 1
1 0
~(~X)=X

~ X Y = X Y 1st Negation

~ X Y = X Y 2nd Negation

Boolean Algebra and Venn Diagrams 39


Theorem: Commutative
X&Y
X
Y
AND X Y
X Y AND
0 0 0
0 1 0
1 0 0
1 1 1 X&Y = Y&X

X X|Y = Y|X
Y
OR
X Y OR
0 0 0 X Y
0 1 1
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 40
Theorem: Complement rule
X&Y
X
Y
AND X Y & X Y = X Y
X Y AND
0 0 0
0 1 0
1 0 0 X&~X = 0
1 1 1
X|~X = 1
X
Y
OR
X Y OR X Y | X Y = X Y
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 41
Theorem: Idempotency
X&Y
X
Y
AND X Y & X Y = X Y
X Y AND
0 0 0
0 1 0
1 0 0 X&X = X
1 1 1
X|X = X
X
Y
OR
X Y OR X Y | X Y = X Y
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 42
Theorem: Associative rule
X&Y
X
Y X Y
AND
X Y AND Z
0 0 0
0 1 0
1 0 0 X&(Y&Z) = (X&Y)&Z
1 1 1
X|(Y|Z) = (X|Y)|Z
X
Y
OR
X Y
X Y OR
0 0 0
0 1 1 Z
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 43
Theorem: Distributive rule (slide 1)
X&Y
X
X Y X Y X Y
Y
AND & =
Z Z Z
X Y AND
0 0 0
0 1 0
X (Y|Z)
1 0 0
1 1 1 X Y X Y X Y
| =
X Z Z Z

Y
OR X&Y X&Z
X Y OR Distributive rule: Alternate notation:
0 0 0
0 1 1 X&(Y|Z) = X&Y | X&Z X(Y+Z) = XY + XZ
1 0 1
1 1 1 X|(Y&Z) = (X|Y)&(X|Z) X+YZ = (X+Y)(X+Z)
Boolean Algebra and Venn Diagrams 44
Theorem: Distributive rule (slide 2)
X&Y
X
X Y X Y X Y
Y
AND | =
Z Z Z
X Y AND
0 0 0
0 1 0
X (Y&Z)
1 0 0
1 1 1 X Y X Y X Y
& =
X Z Z Z

Y
OR X|Y X|Z
X Y OR Distributive rule: Alternate notation:
0 0 0
0 1 1 X&(Y|Z) = X&Y | X&Z X(Y+Z) = XY + XZ
1 0 1
1 1 1 X|(Y&Z) = (X|Y)&(X|Z) X+YZ = (X+Y)(X+Z)
Boolean Algebra and Venn Diagrams 45
Theorem: Absorption
X&Y
X
Y
AND X Y & X Y = X Y
X Y AND
0 0 0
0 1 0
1 0 0 X&(X|Y) = X&X|X&Y = X|X&Y = X&(1|Y) = X&1 = X
1 1 1
X|(X&Y) = X&(1|Y) = X&1 = X
X
Y
OR
X Y OR X Y | X Y = X Y
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 46
Theorem: Adjacency
X&Y
X
Y
AND X Y | X Y = X Y
X Y AND
0 0 0
0 1 0 X&Y | X&~Y = X
1 0 0
1 1 1

X
(X|Y)&(X|~Y)=X
Y
OR
X Y OR X Y & X Y = X Y
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 47
Theorem: Simplification
X&Y
X
Y
AND X Y & X Y = X Y
X Y AND
0 0 0
0 1 0
1 0 0
1 1 1 X&(~X|Y) = X&Y
X
Y
X | ~X&Y = X|Y
OR
X Y OR X Y | X Y = X Y
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 48
Theorem: De Morgan
X&Y
X
Y
AND Let’s take these one at a time…

X Y AND
0 0 0
0 1 0
1 0 0
1 1 1 ~(X&Y&Z&…) = ~X | ~Y | ~Z | ~…

X ~(X|Y|Z|…) = ~X & ~Y & ~Z & ~…


Y
OR
X Y OR
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Algebra and Venn Diagrams 49
Theorem: De Morgan #1
~(X&Y&Z&…) = ~X | ~Y | ~Z | ~…

X Y X Y X Y X Y

Z Z Z Z

X&Y&Z ~X ~Y ~Z

X Y
~(X&Y&Z) ~X | ~Y | ~Z
Z

Boolean Algebra and Venn Diagrams 50


Theorem: De Morgan #2
~(X|Y|Z|…) = ~X & ~Y & ~Z & ~…

X Y X Y X Y X Y

Z Z Z Z

X|Y|Z ~X ~Y ~Z

X Y
~(X|Y|Z) ~X & ~Y & ~Z
Z

Boolean Algebra and Venn Diagrams 51


OAKLAND
UNIVERSITY

Boolean Algebra and Venn Diagrams

EGR 2400
Instructor: Steven Louis


This presentation includes physical representation of:
1. Gates, practice
✓2. Basic Boolean algebra notation
✓3. Boolean axioms and theorems from text
✓4. Venn diagram introduction
✓5. Axioms
✓6. Theorems

Boolean Algebra and Venn Diagrams 52

You might also like