Introduction to Computer Systems 15-213/18-243, spring 2009 1st Lecture, Jan. 12th
Introduction to Computer Systems
CMPT 295
http://xkcd.com/676/
CSE351, Winter 2019
L01: Introduction, Binary
This comic illustrates how complex computer systems are, and all the things that have to happen for a program to execute
By the end of this course, you’ll understand, mm, almost half of that, but it’s the good bits
1
Why is computer systems exciting today?
Number of deployed devices continues growing, but no single killer app
Diversification of needs, architectures
2
CSE351, Winter 2019
L01: Introduction, Binary
295 serves as the foundation for these things.
Goal: fast programs, low cost (power dissipation)
Moore’s law
Past: clock speed increased every year programs automatically got faster
Today: Clock speed stays constant only creativity can make programs faster
E.g. parallel processing
295: learn how to increase speed by over 100x for some algorithms
Combination of architectural innovations and programming innovations
2
3
Personal Mobile Devices
Personal Mobile Devices
Network
Edge
Devices
CSE351, Winter 2019
L01: Introduction, Binary
4
CSE351, Winter 2019
L01: Introduction, Binary
5
CSE351, Winter 2019
L01: Introduction, Binary
6
CSE351, Winter 2019
L01: Introduction, Binary
When I started studying computer science, I was incredibly troubled by the very concept of writing programs. I was completely mind-blown every time the staff showed us something new you could do on the computer, and I remember sitting in shock and wondering “how does the computer know what I’m telling it to do….” The staff refused to answer my questions — they said with indignation “you don’t need to know how to build a car in order to drive it!” The computer was like a box of magic — a piece of metal that could somehow understand complex concepts like “truth” and recursion — concepts that philosophers and 61A students have been struggling with for centuries.
But what was perhaps more astonishing than that was that the computer knew how to reach these concepts from my words. I had actually just taken an entire philosophy class called “The Theory of Meaning” where we basically concluded that it wasn’t possible for humans to consistently communicate ideas through words, so how could the computer possibly interpret those words?!
As it turns out, since humans designed computers, it’s a lot easier to understand the way computers interpret words than the way we do.
For the moment, we’ll leave understanding the brain to cognitive and neuroscientists, linguists and philosophers. But we will take a closer look at the computer to learn how it understands us.
6
CMPT 295 is NOT about C Programming
It is about the hardware-software interface
What does the programmer need to know to achieve the highest possible performance
Languages like C are closer to the underlying hardware, unlike languages like Snap!, Python, Java
We can talk about hardware features in higher-level terms
Allows programmer to explicitly harness underlying hardware parallelism for high performance
7
CSE351, Winter 2019
L01: Introduction, Binary
Roadmap
8
car *c = malloc(sizeof(car));
c->miles = 100;
c->gals = 17;
float mpg = get_mpg(c);
free(c);
Car c = new Car();
c.setMiles(100);
c.setGals(17);
float mpg =
c.getMPG();
Java:
C:
Assembly language:
Machine code:
0111010000011000
100011010000010000000010
1000100111000010
110000011111101000011111
Computer system:
OS:
Memory & data
Arrays & structs
Integers & floats
RISC V assembly
Procedures & stacks
Executables
Memory & caches
Processor Pipeline
Performance
Parallelism
CSE351, Winter 2019
L01: Introduction, Binary
All program fragments are equivalent
You’d rather write C! (more human-friendly)
Hardware executes strings of bits
In reality everything is voltages
The machine instructions are actually much shorter than the number of bits we would need to represent the characters in the assembly language
8
Course Perspective
CMPT 295 will make you a better programmer
Purpose is to show how software really works
Understanding of some of the abstractions that exist between programs and the hardware they run on, why they exist, and how they build upon each other
Understanding the underlying system makes you more effective
Better debugging
Better basis for evaluating performance
How multiple activities work in concert (e.g. OS and user programs)
“Stuff everybody learns and uses and forgets not knowing”
CMPT 295 presents a world-view that will empower you
The intellectual and software tools to understand the trillions+ of 1s and 0s that are “flying around” when your program runs
9
CSE351, Winter 2019
L01: Introduction, Binary
Not just a course for hardware enthusiasts!
What every programmer needs to know (plus many more details)
What is this class really about ?
4 Great Ideas in Computer Science
10
CSE351, Winter 2019
L01: Introduction, Binary
10
Layers of Abstraction
Locality/Memory Hierarchy
Parallelism
Performance Measurement
11
CSE351, Winter 2019
L01: Introduction, Binary
Great Idea #1: Abstraction
(Levels of Representation/Interpretation)
12
int square(int num) {
return num * num;
}
C Program
Assembly
Logic
0x00000317
0x00830067
0xff010113
0x00112623
0x00812423
0x01010413
0xfea42a23
…….
Binary
CSE351, Winter 2019
L01: Introduction, Binary
Great Idea #2: Principle of Locality/
Memory Hierarchy
13
CSE351, Winter 2019
L01: Introduction, Binary
13
Jim Gray’s Storage Latency Analogy:
How Far Away is the Data?
Registers
On Chip Cache
On Board Cache
Memory
Disk
1
2
10
100
Tape /Optical
Robot
10
9
10
6
Whistler
This Campus
This Room
My Head
10 min
1.5 hr
2 Years
1 min
Pluto
2,000 Years
Andromeda
(ns)
Jim Gray
Turing Award
CSE351, Winter 2019
L01: Introduction, Binary
14
Great Idea #3: Parallelism
15
CSE351, Winter 2019
L01: Introduction, Binary
Great Idea #4: Performance Measurement and Improvement
Matching application to underlying hardware to exploit:
Locality
Parallelism
Special hardware features, like specialized instructions (e.g., matrix manipulation)
Latency
How long to set the problem up
How much faster does it execute once it gets going
It is all about time to finish
16
CSE351, Winter 2019
L01: Introduction, Binary
Bookmarks
Course Website: http://cs.sfu.ca/~ashriram/Courses/CS295/
Schedule, policies, materials, videos, assignments, etc.
Discussion in groups (link in course Website):
Announcements made here
Ask and answer questions – staff will monitor and contribute
Github: Homework/Assignments and Labs
17
CSE351, Winter 2019
L01: Introduction, Binary
17
Textbooks
Essential books
A good C book
All about Programming (Hilton and Bracy)
Lecture readings
Computer Architecture (RISC V edition)
David Patterson John Hennessy
Lecture readings
Extra (some modules, which we will provide)
Computer Systems: A Programmer’s Perspective
Randal E. Bryant and David R. O’Hallaron
Some labs
18
CSE351, Winter 2019
L01: Introduction, Binary
My goal as an instructor
To make your experience in CMPT 295 as enjoyable & informative as possible
Humor, enthusiasm & technology-in-the-news in lecture
Fun, challenging projects & HW
Pro-student policies (exam clobbering)
I know I speak fast when I get excited about material. I’m told every semester. Help me slow when I go toooo fast.
Please give feedback so we can improve! We will listen!!
CSE351, Winter 2019
L01: Introduction, Binary
Grading (Online version specific)
Assignments/Homework: 50% total
Autograded; Individual work only
Labs: 2.5%
Graded by TAs
Exams: Midterm (15%) and Final (30%)
Weekly quiz participation: 2.5%
EPA – 2% Extra credit. Read course page.
20
CSE351, Winter 2019
L01: Introduction, Binary
Tips for Success in 295
Attend all lectures and sections
Avoid devices during lecture please
Do the textbook readings ahead of time
Learn by doing
Can answer many questions by writing small programs
Visit Google-Groups often
Ask questions and try to answer fellow students’ questions
Go to labs (required and count for grade)
Find a study and homework group
Start assignments early
Don’t be afraid to ask questions
21
CSE351, Winter 2019
L01: Introduction, Binary
http://www.npr.org/2016/04/17/474525392/attention-students-put-your-laptops-away
21
Introductions: Course Staff
Instructors: just call me Arrvindh ()
Associate Professor at SFU
1st time teaching 295, completely revamped
Learn more about us and the staff on the course website!
Super Team:
Available in section, office hours, and on Google-Groups
An invaluable source of information and help
Get to know us
We are here to help you succeed!
22
CSE351, Winter 2019
L01: Introduction, Binary
Introductions: You!
~200 students registered, single lecture
CS majors, and more
Most of you will find almost everything in the course new
Get to know each other and help each other out!
Learning is much more fun with friends
Working well with others is a valuable life skill
Diversity of perspectives expands your horizons
23
CSE351, Winter 2019
L01: Introduction, Binary
Collaboration and Academic Integrity
All submissions are expected to be yours and yours alone
You are encouraged to discuss your assignments with other students (ideas), but we expect that what you turn in is yours
It is NOT acceptable to copy solutions from other students or to copy (or start your) solutions from the Web (including Github)
Our goal is that *YOU* learn the material so you will be prepared for exams, interviews, and the future
24
CSE351, Winter 2019
L01: Introduction, Binary
Sidenote
25
Teachers College Record Volume 114 Number 7, 2012, p. 1-23
2070
100%
Great news:
Your grandchildren WILL get As!
CSE351, Winter 2019
L01: Introduction, Binary
Yoda says…
26
“Always in motion, the future is…”
Our schedule may change slightly depending on some factors.
This includes lectures, assignments & labs…
CSE351, Winter 2019
L01: Introduction, Binary
EPA
Encourage class-wide learning!
Effort
Attending office hours, completing all assignments
Keeping up with groups activity
Participation
Making the class more interactive by asking questions in lecture, section, office hours, and on Google-Groups
Peer instruction
Altruism
Helping others in section, office hours, and on Google-Groups
27
CSE351, Winter 2019
L01: Introduction, Binary
Real-time Quizzes
Increase real-time learning in lecture, test your understanding, increase student interactions
Lots of research supports its effectiveness
Multiple choice question at end of lecture “week”
Quiz completion earns you 0.5%
You can discuss with others while taking the quiz
28
CSE351, Winter 2019
L01: Introduction, Binary
Some fun topics that we will touch on
Which of the following seems the most interesting to you?
What is a GFLOP and why is it used in computer benchmarks?
How and why does running many programs for a long time eat into your memory (RAM)?
What is stack overflow and how does it happen?
Why does your computer slow down when you run out of disk space?
What is the meaning behind the different CPU specifications? (e.g. # of cores, # and size of cache, supported memory types)
29
CSE351, Winter 2019
L01: Introduction, Binary
29
To-Do List
Admin
Explore/read website thoroughly: http://cs.sfu.ca/~ashriram/Courses/CS295
Check that you are enrolled in groups; read posts
Get your machine set up for this class (VM or CSIL) as soon as possible
Assignments
Lab 0 – First lab class
HW 1 due in 2 weeks
30
CSE351, Winter 2019
L01: Introduction, Binary
/docProps/thumbnail.jpeg