Boolean Algebra
Philipp Koehn 30 August 2019
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
Boolean Algebra Philipp Koehn 30 August 2019 Philipp Koehn - - PowerPoint PPT Presentation
Boolean Algebra Philipp Koehn 30 August 2019 Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019 Core Boolean Operators 1 AND OR NOT A B A and B A B A or B A not A 0 0 0 0 0 0 0 1 0 1 0
Philipp Koehn 30 August 2019
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
1
AND OR NOT
A B A and B 1 1 1 1 1 A B A or B 1 1 1 1 1 1 1 A not A 1 1
AND OR NOT Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
2
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
3
A B OUT 1 1 1 1 1
not ( A or B ) (also called nor)
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
4
not ( A or B )
NOT OR
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
5
(A and B) and (C and D)
AND AND AND
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
6
A OUT1 OUT2 1 1 1
OUT1 = not A OUT2 = A
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
7
OUT1 = not A OUT2 = A
NOT
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
8
A B C OUT 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Need a better way of doing this instead of relying on intuition
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
9
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
10
A B C OUT Expression 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Goal: find expression for each row that yields 1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
11
A B C OUT Expression 1 1 (not A) and B and (not C) 1 1 1 1 1 1 1 1 1 1 1 1 1 Expression is 1 only for this row, 0 for all others
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
12
A B C OUT Expression 1 1 (not A) and B and (not C) 1 1 1 1 1 (not A) and (not B) and C 1 1 1 (not A) and B and C 1 1 1 1 1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
13
A B C OUT Expression 1 1 (not A) and B and (not C) 1 1 1 1 1 (not A) and (not B) and C 1 1 1 (not A) and B and C 1 1 1 1 1 Putting it all together: ((not A) and B and (not C)) or ((not A) and (not B) and C) or ((not A) and B and C)
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
14
((not A) and B and (not C)) or ((not A) and (not B) and C) or ((not A) and B and C)
OUT
AND NOT
A
NOT
B
NOT
C
OR AND AND
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
15
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
16
A B C OUT Expression 1 1 (not A) and B and (not C) 1 1 1 1 1 (not A) and (not B) and C 1 1 1 (not A) and B and C 1 1 1 1 1 Putting it all together: ((not A) and B and (not C)) or ((not A) and (not B) and C) or ((not A) and B and C)
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
17
A B C OUT Expression not ((not A) and (not B) and (not C)) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Expression is 0 only for this row, 1 for all others
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
18
A B C OUT Expression not ((not A) and (not B) and (not C)) 1 1 1 not (A and (not B) and (not C)) 1 1 not (A and B and (not C)) 1 1 1 1 1 1 1 not (A and (not B) and C) 1 1 1 not (A and B and C)
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
19
A B C OUT Expression not ((not A) and (not B) and (not C)) 1 1 1 not (A and (not B) and (not C)) 1 1 not (A and B and (not C)) 1 1 1 1 1 1 1 not (A and (not B) and C) 1 1 1 not (A and B and C) Putting it all together: (not ((not A) and (not B) and (not C))) and (not (A and (not B) and (not C))) and (not (A and B and (not C))) and (not (A and (not B) and C)) and (not (A and B and C))
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
20
(not ((not A) and (not B) and (not C))) and (not (A and (not B) and (not C))) and (not (A and B and (not C))) and (not (A and (not B) and C)) and (not (A and B and C))
NOT NOT NOT NOT NOT
OUT
AND NOT
A
NOT
B
NOT
C
AND AND AND AND AND
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
21
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
22
A B A nand B 1 1 1 1 1 1 1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
23
A B A nor B 1 1 1 1 1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
24
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
25
I V X L C D M 1 5 10 50 100 500 1000
II III VI XVI XXXIII MDCLXVI MMXVI 2 3 6 16 33 1666 2016
IV IX XL XC CD CM MCMLXXI 4 9 40 90 400 900 1971
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
26
invention of zero by Brahmagupta in AD 628
1 2 3 4 5 6 7 8 9
1 10 100 1000 10000 100000 1000000
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
27
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
28
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
29
Binary number 1 1 1 1 1 Position 7 6 5 4 3 2 1 Value 27 26 24 22 20 128 64 16 4 1 = 213
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
30
⇒ Octal numbers Binary number 1 1 1 1 1
3 2 5 Position 2 1 Value 3 × 82 2 × 81 5 × 80 192 16 5 = 213
but grouping three binary digits is a bit odd
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
31
use letters a-f Binary number 1 1 1 1 1
d 5 Position 1 Value 13 × 161 5 × 160 208 5 = 213
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
32
Decimal Binary Octal Hexademical 1 2 3 8 15 16 20 23 24 30 50 100 255 256
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
33
Decimal Binary Octal Hexademical 1 1 1 1 2 10 2 2 3 11 3 3 8 1000 10 8 15 1111 17 f 16 10000 20 10 20 10100 24 14 23 10111 27 17 24 11000 30 18 30 11110 36 1e 50 110010 62 32 100 1100100 144 64 255 11111111 377 ff 256 100000000 400 100
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
34
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
35
A 1 1 1 1 B 1 1 1 Carry A+B
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
36
A 1 1 1 1 B 1 1 1 Carry
1
1 + 0 = 1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
37
A 1 1 1 1 B 1 1 1 Carry
1
0 + 0 = 0
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
38
A 1 1 1 1 B 1 1 1 Carry 1
1
1 + 1 = 0, carry 1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
39
A 1 1 1 1 B 1 1 1 Carry 1 1
1
0 + 1 + 1 = 0, carry 1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
40
A 1 1 1 1 B 1 1 1 Carry 1 1 1
1 1
1 + 1 + 1 = 0, carry 1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
41
A 1 1 1 1 B 1 1 1 Carry
1 1
1 1 1 1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
42
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
43
Bits Unsigned 1 1 1 2 1 1 3 1 4 1 1 5 1 1 6 1 1 1 7
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
44
Bits Unsigned Sign + Magnitude +0 1 1 +1 1 2 +2 1 1 3 +3 1 4
1 1 5
1 1 6
1 1 1 7
0 = positive, 1 = negative
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
45
Bits Unsigned Sign + One’s Magnitude Complement +0 +0 1 1 +1 +1 1 2 +2 +2 1 1 3 +3 +3 1 4
1 1 5
1 1 6
1 1 1 7
flip all bits
two zeros (+0=000 and -0=111)
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019
46
Bits Unsigned Sign + One’s Two’s Magnitude Complement Complement +0 +0 +0 1 1 +1 +1 +1 1 2 +2 +2 +2 1 1 3 +3 +3 +3 1 4
1 1 5
1 1 6
1 1 1 7
flip all bits, add 001
+2 + -1 = 010 + 111 = 1001 = +1
Philipp Koehn Computer Systems Fundamentals: Boolean Algebra 30 August 2019