CSC103 How Computers Work
Notes4
Last Update:
-
Switches →
Logic Gates
- Switches
- Electromechanical relays are switches that are flipped on/off by electricity.
- Transistors are electronic switches.
- Tinkertoy Computer!
- Analogy:
- electrical voltage = water pressure.
- switch = valve
- wire = pipe
- output 1 = water flows out
- ouput 0 = no water comes out
- Think of switch opened by water pressure.
- Normally closed (n.c.)switch: acts like a NOT gate
-
-
A: input |
Output |
0 (leave closed) |
1 (water out) |
1 (pop open) |
0 (nothing out) |
- 0 in, 1 out; 1 in, 0 out
- Called NOT because false → true, true → false.
- Normally open (n.o.) switch: acts like an AND gate.
-
A: input |
B: input |
Output |
0 (leave open) |
0 (leave open) |
0 (nothing out) |
1 (shut closed) |
0 (leave open) |
0 (nothing out) |
0 (leave open) |
1 (shut closed) |
0 (nothing out) |
1 (shut closed) |
1 (shut closed) |
1 (water out) |
- Reorganized AND table:
A: input |
B: input |
Output |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
- Can make all logical operations from NOT and AND. In particular, OR
- Example in English:
- If you have either your license or your passport
- Then it is not the case that you are missing both.
- I.e., it is not the case that you both do not have your license and you do not have your passport.
- license or passport = not ( (not license) and (not passport)).
- OR table:
-
A: input |
B: input |
Output |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
- If you not-ed A and B in the AND table, you'd get the right output but with 0/1 reversed. So if you not that output, you get the OR table.
Logic Gates→
Arithmetic
- {NOT, AND, OR}→ One Bit Adder
-
A: input |
B: input |
A+B: output |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
0 |
-
- Missing the carry: Carry only when both A and B are 1.
- String many of these circuits together (usually 32) to perform binary addition.
-
Arithmetic → CPU: Central Processing Unit
- Addition circuitry: one little piece of the CPU (in ALU: Arithmetic/Logic Unit)
- Not just adding number for computation, also address computations: find address after file which is 4567B long, etc.
- Also: Multiplication circuitry.
- CPU: Fetch/Execute cycle
- Controlled by clock: 1GHz = one billion clock ticks per second.
- Instruction in "machine language," language specific to the CPU.
- One is: ADD # in Register 1 to # in Register 2.
-
CPU → Motherboard
- PC: Motherboard; Apple: Logic board; sometimes abbreviated mobo
- Includes
- CPU
- BIOS
- Clock
- CPU heat sink
- Memory chips; Slots for more memory chips
-
- Labeled Motherboard Image
- CPU Heat
- Cause: electrons colliding
- Problem: switches start failing if too hot
- Heat sink: increase surface area for more efficent cooling
-
- CPU fans.
Return to CSC103 Class Homepage: