View from the Top
Instructors: Rebecca Herman and Steven Ho
Administrivia
CS61C Su17 - Lecture 27
2
8/8/2017
Powers of Ten-inspired View of 61C
CS61C Su17 - Lecture 27
3
8/8/2017
The Dalles, Oregon
CS61C Su17 - Lecture 27
4
8/8/2017
104
meters
11,100 meters (across city)
Google’s Oregon WSC
CS61C Su17 - Lecture 27
5
8/8/2017
103
meters
103
meters
102
meters
1,100 meters (around facility)
Containers in WSCs
CS61C Su17 - Lecture 27
6
8/8/2017
102
meters
100 meters (all containers)
Google Server Array
CS61C Su17 - Lecture 27
7
8/8/2017
101
meters
10 meters (container)
Google Rack
CS61C Su17 - Lecture 27
8
8/8/2017
100
meters
3 meters (tall)
Google Server Internals
CS61C Su17 - Lecture 27
9
8/8/2017
10-1
meters
0.45 meters
Central Processing Unit (CPU)
CS61C Su17 - Lecture 27
10
8/8/2017
10-2
meters
3 centimeters
Processor
CS61C Su17 - Lecture 27
11
8/8/2017
10-2
meters
1 centimeter
L3
(L3)
CPU Core
CS61C Su17 - Lecture 27
12
8/8/2017
10-3
meters
3 millimeters
CMOS Gate
CS61C Su17 - Lecture 27
13
8/8/2017
10-6
meters
2 micrometers
What is CS61C About?
CS61C Su17 - Lecture 27
14
8/8/2017
CS61C For Software Development
CS61C Su17 - Lecture 27
15
8/8/2017
Quote (Medium blog post)
“Software is so bad because it’s so complex, and because it’s trying to talk to other programs on the same computer, or over connections to other computers. Even your computer is kind of more than one computer, boxes within boxes, and each one of those computers is full of little programs trying to coordinate their actions and talk to each other.”
“Your average piece-of-shit Windows desktop is so complex that no one person on Earth really knows what all of it is doing, or how.”�
CS61C Su17 - Lecture 27
16
8/8/2017
Course Learning Objectives
CS61C Su17 - Lecture 27
17
8/8/2017
Course Learning Objectives
CS61C Su17 - Lecture 27
18
8/8/2017
61C Mission Statement
“CS61C introduces students to foundational concepts that form the backbone of different branches of computer science such as computer architecture, low-level software, computer security, and large-scale computing. This course demystifies some of the vulnerabilities inherent in abstraction barriers that programmers of all levels confide in when the performance and correctness of high-level code is under fire. After taking this course, students will be able to see computing through a bit-level perspective and understand the central trade-offs and choices involved in making fast hardware and software of all levels that work together efficiently and safely.”
—Rebecca and Steven
CS61C Su17 - Lecture 1
19
6/19/2017
Number Representation
CS61C Su17 - Lecture 27
20
8/8/2017
opcode
funct
rs
rt
rd
shamt
S
Exponent
Mantissa
31 30
23 22
0
1 bit
8 bits
23 bits
Levels of Interpretation
lw $t0, 0($2)
lw $t1, 4($2)
sw $t1, 0($2)
sw $t0, 4($2)
CS61C Su17 - Lecture 27
21
8/8/2017
Higher-Level Language�Program (e.g. C)
Assembly Language Program (e.g. MIPS)
Machine Language Program (MIPS)
Hardware Architecture Description�(e.g. block diagrams)
Compiler
Assembler
Machine Interpretation
temp = v[k];
v[k] = v[k+1];
v[k+1] = temp;
0000 1001 1100 0110 1010 1111 0101 1000
1010 1111 0101 1000 0000 1001 1100 0110
1100 0110 1010 1111 0101 1000 0000 1001
0101 1000 0000 1001 1100 0110 1010 1111
Logic Circuit Description�(Circuit Schematic Diagrams)
Architecture Implementation
Higher-Level Language (HLL)
CS61C Su17 - Lecture 27
22
8/8/2017
Assembly Language
CS61C Su17 - Lecture 27
23
8/8/2017
EVERY COMMAND IS DIRECTLY IMPLEMENTED IN THE HARDWARE
CS61C Su16 - Lecture 8
24
6/30/2016
Memory
Loader
Executable (mach lang pgm): a.out
Linker
Object (mach lang module): foo.o
Assembler
Assembly program: foo.s
Compiler
C program: foo.c
lib.o
Machine Language
CS61C Su17 - Lecture 27
25
8/8/2017
Pipelined Instruction Execution
CS61C Su17 - Lecture 27
26
8/8/2017
1. Instruction
Fetch
2. Decode/
Register Read
3. Execute
4. Memory
5. Write
Back
PC
instruction
memory
+4
Register
File
rt
rs
rd
ALU
Data
memory
imm
MUX
27
The Memory Hierarchy
CS61C Su17 - Lecture 27
28
8/8/2017
Trade-off in speed and cost vs. capacity!
Increasing distance from application/user
Based on the principle of locality!
CACHES
29
Tag
Index
Offset
31
T
I
O
Cache
Addr
miss
hit
data
CPU
Main Memory
Memory
CS61C Su17 - Lecture 27
30
8/8/2017
code
static data
heap
stack
~ FFFF FFFFhex
~ 0hex
Accessing Memory
CS61C Su17 - Lecture 27
31
8/8/2017
TLB Tag
TLB Index
Page Offset
VPN
PPN
Page Offset
Tag
Index
Offset
Physical Address
Virtual Address
To TLB:
From TLB:
To Cache:
Cache
VA
PA
miss
hit
block
hit
miss
CPU
Main Memory
TLB
Page Table
Disk
page
fault
Data Management
CS61C Su17 - Lecture 27
32
8/8/2017
Input/Output
CS61C Su17 - Lecture 27
33
8/8/2017
Performance
CS61C Su17 - Lecture 27
34
8/8/2017
Performance Measurements
CS61C Su17 - Lecture 27
35
8/8/2017
Parallelism
CS61C Su17 - Lecture 27
36
8/8/2017
Smart�Phone
Warehouse Scale Computer
Leverage�Parallelism &
Achieve High�Performance
Core
…
Memory
Input/Output
Computer
Core
Assigned to computer
e.g. search “assembler.c”
Assigned to core
e.g. lookup, ads
> 1 instruction @ one time
e.g. 5 pipelined instructions
> 1 data item @ one time
e.g. add of 4 pairs of words
All gates functioning in parallel at same time
Software Hardware
Cache Memory
Core
Instruction Unit(s)
Functional
Unit(s)
A0+B0
A1+B1
A2+B2
A3+B3
Logic Gates
Types of Parallelism
CS61C Su17 - Lecture 27
37
8/8/2017
Thread-Level Parallelism Concerns
CS61C Su17 - Lecture 27
38
8/8/2017
What’s Next? Classes
CS61C Su17 - Lecture 27
39
8/8/2017
Operating
Systems
Security
Languages & Compilers
Databases
Software
Engineering
Computer
Architecture
Digital Systems
Design
HARDWARE
SYSTEMS
SOFTWARE
APPLICATIONS
EECS
151
EECS
149
Embedded
Systems
Becoming a Part of CS61C
CS61C Su17 - Lecture 27
40
8/8/2017
Lab Assistant
Tutor
TA
Making as much of college as is humanly and healthily reasonable
CS61C Su17 - Lecture 27
41
8/8/2017
On the Shoulders of Giants
Many thanks to the main architects of CS61C:
CS61C Su17 - Lecture 27
42
8/8/2017
Brian
Harvey
Dan
Garcia
Randy
Katz
David
Patterson
Lab Assistants
CS61C Su17 - Lecture 27
43
8/8/2017
Your TAs
44
Zubeezy: Head TA
Derk: Head TA
Nick
Nikh
Ryan
Alex
Your TAs
45
Zubair: Head TA
Derek: Head TA
Ryan
Nikhil
Nick
Alex
Your Tutors
46
Megan
Chris
Ann
Damon
Keyhan
Lance
Ask Us Anything
CS61C Su17 - Lecture 27
47
8/8/2017
Good Luck!
CS61C Su17 - Lecture 27
48
8/8/2017