Presentation is loading. Please wait.

Presentation is loading. Please wait.

Administrivia Any new students?

Similar presentations


Presentation on theme: "Administrivia Any new students?"— Presentation transcript:

1 Administrivia Any new students?
Has everyone been to the course web site? First assignment ready – pick it up on web Labs to begin Monday Location 007 Friend Details Pick up lab on web, read it, do it Laptops or desktops? Questions??

2 Building a computer

3 Why build a computer? Curiosity What really happens when I hit a key?
Necessity Prerequisite to parts of the course Breadth Should understand what’s changing the world

4 Why NOT build a computer?
Computers seem really complicated ! Pentium III has over 28 MILLION components How can we hope to understand them ?

5 Questions in building a house
What are the basic components 2”x4”’s, I-beams, plasterboard, .. Light fixtures, plumbing, … What is glue for combining them Nails, screws, bolts, pipes, … How do we model the process Architectural drawings, building codes, …

6 Questions in building a computer
What are the basic components Logic gates What is glue for combining them Wires to build circuits How do we model the process Architectural drawings, design rules, … Mathematical formulation

7 Details Wires are made of silicon or chemicals
Crossing wires make transistors Electrons either do or don’t flow in wires Think of light switches turning current on or off Wire thickness currently about .135 micron 1 micron = 10-6 meters Can fit 28 million transistors in less than 1”x1” Design must follow fabrication rules Non-crossing wires can’t get too close Mathematical abstraction – Boolean algebra

8 What is Abstraction? Ignoring / Hiding details to capture essential common features Example for us: We’ll ignore whether we’re talking about: A Pentium II or a Pentium III A Mac or a PC Instead, we’ll focus on what really makes a computer a computer.

9 Abstraction (cont.) Real Life Example: “Brush your teeth”
Here, we ignore: What kind of toothbrush What kind of toothpaste What you’re wearing etc. These things aren’t important! Often called hand waving

10 Abstraction (cont.) Abstraction allows us to understand things in a Modular fashion. If we had to spell out everything we did, our lives would seem really complicated. Same is true for computers. To understand them, we use abstraction. Working bottom up.

11 Layers of Abstraction Build more and more powerful tools out of simpler ones. Really Simple Stuff Computers

12 Layers of Abstraction (cont.)
Really Simple Stuff Computers Each layer corresponds to a beautiful Big Idea of computer science. These ideas are the foundation for the “digital revolution” that everyone talks about.

13 Layers of Abstraction (cont.)
Really Simple Stuff Computers For Computers, What is the “Really Simple Stuff”? Answer: “ 0’s and 1’s ”

14 The secret lives of 0’s and 1’s

15 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?

16 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? Answer: YES

17 Using 0’s and 1’s 0 = False 1 = True What do 0’s and 1’s mean?
For now, we’ll take “Natural meanings:” For example, if we have a variable Alice for whether Alice goes to the party, If Alice goes, we write Alice = 1 If Alice doesn’t, we write Alice = 0 0 = False 1 = True

18 Logic Gates Computers are circuits made of Logic Gates.
Logic gates manipulate 0’s and 1’s (False and True) by letting electrons flow or not. We’ll look at three types of Logic Gates: AND are all inputs true? OR is one input true? NOT flip the truth value

19 AND Gate AND “Truth Table”
“Zac will go to the party if Xena AND Yanni go.” X AND Z Y X Y Z F F F F T F T F F T T T “Truth Table”

20 AND Gate (cont.) AND Truth Table
“Zac will go to the party if Xena AND Yanni go.” X AND Z Y X Y Z Truth Table

21 AND Gate (cont.) AND Gate is a circuit that allows output current to flow if both inputs are flowing.

22 AND Gate (cont.) AND W Y Z X is shorthand for: W AND X AND Z Y

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

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

25 OR Gate OR Truth Table “Zac will go to the party if Xena OR Yanni go.”
X Y Z F F F F T T T F T T T T Truth Table

26 OR Gate (cont.) OR Truth Table
“Zac will go to the party if Xena OR Yanni go.” X OR Z Y X Y Z Truth Table

27 OR Gate (cont.) OR Gate is a circuit that allows output current to flow if either input is flowing.

28 OR Gate (cont.) W OR Z X Y is shorthand for: W OR X OR Z Y

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

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

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

32 NOT Gate (cont.) NOT Gate is a circuit that reverse the sense of a flow. Logical complement.

33 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?

34 Logic Puzzle Circuit AND Ed Frank Dan NOT
Frank will go to the party if Ed goes AND Dan does NOT.

35 Logic Puzzle Circuit (cont.)
Ed AND Frank Dan Frank will go to the party if Ed goes AND Dan does NOT.

36 Logic Puzzle Circuit (cont.)
Alice AND Ed AND Frank Bob Dan Ed will go to the party if Alice AND Bob go.

37 Logic Puzzle Circuit (cont.)
Alice AND Ed AND Frank Bob OR Dan Carole Dan will go if Bob does NOT go OR if Carole goes.

38 Logic Puzzle Circuit (cont.)
1 Alice AND Ed 1 AND Frank Bob OR Dan Carole Alice and Bob decide to go, but Carol stays home.

