1 / 79

Administrivia

Administrivia. New students? No class Thursday 9/27 Lab Problem Set Favorite browser and why Favorite search engine and why Questions??. Collaboration Policy. On Problem Sets / Labs: Allowed (actually, encouraged):

Download Presentation

Administrivia

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Administrivia • New students? • No class Thursday 9/27 • Lab • Problem Set • Favorite browser and why • Favorite search engine and why • Questions??

  2. Collaboration Policy • On Problem Sets / Labs: • Allowed (actually, encouraged): • Talk with friends (or strangers) about problems, but write up on your own • Not Allowed: • Copying verbatim • On Exams: • Obviously, no collaboration allowed. • Exams will be open notes

  3. Big Ideas in Computer Science

  4. The secret lives of 0’s and 1’s

  5. A Simple Logic Puzzle • Frank will go to the party if Ed goes AND Dan does NOT. • Dan will go if Bob does NOT go OR if Carole goes. • Ed will go to the party if Alice AND Bob go. • Alice and Bob decide to go,but Carol stays home. • Will Frank go to the party?

  6. AND Gate (cont.) X W Z Y AND W X Y Z 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1

  7. OR Gate (cont.) OR W Z W X Y Z 0 0 0 ? 0 0 1 ? 0 1 0 ? 0 1 1 ? 1 0 0 ? 1 0 1 ? 1 1 0 ? 1 1 1 ? X Y

  8. NOT Gate NOT • “Yanni will go to the party if Xena does NOT go.” Y X Shorthand: Y X X Y 0 1 1 0 Truth Table

  9. AND AND OR Logic Puzzle Circuit Alice Ed Frank Bob Dan Carole

  10. Modified AND Gate AND A F A B C F 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 B C

  11. Can realize any Truth Table by the Universal Method AND AND AND A A B C F 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 B C A B C A B C

  12. Universal Method AND AND AND OR A B C A F B C A Combine AND gates with an OR gate. B C Build an AND gate for each 1 in the truth table

  13. Universality • For ANY Truth Table we can write down,we can make a circuit for it using only 3 Logic Gates: AND, OR, NOT • In real life, make AND/OR/NOT gatesout of Transistors

  14. Our First Abstract Tool Universal Method: Circuits for ANY Truth Table 0’s & 1’s Universal Method Computers We are here

  15. Next Time: Why are 0’s and 1’s allwe need?

  16. Why are 0’s and 1’s allwe need?

  17. Limits of the Universal Method • For how large a circuit can we realistically expect to use the Universal Method? • What do we do for larger circuits?

  18. Numeracy • How large do circuits get? • How large do truth tables get?

  19. Numeracy (cont.) X Y 0 1 1 0 1-input Truth Table 2 rows

  20. Numeracy (cont.) X Y Z 0 0 0 0 1 1 1 0 1 1 1 1 X Y 0 1 1 0 1-input Truth Table 2 rows 2-input Truth Table 4 rows

  21. Numeracy (cont.) A B C F 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 3-input Truth Table: 8 rows

  22. Numeracy (cont.)

  23. Numeracy (cont.) • Each input can be 0 or 1 : 2 possibilities. • So if there are 4 inputs, that is a total of 2 * 2 * 2 * 2 = 16 possible input values.

  24. Numeracy (cont.)

  25. Numeracy (cont.)

  26. Numeracy (cont.) • Each input can be 0 or 1 : 2 possibilities. • In general, if there are n inputs, there will be 2n possible input values.

  27. Numeracy (cont.)

  28. Powers of 2 • 2n comes up a lot in Computer Science. • Numbers to memorize: • 21 = 2, 22 = 4, 23 = 8, • 24 = 16, 25 = 32, 26 = 64, • 27 = 128, 28 = 256, 29 = 512, • 210 = 1024

  29. Powers of 2 (cont.) • 210 = 1,024 • 220 = 1,048,576 • 230 = 1,073,741,824 • 240 = 1,099,511,627,776 • 250 = 1,125,899,906,842,624 • 260 = 1,152,921,504,606,846,976

  30. Powers of 2 (cont.) • Some rough numbers: • 210 = 1,024 1,000 (103 ) • 220 = 1,048,576 1,000,000 (106 ) • 230  1,000,000,000 (109 ) • 240  1,000,000,000,000 (1012 ) • 250  1015 • 260  1018

  31. Powers of 2 (cont.) • Some rough numbers: • 210  1,000 (103 ) kilo • 220  1,000,000 (106 ) mega RAM • 230  109 giga disk • 240  1012 tera BIG disk • 250  1015 peta • 260  1018 exa knowledge

  32. Sidebar on Exabytes • It's taken the entire history of humanity through 1999 to accumulate 12 exabytes of information. By the middle of 2002 the second dozen exabytes will have been created • 1 exabytes = 50,000 times the library of congress • Floppys to make 1 exabyte would stack 24 million miles high.

  33. Powers of 2 (cont.) • 16 inputs means Truth Tablehas216 = 210 * 26 = 1,024 * 64 64,000 rows • Circuit could have 64,000 or more gates

  34. Universal Method (cont.) • What about 100 inputs: • Is it reasonable to use Universal Method on Truth Table with 100 inputs?

  35. Universal Method (cont.) • What about 100 inputs: • Is it reasonable to use Universal Method on Truth Table with 100 inputs? • 2100 1030 • Each AND/OR/NOT gate uses at least 1 transistor. • This is way beyond current technology,in fact . . .

  36. Numeracy (cont.) • State-of-the-art transistors are about.1 micrometer (mm) on a side: • Lined end-to-end, you could fit10,000,000 transistors in 1 m. ( 3 f.) • In a 1 m. by 1 m. square, you could fit100,000,000,000,000 transistors • That’s still 999,999,999,999,999, 900,000,000,000,000too few for 100 input Truth Table !

  37. No good? • How sad should we be?

  38. No good? • How sad should we be? Not very. • You just need to use many Truth Tables each having fewer inputs. • Can make an entire computer using only 16-input Truth Tables and the Universal Method! • On the other hand, must realize that in some cases, we need more efficientspecial purpose circuits than the UniversalMethod. (We won’t cover these.)

  39. Our First Abstract Tool Universal Method: Circuits for ANY Truth Table 0’s & 1’s Universal Method Computers We are here

  40. So what? • We can deal with 0’s and 1’s now, but why should we? • Answer: Because we canrepresent so many thingswith 0’s and 1’s.

  41. Meaning • In Logic, we thought of 0 and 1 as meaning True and False. • Now, we remove these connotations. • Definition: a bit is just a single variable that can be 0 or 1.

  42. Representing Information • Information in the world comes in manyforms – letters, numbers, pictures, sounds… • How can we represent these thingswith 0’s and 1’s? • Start with numbers.

  43. Representing Numbers • Before computers, in devices, numbers typically represented continuously. • e.g. Clocks:

  44. Binary Numbers • How do we count normally? • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, …19, 20, …99, 100, … 999, 1000, … • Suppose we only had two numerals – 0 and 1. • Then how would we count?0, 1, 10, 11, 100, 101, 110, …

  45. Binary Numbers (cont.) 0 1 2 3 4 5 6 7 8 0 1 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0

  46. Binary Numbers (cont.) • Addition : • 1 0 1 • + 1 1 1 • _______________

  47. Binary Numbers (cont.) • Addition – Our “basic” addition table is really easy now: • 0 + 0 = 0 • 0 + 1 = 1 • 1 + 0 = 1 • 1 + 1 = 10

  48. Binary Numbers (cont.) • Addition – just like usual: • 1 0 1 • + 1 1 1 • _______________ 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 10

  49. Binary Numbers (cont.) • Addition – just like usual: • 1 • 1 0 1 • + 1 1 1 • _______________ • 0 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 10

  50. Binary Numbers (cont.) • Addition – just like usual: • 11 • 1 0 1 • + 1 1 1 • _______________ • 0 0 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 10

More Related