CS 0447 Introduction to Computer Programming Luís Oliveira
Fall 2020
We Welcom lcome!
Original slides by: Jarrett Billingsley Modified with bits from: Bruce Childers, David Wilkinson
Welcom We lcome! CS 0447 Introduction to Computer Programming - - PowerPoint PPT Presentation
#0 Welcom We lcome! CS 0447 Introduction to Computer Programming Lus Oliveira Original slides by: Jarrett Billingsley Modified with bits from: Bruce Childers, David Wilkinson Fall 2020 What do I I need to know now! The classes will
CS 0447 Introduction to Computer Programming Luís Oliveira
Fall 2020
Original slides by: Jarrett Billingsley Modified with bits from: Bruce Childers, David Wilkinson
The classes will be recorded!
again
2
luisfnqoliveira.github.io/CS447
3
i before e except after c… and this guy’s name!
Textbo xtbook
4
& Hennessy)
▪ Even from seasoned professors! (I know, I’ve been there!)
5
and Services (DRS) if you haven’t already
6
1. Don’t! 2. Do not!
▪ Me! and the TAs ▪ Undergraduate Helpdesk (CRC)
7
8
Topic: Recitation get together Time: Aug 20, 2020 03:25 PM Eastern Time (US and Canada) https://pitt.zoom.us/j/95693091291 Meeting ID: 956 9309 1291 Passcode: 447meet
Topic: Recitation get together Time: Aug 21, 2020 12:00 PM Eastern Time (US and Canada) https://pitt.zoom.us/j/98887922292 Meeting ID: 988 8792 2292 Passcode: 447meet
9
10
▪ Good/bad/ugly
▪ Why? (I really want to know your reasons!) ▪ Note the question is not do you prefer (cause, ya know, we all preferred no CoViD pandemic) ▪ My opinion: There is no benefit in coming that overweighs your health.
▪ How should I distribute my office hours?
11
▪ But video will be available! ▪ If you can, attend synchronously!
▪ Have a job? some scheduling problem? Idk?
▪ First lecture, I’ll be in the classroom, you will be at home. Why? – If technical issues come, I’ll just relocate to teach remotely – You can experience how it feels (teacher in classroom, students remote)
▪ https://www.coronavirus.pitt.edu/ ▪ NO EXCEPTION (class will be dismissed)
12
13
▪ Learning the basics (here)
14
Computational Theory Algorithm Design Applications Operating Systems ISA Logic Design Electrical Design Physics more abstract more concrete
layers above and below
the computer hardware
15
▪ Also putting them back together and (hopefully) see them work!
16
17
18
They ey are old! 19
▪ Late second/early first century BC ▪ That’s like -100 ish
▪ Eclipses ▪ Astronomical positions
They ey are not (ALL) L) war machin hines es 20
▪ Programmed using perforated cards ▪ Used to produce complex patterns
Woven in silk using 24k punch cards!
The e pre-hi history story of compute puters rs 21
▪ 1792-1871
▪ It was intended as a programmable calculator ▪ A multipurpose calculator!
▪ Copying was a source of error ▪ It still is nowadays ▪ So never copy results manually if you can avoid it
22
The e pre-hi history story of compute puters rs 23
▪ YES! Designed… again!
computer
▪ Which had many modern characteristics
No actual picture because… it was never built
▪ Yeah, that one! ▪ But they probably would have worked
▪ More than the actual paper
a number series ▪ Note G
24
Part t of note e G 25
The e pre-hi history story of compute puters rs 26
▪ Hey, they just did!
responses (in 1880)
▪ It would soon take more than 10! ▪ 7,000 cards a day using this system
▪ After a merge with others
(replica) https://www.computerhistory.org/revoluti
Bub ubbles 27
▪ https://www.youtube.com/watch?v=L7jAOcc9kBU
▪ solved 30 equations in 30 unknowns
28
https://computerhistory.org/blog/first-steps-lectures-from-the-dawn-of- computing/
The first “modern” computers 29
▪ University of Pennsylvania ▪ Developed during WWII to calculate balistic missile trajectories ▪ Designed by :
▪ Joined by a huge team! ▪ Modular and reconfigurable
ENIAC (Electronic Numerical Integrator and Computer)
30
The first “modern” computers 31
▪ University of Pennsylvania ▪ The ENIAC team joined by John Von Neumann ▪ A computer with a new concept:
▪ Became operational in 1951
EDVAC (Electronic Discrete Variable Automatic Computer)
The first “modern” computers 32
▪ Cambridge University ▪ Designed by Maurice Wilkes ▪ Based on the first EDVAC draft
▪ Used for scientific research
EDSAC (Electronic Delay Storage Automatic Calculator)
https://www.tnmoc.org/edsac https://en.wikipedia.org/wiki/EDSAC
The first “modern” computers 33
▪ First commercial computer!
▪ Used MERCURY!! memory (as did the EDSAC)
UNIVAC (Universal Automatic Computer)
Delay Storage https://en.wikipedia.org/wiki/Delay_line_memory
Then en came e the e transi sisto tor 34
▪ Photo taken in the university where I did my master degree
▪ Didn’t get HOT! ▪ Didn’t break as often
https://en.wikipedia.org/wiki/Transistor
Then en came e the e Integrat tegrated ed circu cuit it 35
▪ More transistors could be fitted ▪ Cheaper circuits ▪ More affordable
2300 of these in there
36
37
82944 processors from a supercomputer Where used to simulate 1s of human brain activity In 40m
Illustration: https://www.wired.com/2013/05 /neurologist-markam-human- brain/
38
your TV can crash, your dishwasher can crash, everything can crash!
39
Some e are small and chea eap 40
▪ E.g your refrigerator
▪ For small projects
memory, GB-TB of persistent storage
productivity, media, browsing, games
41
Some e are small, , cheap eap, , and powerf werful 42
▪ Affordable, yet powerful ▪ ~$35 ▪ Can be used for A LOT of projects
Some e are small, , expensive, ensive, and powerfu erful 43
▪ I sacrificed it for you!
▪ Had to rip some parts :D ▪ Mobility is important (~1 day) ▪ Portability is important ▪ But it runs beefy apps!
We hold them em in our ur laps (does es anyon
e do that t often?) en?) 44
▪ Battery life is important
▪ Weight is important ▪ Run demanding programs!
We have e them em at home 45
▪ Wide range of prices ($300 to +$5k) ▪ Energy consumption not important
▪ Performance
That’s a Raspberry Pi My computer
machines
networking
46
We have e them em in wareho ehous uses es 47
▪ Don’t have monitors
▪ Crunch numbers and return results
48
49
The Internet
50
Control Registers Datapath Processor Memory Persistent Storage Other Peripherals Other Computers Input/Output Devices Network
51
52
10011101100110011001111101111001 11011110110010111011101001111001 10011100100110110001101111111011 lw $t0, x addi $t0, $t0, 1 sw $t0, x x=x+1 Machine language Spoken by the CPU→ Binary Assembly language Written by humans→ No abstraction High-level language Written by humans → Abstracted Closer to the hardware Easier to read
Random numbers ☺
So what t exactl ctly y is assembly ly? 53
▪ (oh wait, we still have a whole semester about it… huh)
language
▪ ARM and RISC-V are similar-ish ISA seeing much more usage
54
lea x, %eax mov 0(%eax), %ecx inc %ecx mov %ecx, 0(%eax) x=x+1 010011110111100100011 011001011100111101100 101110011010110100111 101111001000110110010 1110 1001110110011001100 1111101111001110111 1011001011101110100 1111001100111001001 1011000110111111101 1 lw $t0, x addi $t0, $t0, 1 sw $t0, x Machine language → Different for different CPUs Assembly language → Different for different CPUs High-level language → Same for different CPUs
Random numbers ☺ Random numbers ☺
is assembly embly language age us useful ful today? y? 55
56
57