Download Lec1 - UCSB Computer Science

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Computer Architecture II
CSC/CPE 315
Where software and hardware
finally meet
Prof. Franklin
Chapter 1 – Fabrication
What is Computer Architecture?
Program
software
Architecture
Write
compilers
Design assembly
language
Design
processor
Optimize layout,
circuits, etc
Design transistor
technology
Instruction Set Architecture
• Provides a view of the computer to the
compiler/programmer
• Performance
– Compiler optimizations
– Hardware optimizations
• Price
– Implementation difficulty (labor)
– Implementation size (manufacturing)
Processor Design
• Where software and hardware meet
• Memory system, bus structure, chip
design
• High-level ISA implementation (P1 vs P2)
• Performance
– Cache size, # of func units, bells & whistles
• Price
– Implementation difficulty (labor)
– Implementation size (manufacturing)
Hardware Implementation
• Detailed logic design
• Performance
– Low-level optimizations
• Price
– Packaging technology
CPE 315 Topics
• What do high-level instructions get
compiled down to?
• How do you build a basic machine?
• How do architects specialize the hardware
to run programs quickly?
• How do programmers optimize programs
to run quickly?
How to Speak Computer
High Level Language
Program
temp = v[k];
v[k] = v[k+1];
v[k+1] = temp;
Compiler
lw $15,
lw $16,
sw $16,
sw $15,
Assembly Language
Program
0($2)
4($2)
0($2)
4($2)
Assembler
1000110001100010000000000000000
1000110011110010000000000000100
1010110011110010000000000000000
1010110001100010000000000000100
Machine Language
Program
ISA
Machine Interpretation
Hardware
ALUOP[0:3] <= InstReg[9:11] & MASK
Java
High Level Language
Program
temp = v[k];
v[k] = v[k+1];
v[k+1] = temp;
Compiler
lw $15,
lw $16,
sw $16,
sw $15,
Assembly Language
Program
0($2)
4($2)
0($2)
4($2)
Assembler
Java
1000110001100010000000000000000
1000110011110010000000000000100
Java Byte Code
1010110011110010000000000000000
1010110001100010000000000000100
ISA
Virtual Machine Interpretation
Java
Virtual Machine
ISA
Software translates each instruction
for the current hardware
Machine Interpretation
Hardware
ALUOP[0:3] <= InstReg[9:11] & MASK
Architecture
• Where software and hardware meet
• Must understand software
– Programs have certain characteristics
– Optimize design to take advantage of char.
• Must understand hardware
– Hardware design complexity
– Ease of programming
– Performance
– Power
Performance
• Not an absolute
• Depends on application characteristics
– Graphics
– General-Purpose desktop
– Scientific apps
– Servers
• Rapidly changing technology
– DRAM speed, chip density, etc.
• This is the focus of our class
But I’m CS
• Why do I have to learn about hardware?
(I hear you ask)
• Hardware is optimized to take advantage
of _________________________
• If your software is different, it can get
___________ performance
• You must _________ general architecture
to _________ for it.
• In ideal world, ________ would do this for
you.
Which is faster?
R1 = A[5];
B[6] = R1
R3 = R0 + R2
R5 = R4 – R3
R7 = R0 + R6
C[7] = R7
R1 = A[5];
R3 = R0 + R2
R7 = R0 + R6
B[6] = R1
R5 = R4 – R3
C[7] = R7
Which is faster in C/Java?
for(i=0;i<n;i++)
for(j=0;j<n;j++)
A[j][i] = i*j+7;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
A[i][j] = i*j+7;
What data structure should I use?
• Array or linked structure?
• Does it change often?
• Does it get searched often?
Growing Silicon
• Silicon is a ______
grown in a vat
• It comes out the
shape of a ______
• This is called an
________
Creating Chips
• Sliced into thin discs
called ______
• Etch grooves and
pour metal, etc
• Cut the wafer into
______ or ______
• A flaw is called a
_________
• The percentage of
good ones is _______
Price vs Cost
• Price
– Selling price
– Supply & Demand
– Little correlation to fabrication cost
• Cost
– Fabrication cost
– Design cost
Cost
• Cost per die
• Dies per wafer
• Yield
• Cheapest when Yield and Dies per wafer
are (high / low)
Current chip trends
• Shrinking Technology
–Reported in ________
–Each generation allows more to fit
in same space
–_____________ gradually falls in
time with same technology
Current chip trends
• Increasing Area effects:
–Yield – (increases / decreases)
chance of a defect on die
–Dies/wafer – (more / fewer) dies,
(more / less) wasted space
Example
• Current P4’s are 217mm2 in 0.18-micron
technology. A new 0.13-micron fab
process should cut the die area in half. If
defects occur 1 per cm2, what are the old
and new yields?
• Yield = 1 / (1 + (defectrate*area/2)) 2
OldYield:
Technology trends
• Smaller is faster, cheaper
– Faster –
– Cheaper –
• Bigger holds more
• Complexity is more accurate, but large &
expensive
New Yield:
Review: Two’s complement
• 2 -> -2 -> 2
• 0010 -> 1110 -> 0010
• Flip all the bits, add one. It works both
directions
• 5 -> -5 -> 5
• ____ ____ _____