introduction - department of computer sciencephi/csf/slides/lecture-introduction.pdf · flow of...
TRANSCRIPT
Introduction
Philipp Koehn
29 August 2019
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
1Administrative
• Instructor: Philipp Koehn ([email protected])
• TA: TBD
• Class: Monday, Wednesday, Friday 10-10:50, Hackerman B17
• Textbooks (recommended, not required):– "How Computers Work", Roger Young– "Code", Charles Petzold– "Computer Organization and Design", Patterson and Hennessy– "Computer Systems", Bryant and O’Hallaron
• Course web site: http://www.cs.jhu.edu/∼phi/csf/
• Grading– 7 assignments (10% each)– midterm exam (10%)– final exam (20%)
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
2Magic?
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
3Main Topic Areas
• Digital circuits (3 lectures)
• Programmable Processor (2 lectures)
• 6502 CPU: Stack, Subroutines (4 lectures)
• Midterm
• MIPS: Branch Prediction, Cache (10 lectures)
• x86: Dynamic Linking, Virtual Memory (8 lectures)
• Threads (3 lectures)
• Networking (3 lectures)
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
4
light bulb
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
5Light Bulb
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
6Light Bulb with Switch
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
7
0 and 1
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
8What can you do with 0 and 1?
everything
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
9Math
• Encode number with binary system
decimal binary0 0
1 1
2 10
3 11
4 100
8 1000
16 1 0000
32 10 0000
64 100 0000
128 1000 0000
255 1111 1111
It’s good to know the powers of 2:
29 = 512, 210 = 1024, 211 = 2048, 212 = 4096
213 = 8192, 214 = 16384, 215 = 32768, 216 = 65536
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
10Text
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
11Images
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
12Color
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
13
Boolean operators
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
14AND
• Truth table
A B A and B0 0 0
0 1 0
1 0 0
1 1 1
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
15OR
• Truth table
A B A or B0 0 0
0 1 1
1 0 1
1 1 1
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
16NOT
• Truth table
A not A0 1
1 0
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
17All you Need is AND, OR, NOT
• Truth table
A B A * B
0 0 1
0 1 0
1 0 0
1 1 0
• Operation: not ( A or B )
(also called nor)
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
18All you Need is AND, OR, NOT
• Truth table
A B A * B
0 0 1
0 1 1
1 0 1
1 1 0
• Operation: not ( A and B )
(also called nand)
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
19All you Need is AND, OR, NOT
• Truth table
A B A * B
0 0 0
0 1 1
1 0 1
1 1 0
• Operation: ( A or B ) and not ( A and B )
(also called xor)
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
20
hardware
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
21Still Magic?
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
22
water
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
23Flow of Water
• Water is stored in bucket
• Gravity pulls water through pipe
• Core concepts
– water pressure– size of the pipe– amount of water flow per time unit
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
24More Pressure
• Bucket filled twice as much
• Double water pressure
⇒ Double water flow
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
25Bigger Pipe
• Pipe twice as big
• Twice as much water in pipe
⇒ Double water flow
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
26Electricity
• Electrons are stored in battery
• Electric field pulls electronsthrough wire
• Core concepts
– voltage = electron pressure– ampere = size of the pipe– watt = amount of electrons flowper time unit
– watt hour = amount of electrons
• 1 kWh costs about 10 cents
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
27
generating electricity
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
28Water Power
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
29Wind Power
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
30Steam Power
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
31Electric Generator
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
32Right Hand Rule
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
33Creating a Magnetic Field
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
34
circuits
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
35Light Bulb
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
36Light Bulb with Switch
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
37AND
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
38OR
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
39Electromagnet
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
40Relay
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
41Normally Closed Relay: NOT
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
42
gates
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
43Light Bulb with Switch
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
44Relay
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
45AND Gate
Symbol:
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
46OR Gate
Symbol:
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019
47NOT Gate
Symbol:
Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019