introduction - department of computer sciencephi/csf/slides/lecture-introduction.pdf · flow of...

48
Introduction Philipp Koehn 29 August 2019 Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Upload: others

Post on 23-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

Introduction

Philipp Koehn

29 August 2019

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 2: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 3: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

2Magic?

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 4: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 5: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

4

light bulb

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 6: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

5Light Bulb

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 7: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

6Light Bulb with Switch

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 8: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

7

0 and 1

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 9: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

8What can you do with 0 and 1?

everything

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 10: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 11: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

10Text

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 12: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

11Images

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 13: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

12Color

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 14: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

13

Boolean operators

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 15: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 16: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 17: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

16NOT

• Truth table

A not A0 1

1 0

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 18: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 19: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 20: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 21: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

20

hardware

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 22: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

21Still Magic?

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 23: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

22

water

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 24: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 25: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

24More Pressure

• Bucket filled twice as much

• Double water pressure

⇒ Double water flow

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 26: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

25Bigger Pipe

• Pipe twice as big

• Twice as much water in pipe

⇒ Double water flow

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 27: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

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

Page 28: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

27

generating electricity

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 29: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

28Water Power

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 30: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

29Wind Power

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 31: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

30Steam Power

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 32: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

31Electric Generator

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 33: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

32Right Hand Rule

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 34: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

33Creating a Magnetic Field

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 35: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

34

circuits

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 36: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

35Light Bulb

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 37: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

36Light Bulb with Switch

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 38: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

37AND

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 39: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

38OR

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 40: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

39Electromagnet

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 41: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

40Relay

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 42: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

41Normally Closed Relay: NOT

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 43: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

42

gates

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 44: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

43Light Bulb with Switch

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 45: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

44Relay

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 46: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

45AND Gate

Symbol:

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 47: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

46OR Gate

Symbol:

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019

Page 48: Introduction - Department of Computer Sciencephi/csf/slides/lecture-introduction.pdf · Flow of Water 23 Water is stored in bucket Gravity pulls water through pipe Core concepts {

47NOT Gate

Symbol:

Philipp Koehn Computer Systems Fundamentals: Introduction 29 August 2019