Introduction to Logic1 Introduction to Logic 3. lecture Propositional Logic Continuing Marie Duží.
Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic &...
Transcript of Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic &...
![Page 1: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/1.jpg)
1
February 1st, 2016
Dave Abel
Unit 1: Logic & Gates
![Page 2: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/2.jpg)
Takeaway: Logic
2
(1) There is a notion of correct reasoning (Logic)
(2) Computers automate this reasoning process
![Page 3: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/3.jpg)
Outline of Unit
3
‣ Quick Review of Binary
‣ Physical Bits!
‣ Ambiguity of Regular Languages
‣ Logical Inference
‣ Logical Functions: AND, OR, NOT
‣ Truth Tables
![Page 4: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/4.jpg)
1. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
Reading Binary: 27
4
Our Number: Twenty Seven
![Page 5: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/5.jpg)
Reading Binary: 27
5
Our Number: Twenty Seven
1. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 6: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/6.jpg)
6
Our Number: Twenty Seven
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 7: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/7.jpg)
7
Our Number: Twenty Seven
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 8: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/8.jpg)
8
Our Number: Eleven
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 9: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/9.jpg)
9
Our Number: Eleven
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 10: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/10.jpg)
10
Our Number: Eleven
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 11: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/11.jpg)
11
Our Number: Eleven
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 12: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/12.jpg)
12
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 13: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/13.jpg)
13
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 14: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/14.jpg)
14
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 15: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/15.jpg)
15
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 16: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/16.jpg)
16
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 17: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/17.jpg)
17
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 18: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/18.jpg)
18
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 19: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/19.jpg)
19
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 20: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/20.jpg)
20
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 21: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/21.jpg)
21
Our Number: Three
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 22: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/22.jpg)
22
Our Number: One
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 23: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/23.jpg)
23
Our Number: One
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 24: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/24.jpg)
24
Our Number: One
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 25: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/25.jpg)
25
Our Number: One
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 26: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/26.jpg)
26
Our Number: Zero
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 27: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/27.jpg)
27
Our Number: Zero
Reading Binary: 271. Start with the biggest power of 2 no bigger than your number.
2. Write down a 1 in that power of two’s column.
3. Subtract that power of 2 from your number.
4. Go to the next smallest power of 2.
5. If your remaining number is greater than or equal to the power of 2, write down a 1 and subtract the power of 2.
6. If not, write down 0.
7. Repeat from [4].
![Page 28: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/28.jpg)
Review: Binary Addition
28
1 0 0 1+ 1 0 1 0
![Page 29: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/29.jpg)
Review: Binary Addition
29
1 0 0 1+ 1 0 1 0
1
![Page 30: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/30.jpg)
Review: Binary Addition
30
1 0 0 1+ 1 0 1 0
1 1
![Page 31: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/31.jpg)
Review: Binary Addition
31
1 0 0 1+ 1 0 1 0
0 1 1
![Page 32: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/32.jpg)
Review: Binary Addition
32
1 0 0 1+ 1 0 1 0
0 0 1 1
1
![Page 33: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/33.jpg)
Review: Binary Addition
33
1 0 0 1+ 1 0 1 01 0 0 1 1
1
![Page 34: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/34.jpg)
Review: Binary Addition
34
1 0 0 1+ 1 0 1 01 0 0 1 1
1
Sanity check: nine + ten = nineteen.
![Page 35: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/35.jpg)
Review: Binary Subtraction
35
1- 0
1
1- 1
0
0- 0
0
A: B: C:
![Page 36: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/36.jpg)
Review: Binary Subtraction
36
D:
1 0- 0 1
1
11
![Page 37: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/37.jpg)
Review: Binary Subtraction
37
1 1 0 1- 0 0 1 0
![Page 38: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/38.jpg)
Review: Binary Subtraction
38
1 1 0 1- 0 0 1 0
0
![Page 39: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/39.jpg)
Review: Binary Subtraction
39
1 1 0 1- 0 0 1 0
0
11
![Page 40: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/40.jpg)
Review: Binary Subtraction
40
1 1 0 1- 0 0 1 0
1 0
11
![Page 41: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/41.jpg)
Review: Binary Subtraction
41
1 0 0 1- 0 0 1 0
1 0
11
![Page 42: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/42.jpg)
Review: Binary Subtraction
42
1 0 0 1- 0 0 1 0
1 0
11
![Page 43: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/43.jpg)
Review: Binary Subtraction
43
1 0 0 1- 0 0 1 0
0 1 0
11
![Page 44: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/44.jpg)
Review: Binary Subtraction
44
1 0 0 1- 0 0 1 0
1 0 1 0
11
Sanity check: nine - two = seven
![Page 45: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/45.jpg)
‣ Idea: move over each bit in bottom number, if there’s a 1, add the entire top number, otherwise, shift over and repeat:
Review: Binary Multiplication
45
1 1 1* 0 1 0
![Page 46: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/46.jpg)
‣ Idea: move over each bit in bottom number, if there’s a 1, add the entire top number, otherwise, shift over and repeat:
Review: Binary Multiplication
46
1 1 1* 0 1 0
0 0 0
(Recall: we’re really just multiplying by 0)
![Page 47: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/47.jpg)
‣ Idea: move over each bit in bottom number, if there’s a 1, add the entire top number, otherwise, shift over and repeat:
Review: Binary Multiplication
47
1 1 1* 0 1 01 1 1
![Page 48: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/48.jpg)
‣ Idea: move over each bit in bottom number, if there’s a 1, add the entire top number, otherwise, shift over and repeat:
Review: Binary Multiplication
48
1 1 1* 0 1 01 1 1
![Page 49: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/49.jpg)
‣ Idea: move over each bit in bottom number, if there’s a 1, add the entire top number, otherwise, shift over and repeat:
Review: Binary Multiplication
49
1 1 1* 0 1 01 1 1 0
![Page 50: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/50.jpg)
‣ Idea: move over each bit in bottom number, if there’s a 1, add the entire top number, otherwise, shift over and repeat:
Review: Binary Multiplication
50
1 1 1* 0 1 01 1 1 0
Sanity Check: seven * two = fourteen
![Page 51: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/51.jpg)
Review: Representation
51
![Page 52: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/52.jpg)
Review: Representation
52
blue bits
green bits
red bits
![Page 53: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/53.jpg)
Image 1Image 1
Review: Representation
53
Image 1
…
![Page 54: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/54.jpg)
Review: Representation
54
0 1 10 11
a b c d
c = 10, h = 100 …
![Page 55: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/55.jpg)
Onward! Physical Bits
55
Q: How can we represent 0’s and 1’s in the real world?
![Page 56: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/56.jpg)
Onward! Physical Bits
56
A: How about people! Raising hand, not raising hand.
Q: How can we represent 0’s and 1’s in the real world?
![Page 57: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/57.jpg)
Onward! Physical Bits
57
A: How about people! Raising hand, not raising hand.
Q: How can we represent 0’s and 1’s in the real world?
A: How about fingers! Raising finger, not raising finger.
![Page 58: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/58.jpg)
Onward! Physical Bits
58
A: How about people! Raising hand, not raising hand.
Q: How can we represent 0’s and 1’s in the real world?
A: How about fingers! Raising finger, not raising finger.
Q: Try to represent six with your hands!
![Page 59: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/59.jpg)
Onward! Physical Bits
59
A: How about people! Raising hand, not raising hand.
Q: How can we represent 0’s and 1’s in the real world?
A: How about fingers! Raising finger, not raising finger.
Q: Try to represent six with your hands!
A:
![Page 60: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/60.jpg)
Onward! Physical Bits
60
A: How about people! Raising hand, not raising hand.
Q: How can we represent 0’s and 1’s in the real world?
A: How about fingers! Raising finger, not raising finger.
Q: What can we count up to by using binary with hands?
![Page 61: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/61.jpg)
Onward! Physical Bits
61
A: How about people! Raising hand, not raising hand.
Q: How can we represent 0’s and 1’s in the real world?
A: How about fingers! Raising finger, not raising finger.
Q: What can we count up to by using binary with hands?
A: Homework question
![Page 62: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/62.jpg)
Onward! Physical Bits
62
A: How about people! Raising hand, not raising hand.
Q: How can we represent 0’s and 1’s in the real world?
A: How about fingers! Raising finger, not raising finger.
![Page 63: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/63.jpg)
Onward! Physical Bits
63
A: How about people! Raising hand, not raising hand.
Q: How can we represent 0’s and 1’s in the real world?
A: How about fingers! Raising finger, not raising finger.
Thought: but we need something smaller…
![Page 64: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/64.jpg)
Some History
64
![Page 65: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/65.jpg)
Some History
65
Proposed by Ada Lovelace/Charles Babbage in 1837
![Page 66: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/66.jpg)
Some History
66
Proposed by Ada Lovelace/Charles Babbage in 1837
![Page 67: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/67.jpg)
Some History
67
Proposed by Ada Lovelace/Charles Babbage in 1837
Built in 1910
![Page 68: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/68.jpg)
Some History
68
Bits
![Page 69: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/69.jpg)
Bits: Levers
69
OFFON
0
![Page 70: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/70.jpg)
Bits: Levers
70
OFFON
1
![Page 71: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/71.jpg)
Q: What Is This Number?
71
![Page 72: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/72.jpg)
Q: What Is This Number?
72
1 1 0 1
![Page 73: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/73.jpg)
Next Up: Vacuum Tubes!
73
![Page 74: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/74.jpg)
Next Up: Vacuum Tubes!
74
![Page 75: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/75.jpg)
Next Up: Vacuum Tubes!
75
(Called a “Triode”, because three prongs)
![Page 76: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/76.jpg)
Next Up: Vacuum Tubes!
76
When cathode heated, emits electrons attracted to the plate
![Page 77: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/77.jpg)
Next Up: Vacuum Tubes!
77
Grid controls the flow of electrons:
![Page 78: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/78.jpg)
Next Up: Vacuum Tubes!
78
Grid controls the flow of electrons: Negative: electrons bounce back to Cathode
![Page 79: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/79.jpg)
Next Up: Vacuum Tubes!
79
Grid controls the flow of electrons: Negative: electrons bounce back to Cathode
Positive: electrons travel through to Cathode
![Page 80: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/80.jpg)
Next Up: Vacuum Tubes!
80
![Page 81: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/81.jpg)
Next Up: Vacuum Tubes!
81
Q: What if one breaks?
![Page 82: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/82.jpg)
Next Up: Vacuum Tubes!
82
Q: What if one breaks? A: Better check all 19,000 tubes…
![Page 83: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/83.jpg)
Now: The Transistor
83
![Page 84: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/84.jpg)
Now: The Transistor
84
‣ Takes in electric current:
- Amplifies it! (ON, 1)
- Or not… (OFF, 0)
![Page 85: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/85.jpg)
85
‣ Takes in electric current:
- Amplifies it! (ON, 1)
- Or not… (OFF, 0)
Low voltage pulse of electricity = 0High voltage pulse of electricity = 1
Now: The Transistor
![Page 86: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/86.jpg)
86
‣ Q: Roughly how many in your phone/computer?
Now: The Transistor
![Page 87: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/87.jpg)
87
‣ Q: Roughly how many in your phone/computer?
‣ A: On the order of billions…
Now: The Transistor
![Page 88: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/88.jpg)
88
Moore’s Law (Predicted)N
umbe
r Tra
nsis
tors
0
7500000
15000000
22500000
30000000
Year1972 1978 1984 1990 1996 2002 2008 2014
![Page 89: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/89.jpg)
We Know How To Do This…
89
![Page 90: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/90.jpg)
Still Need: Reasoning
90
![Page 91: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/91.jpg)
Enter:
91
![Page 92: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/92.jpg)
Enter:
92
Idea: What is valid reasoning?
![Page 93: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/93.jpg)
Logic: Some History
93
Mohism: ~400 B.C.E.
Nyaya: 200 C.E.
Aristotle: ~350 B.C.E.
![Page 94: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/94.jpg)
Logic: Example
94
‣ If the snozzberry is a berry, then it is a fruit.
‣ The snozzberry is a berry.
‣ Conclusion: The snozzberry is a fruit.
Q: Is this reasoning valid?
![Page 95: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/95.jpg)
Logic: Example
95
‣ If the snozzberry is a berry, then it is a fruit.
‣ The snozzberry is a berry.
‣ Conclusion: The snozzberry is a fruit.
Q: Is this reasoning valid?
A: Yes! In this unit, we’ll learn what is and is not valid reasoning.
![Page 96: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/96.jpg)
Logic
96
Problem: Language is ambiguous, so truth can be finicky!
![Page 97: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/97.jpg)
Language is Ambiguous
97
Problem: Language is ambiguous, so truth can be finicky!
Q: What is art?
![Page 98: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/98.jpg)
Language is Ambiguous
98
Problem: Language is ambiguous, so truth can be finicky!
Q: What is a sport?
![Page 99: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/99.jpg)
Language is Ambiguous
99
‣ Example 1: “I never said she stole my money”
- Changes meaning depending on the emphasis!
‣ Example 2: “Time flies like an arrow”
- Is time a noun? (e.g. “Fruit flies like a banana”)
‣ Example 3: “I have not slept for ten days”
- Has the speaker not slept in the last ten days? Or have they never slept for a period of ten days?
![Page 100: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/100.jpg)
Logic: A Formal Language
100
‣ Variables that stand for sentences: P, Q, R, S
![Page 101: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/101.jpg)
‣ Variables that stand for sentences: P, Q, R, S
‣ Example:
- If the snozzberry is a berry, then it is a fruit.
- The snozzberry is a berry.
- Therefore, the snozzberry is a fruit.
Logic: A Formal Language
101
![Page 102: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/102.jpg)
Logic: A Formal Language
102
‣ Variables that stand for sentences: P, Q, R, S
‣ Example:
- If the snozzberry is a berry, then it is a fruit.
- The snozzberry is a berry.
- Therefore, the snozzberry is a fruit.
![Page 103: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/103.jpg)
‣ Variables that stand for sentences: P, Q, R, S
‣ Example:
- If the snozzberry is a berry, then it is a fruit.
- The snozzberry is a berry.
- Therefore, the snozzberry is a fruit.
Logic: A Formal Language
103
P Q
![Page 104: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/104.jpg)
‣ Variables that stand for sentences: P, Q, R, S
‣ Example:
- If t then it is a fruit.
-
- Therefore, the snozzberry is a fruit.
Logic: A Formal Language
104
P Q
P
Q
= The snozzberry is a berry.
= The snozzberry is a fruit.
P
Q
![Page 105: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/105.jpg)
‣ Variables that stand for sentences: P, Q, R, S
‣ Example:
- If t then it is a fruit.
-
- Therefore, the snozzberry is a fruit.
Logic: A Formal Language
105
P Q
P
Q
True for all sentences P,
All sentences Q!
![Page 106: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/106.jpg)
Logic: A Formal Language
106
Premises: assume to be true.
‣ Variables that stand for sentences: P, Q, R, S
‣ Example:
- If t then it is a fruit.
-
- Therefore, the snozzberry is a fruit.
P Q
P
Q
![Page 107: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/107.jpg)
Logic: A Formal Language
107
‣ Variables that stand for sentences: P, Q, R, S
‣ Example:
- If t then it is a fruit.
-
- Therefore, the snozzberry is a fruit.
P Q
P
Q
Premises: assume to be true.
Q: What can we conclude from our
premises?
![Page 108: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/108.jpg)
‣ Variables that stand for sentences: P, Q, R, S
‣ We call sentences that can be True or False “Boolean”, after Goerge Boole (1800’s)
Logic: A Formal Language
108
![Page 109: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/109.jpg)
‣ Variables that stand for sentences: P, Q, R, S
‣ We call sentences that can be True or False “Boolean”, after Goerge Boole (1800’s)
‣ Henceforth, P, Q, R, S, etc., will be called Boolean Sentences.
Logic: A Formal Language
109
![Page 110: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/110.jpg)
‣ Variables that stand for sentences: P, Q, R, S
‣ We call sentences that can be True or False “Boolean”, after Goerge Boole (1800’s)
‣ Henceforth, P, Q, R, S, etc., will be called Boolean Sentences.
The question is: in what ways can we reason (about Boolean Sentences)?
Logic: A Formal Language
110
![Page 111: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/111.jpg)
The question is: in what ways can we reason (about Boolean Sentences)?
Logic: Inference Rules
111
We saw one:
If P, then Q P Therefore Q.
![Page 112: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/112.jpg)
The question is: in what ways can we reason (about Boolean Sentences)?
Logic: Inference Rules
112
We saw one:
If P, then Q P Therefore Q.
Modus Ponens
![Page 113: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/113.jpg)
The question is: in what ways can we reason (about Boolean Sentences)?
Logic: Inference Rules
113
Modus Ponens‣ There are others!
‣ Our rules come from thousands of years of intuition about what is perfect reasoning.
![Page 114: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/114.jpg)
The question is: in what ways can we reason (about Boolean Sentences)?
Logic: Inference Rules
114
Modus Ponens‣ There are others!
‣ We get three functions:
AND(-,-) OR(-,-) NOT(-)
![Page 115: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/115.jpg)
Logic: Boolean Functions
115
‣ We get three functions: AND, OR, NOT
- Each function takes as input a Boolean Sentence (P, Q, etc.)
- Outputs a Boolean value (True, False)
![Page 116: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/116.jpg)
Logic: AND
116
AND(P,Q)
Outputs True if both P and Q are True.
![Page 117: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/117.jpg)
Logic: OR
117
AND(P,Q)
Outputs True if both P and Q are True.
OR(P,Q)
Outputs True if at least one of P or Q is True.
![Page 118: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/118.jpg)
Logic: NOT
118
AND(P,Q)
Outputs True if both P and Q are True.
OR(P,Q)
Outputs True if at least one of P or Q is True.
NOT(P)
Outputs True if P is False.
![Page 119: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/119.jpg)
Example
119
‣ Suppose P is True, Q is False: which of the following are True?
1. AND(P,Q)
2. OR(P,Q)
3. NOT(P)
4. NOT(Q)
![Page 120: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/120.jpg)
Example
120
‣ Suppose P is True, Q is False: which of the following are True?
1. AND(P,Q)
2. OR(P,Q)
3. NOT(P)
4. NOT(Q)
AND(P,Q)
Outputs True if both P and Q are True.
OR(P,Q)
Outputs True if at least one of P or Q is True.
NOT(P)
Outputs True if P is False.
![Page 121: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/121.jpg)
Example
121
‣ Suppose P is True, Q is False: which of the following are True?
1. AND(P,Q)
2. OR(P,Q)
3. NOT(P)
4. NOT(Q)
AND(P,Q)
Outputs True if both P and Q are True.
OR(P,Q)
Outputs True if at least one of P or Q is True.
NOT(P)
Outputs True if P is False.
![Page 122: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/122.jpg)
Example
122
‣ Suppose P is True, Q is False: which of the following are True?
1. AND(P,Q)
2. OR(P,Q)
3. NOT(P)
4. NOT(Q)
AND(P,Q)
Outputs True if both P and Q are True.
OR(P,Q)
Outputs True if at least one of P or Q is True.
NOT(P)
Outputs True if P is False.
![Page 123: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/123.jpg)
Example
123
‣ Suppose P is True, Q is False: which of the following are True?
1. AND(P,Q)
2. OR(P,Q)
3. NOT(P)
4. NOT(Q)
AND(P,Q)
Outputs True if both P and Q are True.
OR(P,Q)
Outputs True if at least one of P or Q is True.
NOT(P)
Outputs True if P is False.
![Page 124: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/124.jpg)
Example
124
‣ Suppose P is True, Q is False: which of the following are True?
1. AND(P,Q)
2. OR(P,Q)
3. NOT(P)
4. NOT(Q)
AND(P,Q)
Outputs True if both P and Q are True.
OR(P,Q)
Outputs True if at least one of P or Q is True.
NOT(P)
Outputs True if P is False.
![Page 125: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/125.jpg)
125
P NOT( P)
T
F
Truth Tables: NOT
![Page 126: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/126.jpg)
126
P NOT( P)
T T
F F
Truth Tables: NOT
![Page 127: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/127.jpg)
127
P NOT( P)
T F T
F T F
Truth Tables: NOT
![Page 128: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/128.jpg)
128
When P is True, NOT(P) is False
When P is False, NOT(P) is True
P NOT( P)
T F T
F T F
Truth Tables: NOT
![Page 129: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/129.jpg)
129
P Q AND( P Q)
T T
T F
F T
F F
Truth Tables: AND
![Page 130: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/130.jpg)
Truth Tables: AND
130
P Q AND( P Q)
T T T T
T F T F
F T F T
F F F F
![Page 131: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/131.jpg)
131
P Q AND( P Q)
T T T T T
T F F T F
F T F F T
F F F F F
Truth Tables: AND
![Page 132: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/132.jpg)
132
P Q AND( P Q)
T T T T T
T F F T F
F T F F T
F F F F F
When P and Q are True, AND(P,Q) is
True
Otherwise, AND(P,Q) is False
Truth Tables: AND
![Page 133: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/133.jpg)
133
P Q OR( P Q)
T T T T
T F T F
F T F T
F F F F
Truth Tables: OR
![Page 134: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/134.jpg)
134
P Q OR( P Q)
T T T T T
T F T T F
F T T F T
F F F F F
Truth Tables: OR
![Page 135: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/135.jpg)
135
Inference With AND!
AND(P,Q)
Therefore, P
Therefore, Q
P
Q
Therefore, AND(P,Q)
![Page 136: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/136.jpg)
Logic: Composition
136
‣ Boolean Sentences represented with a letter are called Atomic Sentences (e.g. P, Q, R, S, etc.)
‣ But since AND(-,-), OR(-,-), and NOT(-), also output Boolean Values, they are also Boolean Sentences.
‣ For example:
- AND(NOT(P),Q)
- OR(AND(P,Q),NOT(R))
![Page 137: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/137.jpg)
137
P Q OR( NOT( Q), P)
T T
T F
F T
F F
Truth Tables: Composite
![Page 138: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/138.jpg)
138
P Q OR( NOT( Q), P)
T T T T
T F F T
F T T F
F F F F
Truth Tables: Composite
![Page 139: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/139.jpg)
139
P Q OR( NOT( Q), P)
T T F T T
T F T F T
F T F T F
F F T F F
Truth Tables: Composite
![Page 140: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/140.jpg)
140
P Q OR( NOT( Q), P)
T T F T T
T F T F T
F T F T F
F F T F F
Truth Tables: Composite
![Page 141: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/141.jpg)
141
P Q OR( NOT( Q), P)
T T T F T T
T F T F T
F T F T F
F F T F F
Truth Tables: Composite
![Page 142: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/142.jpg)
142
P Q OR( NOT( Q), P)
T T T F T T
T F T T F T
F T F T F
F F T F F
Truth Tables: Composite
![Page 143: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/143.jpg)
143
P Q OR( NOT( Q), P)
T T T F T T
T F T T F T
F T F F T F
F F T F F
Truth Tables: Composite
![Page 144: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/144.jpg)
144
P Q OR( NOT( Q), P)
T T T F T T
T F T T F T
F T F F T F
F F T T F F
Truth Tables: Composite
![Page 145: Unit 1: Logic & Gates - David Abel › teaching › cs8_2016 › logic1.pdf · Unit 1: Logic & Gates. Takeaway: Logic 2 (1) There is a notion of correct reasoning (Logic) (2) Computers](https://reader030.fdocuments.in/reader030/viewer/2022040617/5f1f25ca6d410e4c0720c4f5/html5/thumbnails/145.jpg)
Reflection
145
‣ Physical Bits!
‣ Ambiguity of Regular Languages
‣ Logical Inference
‣ Logical Functions: AND, OR, NOT
‣ Truth TablesIf P, then Q P Therefore Q.P NOT( P)
T F T
F T F