39 Logic Puzzle Circuit (cont.)
1 1 Alice AND Ed 1 1 AND Frank Bob OR Dan Carole Evaluation…

40 Logic Puzzle Circuit (cont.)
1 1 Alice AND 1 Ed 1 1 AND Frank Bob OR Dan Carole Evaluation…

41 Logic Puzzle Circuit (cont.)
1 1 Alice AND 1 Ed 1 1 AND Frank Bob OR Dan Carole Evaluation…

42 Logic Puzzle Circuit (cont.)
1 1 Alice AND 1 Ed 1 1 1 AND Frank Bob 1 OR Dan Carole Evaluation…

43 Logic Puzzle Circuit (cont.)
1 1 Alice AND 1 Ed 1 1 1 AND 1 Frank Bob 1 OR Dan Carole Evaluation Complete! Answer: Frank goes to the party.

44 Logic Puzzle Circuit (cont.)
1 Alice AND Ed 1 AND Frank Bob OR Dan 1 Carole What if: Alice, Bob, and Carol all go to the party?

45 Logic Puzzle Circuit (cont.)
1 1 Alice AND 1 Ed 1 1 1 AND Frank Bob OR 1 Dan 1 1 Carole What if: Alice, Bob, and Carol all go to the party? Answer: Frank does NOT go to the party!

46 Intermission Is it all clear? Should/Could we do another such problem?
Light controllers Light fixture has 3 switches Light is on if an odd number of the switches are on

47 Building Circuits Suppose someone gives us an arbitrary Truth Table.
Can we build a circuit which satisfies exactly that Truth Table?

48 Our Logic Puzzle Suppose we made the truth table for this 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. Suppose we made the truth table for this puzzle.

49 Logic Puzzle Circuit AND AND OR Alice Ed Frank Bob Dan Carole
The full circuit for the Logic Puzzle.

50 Logic Puzzle Circuit (cont.)
Alice Bob Carole Frank Note: Frank goes only if A=B=1 and C=0 Truth Table for Logic Puzzle

51 Recall: AND Gate AND A F A B C F B 0 0 0 0 0 0 1 0 C 0 1 0 0 0 1 1 0

52 Modified AND Gate AND A F A B C F B 0 0 0 0 0 0 1 0 C 0 1 0 0 0 1 1 0
B C

53 Modified AND Gate AND A F A B C F B 0 0 0 0 0 0 1 0 C 0 1 0 0 0 1 1 0
B C Note: Frank goes only if A=B= and C=0. The modified AND also solves the Logic Puzzle!

54 Modified AND Gate AND ? A F A B C F B 0 0 0 0 0 0 1 0 C 0 1 0 0
B C ?

55 Sure … A AND F A B C F B C

56 Similarly… A AND F A B C F B C Similarly, we can make a circuit for any Truth Table with only a single 1 in its output.

57 Given Any Truth Table… First, make circuits for each row in Truth Table with a 1 in the output. A B C F

58 Any Truth Table (cont.) AND AND AND A A B C F 0 0 0 0 0 0 1 1 0 1 0 1
B C A AND B C A AND B C

59 Any Truth Table (cont.) Finally, combine them with an OR gate. AND F

60 Any Truth Table (cont.) AND F AND OR
The only way for F=1 is if at least ONE of AND gates outputs 1. But each AND gate corresponds to a row in the Truth Table with a 1 in the output! A AND B C

61 Any Truth Table (cont.) A B C F 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0

62 Another Example First, make circuits for each row in Truth Table with a 1 in the output. A B C X

63 Another Example (cont.)
AND A B C X B C A AND B C

64 Another Example (cont.)
AND Finally, combine them with an OR gate. B C OR X A AND B C

65 Another Example A B C X

66 Universality Note same idea works no matter how many input variables.
So for ANY Truth Table we can write down, we can make a circuit for it using only 3 Logic Gates: AND, OR, NOT This gives us a very powerful tool ! Our first technical use of abstraction: “Make a circuit for that Truth Table.” is something we can abstract and understand.

67 Further Issues Some issues to think about on your own
We know that AND,OR, and NOT are “universal” – we can make a circuit for any Truth Table using just these gates ! What else is universal? Surprising answer: There is a single gate called “NAND” which is universal all by itself !

68 NAND Gate NAND AND Truth Table X Z Y X Z Y X Y Z 0 0 1 0 1 1 1 0 1
Truth Table

69 NOT from NAND Gate NAND Fix Y at 1 NAND Truth Table Truth Table X Z Y
X Y Z 1 X Y Z Truth Table Truth Table

70 Further Issues (cont.) Some issues to think about on your own (if you want): We saw two circuits for the Logic Puzzle that both worked – but one (the modified AND) was much simpler than the other. Can you come up with methods for simplifying circuits? This is important for efficiency when you are dealing with very very large Truth Tables (which we will be in the future).

71 Why are 0’s and 1’s all we need?
Next Time: Why are 0’s and 1’s all we need?


Download ppt "Administrivia Any new students?"

Similar presentations


Ads by Google