ece 15b computer organization spring 2010strukov/ece15bspring2011/new/lecture1.pdf · ece 15b...
TRANSCRIPT
ECE 15B Computer Organization
Spring 2010
Dmitri StrukovDmitri Strukov
Lecture 1: Introduction
Partially adapted from Computer Organization and Design, 4th edition, Patterson and Hennessy, and classes taught by
Patterson at Berkeley, Ryan Kastner at UCSB and Mary Jane Irwin at Penn State
Course Logistics : Instructor
Dmitri Strukov [email protected]
Office : HFH 5153Office : HFH 5153
Office hours: Tuesday – Thursday
6:45 – 7:45 pm (right after
class) or by appointment
ECE 15B Spring 2010
MMT Simulator
• Features– Assembler & Debug
– Cycle-accurate simulation
– GUI and Script support
My Own Background...
– GUI and Script support
– Detailed statistics including
runtime conflicts
• Implementation– C - 35 K lines of code
– TCL - 7 K lines of code
ECE 15B Spring 2010
Memory latency reduction with fine-grain migrating threads in NUMA shared-memory multiprocessors” (with M. Dorojevets)
in: Proc. PDCS’02, Cambridge, MA, Nov. 2002, pp. 762-767
Course Logistics : TAs
Vivek Nandakumar [email protected]
Office hours: Phelps 1435, Tuesday 2:00-3:00 pm (tentative)
Discussion session: Phelps 1425, Monday 5:00-5:50 pm
Isai Michel [email protected]
Office hours: Phelps 1435, Wednesday 2:00-3:00 pm
Discussion session: Phelps 1445, Friday 9:00-9:50 pm
ECE 15B Spring 2010
Course Logistics: Material
• URL
– Go to my web page www.ece.ucsb.edu/~dimastrukov/and click on ECE 15B link at the bottom
• Software: MIPS-32bit simulator (“SPIM”)• Software: MIPS-32bit simulator (“SPIM”)
– Both software and documentation available online for free
– Can be installed on any common platform
– See instructions on web for MACs
– Try to install that software early
ECE 15B Spring 2010
Course Logistics: Textbooks
• Required: Computer Organization and Design: The Hardware/Software Interface, Fourth Edition, Patterson and Hennessy (COD). The third edition is also accepted.
• Recommended: MIPS Assembly Language Programming, Robert L. Britton, 2003.Robert L. Britton, 2003.
• Additional (not required): The C Programming Language, Kernighan and Ritchie (K&R), 2nd edition
• C language manual webpage from Stanford University
• UCSB book store should have them all
ECE 15B Spring 2010
Course Logistics: Grading
• Homework Assignments (excluding HW #0):
10%
• Projects: 20%
• Quiz 1: 15%• Quiz 1: 15%
• Quiz 2: 15%
• Final: 40%
• Class Participation: 5%
– Attendance & discussion in class
ECE 15B Spring 2010
Course Logistics: Approximate
Schedule
• Approximate schedule on class syllabus
– 1 hw/project/quiz per week
– Hw/projects due Fridays at 11:00 pm in HFH, 3rd
floor (box labeled ECE15B)floor (box labeled ECE15B)
• Last year lecture viewgraphs will be replaced
with newest one on the day of lecture
• Hw, projects description, and solutions will be
posted on the web
(check website for HW#0 today)ECE 15B Spring 2010
Course Problems: Cheating
• What is cheating?– Turned-in work must be completely your own however studying
together in groups is encouraged
– Common examples of cheating: running out of time on assignment and then pick up output, take hw from box and copy, person asks to borrow solution “just to take a look”, copying and exam question etc.copying and exam question etc.
– Cheating on HWs: negative points for that assignments (e.g. if it is worth 10 points, you get -10)
– Cheating on projects/exams: At least, negative points for that project/exam. In most cases, F in the course
– Any instance of cheating will be referred to Office of Student Judicial Affairs
http://kiosk.ucsb.edu/AcademicServices/cheatingAtUCSB.aspx
ECE 15B Spring 2010
The Computer Revolution
• Progress in computer technology
– Underpinned by Moore’s Law
• Makes novel applications feasible
– Computers in automobiles– Computers in automobiles
– Cell phones
– Human genome project
– World Wide Web
– Search Engines
• Computers are pervasive
ECE 15B Spring 2010
Market size?
Semiconductor
industry >$1000B
Microprocessor (w.
embedded) > $100B
USA GDP ~ $14000B
(24% of worlds total)
The Rise of Embedded Computers
In millions
What is
next?
Population 6.4B in 2004, i.e. ~ 1PC, 2.2 cell phones, and 2.5 televisions for every 8 people
on the planet ECE 15B Spring 2010
Different Approaches to Computationcomputer engineers users
ge
ne
ral p
urp
os
e
Let’s make
circuits which will
compute anything
we want
architectureneed Computing
platform I want to
solve
equation
I want to
sort
numbers
problem
algorithmcode
ap
pli
ca
tio
n s
pe
cif
ic
problemalgorithmneed
input data
results
Computing
platform
ECE 15B Spring 2010
ap
pli
ca
tio
n s
pe
cif
icn
eu
rom
orp
hic
Let’s make
circuits which will
solve a particular
problem
I want to
denoise
my image
I want to
denoise
my image
problemalgorithmneed
Humans are better
than computers.
Let’s emulate
the brain
need architecture
I want to
predict the
future
I want to find
search for a
face on the web
training
problem
input data
results
input data
results
platform
Computing
platform
ASIC vs. FPGA vs. μP
FPGAμP
General Purpose Computing
GPU
ECE 15B Spring 2010
“Von-Neumann” Computer
Computer Keyboard,
Store –programmed concept was not invented by John von
Neumann only
Other inventors Presper Eckert
and John Mauchly ENIAC 1943University of Pensilvania
Processor
Computer
Control
Datapath
Memory
(where programs, data live whenrunning)
Devices
Input
Output
Keyboard,
Mouse
Display,
Printer
Disk(where programs, data live whennot running)
ECE 15B Spring 2010
Layers of Abstractions
I/O systemProcessor
Compiler
Operating
System
(Mac OSX)
Application (ex: browser)
Instruction SetArchitectureMemoryHardware
Software Assembler
ECE 15B Spring 2010
I/O systemProcessor
Digital Design
Circuit Design
Architecture
Datapath & Control
transistors
MemoryHardware
Computation is implemented using many layers of abstractions – WHY?
Moore’s Law
Predicts: 2X Transistors / chip every 2 years
Gordon Moore
Intel Cofounder
B.S. Cal 1950!
# o
f tr
an
sist
ors
on
an
inte
gra
ted
cir
cuit
(IC
)
B.S. Cal 1950!
Year
# o
f tr
an
sist
ors
on
an
inte
gra
ted
cir
cuit
(IC
)
en.wikipedia.org/wiki/Moore's_lawECE 15B Spring 2010
Technology Scaling Road Map (ITRS)
Year 2004 2006 2008 2010 2012
Feature size (nm) 90 65 45 32 22
Intg. Capacity (BT) 2 4 6 16 32
• Fun facts about 45nm transistors– 30 million can fit on the head of a pin
– You could fit more than 2,000 across the width of a human hair
– If car prices had fallen at the same rate as the price of a single transistor has since 1968, a new car today would cost about 1 cent
Technology Trends:
Uniprocessor Performance (SPECint)
1.52x/year
1.20x/year
Pe
rfo
rma
nce
(v
s. V
AX
-11
/78
0)
3X“Sea change” in chip design: multiple “cores” or processors per chip
• VAX : 1.25x/year 1978 to 1986• RISC + x86: 1.52x/year 1986 to 2002• RISC + x86: 1.20x/year 2002 to present
1.25x/year
Pe
rfo
rma
nce
(v
s. V
AX
ECE 15B Spring 2010
• Processor
– Speed 2x / 1.5 years (since ’85) [slowing!]
– 100X performance last decade
• Memory (DRAM)
– Capacity: 2x / 2 years (since ’96)
Kilo (103) & Kibi (210)
�
Mega (106) & Mebi (220)
�
Giga (109) & Gibi (230)
�
Tera (1012) & Tebi (240)
Computer Technology - Growth!
– 64x size last decade.
• Disk
– Capacity: 2x / 1 year (since ’97)
– 250X size last decade.
Tera (1012) & Tebi (240)
�
Peta (1015) & Pebi (250)
�
Exa (1018) & Exbi (260)
�
Zetta (1021) & Zebi (270)
�
Yotta (1024) & Yobi (280)
ECE 15B Spring 2010
AMD’s Barcelona Multicore Chip
Core 1 Core 2
51
2K
B L
2
51
2K
B L
2
2M
B s
ha
red
L3
Ca
che
� Four out-of-
order cores on one chip
� 1.9 GHz clock rate
� 65nm technology
http://www.techwarelabs.com/reviews/processors/barcelona/
Core 3 Core 4
Northbridge5
12
KB
L2
51
2K
B L
2
2M
B s
ha
red
L3
Ca
che
� 65nm technology
� Three levels of caches (L1, L2, L3) on chip
� Integrated Northbridge
ECE 15B Spring 2010
Compiler
Operating
System
(Mac OSX)
Application (ex: browser)
Instruction SetArchitectureHardware
Software Assembler
Layers of Abstraction
This class is about
this region
Need Many Layers to Handle ComplexityECE 15B Spring 2010
I/O systemProcessor
Digital Design
Circuit Design
Instruction SetArchitecture
Datapath & Control
transistors
MemoryHardware
Below the Program
Systems software
Applications software
Hardware
• System software– Operating system – supervising program that interfaces the
user’s program with the hardware (e.g., Linux, MacOS, Windows)
• Handles basic input and output operations
• Allocates storage and memory
• Provides for protected sharing among multiple applications
– Compiler – translate programs written in a high-level language (e.g., C, Java) into instructions that the hardware can execute
ECE 15B Spring 2010
Below the Program• High-level language program (in C)
swap (int v[], int k)(int temp;
temp = v[k];v[k] = v[k+1];v[k+1] = temp;
)
• Assembly language program (for MIPS)
C compiler
one-to-many
swap: sll $2, $5, 2
add $2, $4, $2lw $15, 0($2)lw $16, 4($2)sw $16, 0($2)sw $15, 4($2)jr $31
• Machine (object, binary) code (for MIPS)000000 00000 00101 0001000010000000
000000 00100 00010 0001000000100000
. . .
assembler
one-to-one
ECE 15B Spring 2010
Below the Program
lw $t0, 0($2)lw $t1, 4($2)sw $t1, 0($2)sw $t0, 4($2)
High Level Language Program (e.g., C)
Assembly Language Program (e.g.,MIPS)
Machine Language Program (MIPS)
Compiler
Assembler
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 Program (MIPS)
Hardware Architecture Description (e.g., block diagrams)
Machine Interpretation
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
Advantages of Higher-Level Languages ?
• Higher-level languages� Allow the programmer to think in a more natural language and for
their intended use (Fortran for scientific computation, Cobol for business programming, Lisp for symbol manipulation, Java for web programming, …)
� Improve programmer productivity – more understandable code that is easier to debug and validate
� Improve program maintainability
• As a result, very little programming is done today at the assembler level
Improve program maintainability
� Allow programs to be independent of the computer on which they are developed (compilers and assemblers can translate high-level language programs to the binary instructions of any machine)
� Emergence of optimizing compilers that produce very efficient assembly code optimized for the target machine
ECE 15B Spring 2010
ECE 15B: So what’s in it for me?
• Learning computer systems from a
programmer’s point of view
– What the programmer writes
– How it is converted to something the computer – How it is converted to something the computer
understands
– How computer interprets the program
– What makes programs go slow
ECE 15B Spring 2010
ECE 15B: So what’s in it for me?
• Learn big ideas in computer engineering
– Principle of abstraction used to build systems as layers
– 5 classic components of a computer
– Data can be anything (integers, floating point, characters): program determines what it is
– Stored program concept: instructions just data
– Principle of locality, exploited via memory hierarchy
– Greater performance by exploiting parallelism
ECE 15B Spring 2010
ECE 15B: can also help you
• Assembly Language Programming– This is a skill you will pick up as a side effect of
understanding big ideas
• Hardware Design– Hardware at the abstract level with only a little bit of – Hardware at the abstract level with only a little bit of
physical implementation details to give perspective
• Understand Language Concept– If you know one, you should be able to learn another
“low” level programming language on your own
– C constructs used in many other “higher” level programming languages
ECE 15B Spring 2010
ECE 15B: Does Not Teach
• A specific assembler language
– 486 instruction set
– ARM instruction set
– PowerPC instruction set– PowerPC instruction set
• Because technologies change so dramatically
– Learning the concepts is more important that learning the language
– Learning abstract ideas is more important that learning the specific features
ECE 15B Spring 2010
Summary
• Continued rapid improvement in computing
– May end up soon but new paradigms and concept will likely inherit a lot from traditional computer implantation, e.g. multi core
– The market for computing systems is huge – The market for computing systems is huge
• Hardware/software interface is important layer in the hierarchy to understand how computing is implemented
ECE 15B Spring 2010
Questions?Questions?
ECE 15B Spring 2010