CH 1
CH 1
CH 1
Computer Architecture
Instruction Set Architecture (architecture)
The native programming language of a processor
Assembly language
Machine language
Microarchitecture
The internal organization of a processor
Executes programs
Trade secret
CSCE 212 3
High-level language
Level of abstraction closer to problem
domain
Provides for productivity and portability
Assembly language
Textual representation of instructions
Hardware representation
Binary digits (bits)
Encoded instructions and data
Microarchitecture:
ISA implementation
Abstraction
Abstration used to manage complexity of design
Hide details that are not important
Program code
Machine
Instructions
Datapaths
Logic gates
Devices
(Transistors)
CSCE 212 5
Structural
high level of
abstraction
low level of
abstraction
Geometric
Chapter 1 Computer Abstractions and Technology 7
Functional Abstraction
For i=0 to 10
C = C + A[i]
MAR <= PC, memory_read <= 1
PC <= PC + 1
wait until ready = 1
IR <= memory_data
memory_read <= 0
Structural Abstraction
Semiconductors
Silicon is a group IV element
Forms covalent bonds with
four neighbor atoms (3D cubic
crystal lattice)
Si is a poor conductor, but
conduction characteristics may
be altered
Add impurities/dopants
replaces silicon atom in lattice
Adds two different types of
charge carriers
Spacing = .543 nm
Chapter 1 Computer Abstractions and Technology 10
Layout
3-input NAND
Feature Size
Shrink minimum feature size
Processor
Performance
Transistor Size
Transistors
1982
i286
6 - 25 MHz
1.5 mm
~134,000
1986
i386
16 40 MHz
1 mm
~270,000
1989
i486
16 - 133 MHz
.8 mm
~1 million
1993
Pentium
60 - 300 MHz
.6 mm
~3 million
1995
Pentium Pro
.5 mm
~4 million
1997
Pentium II
.35 mm
~5 million
1999
Pentium III
.25 mm
~10 million
2000
Pentium 4
.18 mm
~50 million
2005
Pentium D
2 threads/package
.09 mm
~200 million
2006
Core 2
2 threads/die
.065 mm
~300 million
2008
Nehalem
8 threads/die
.045 mm
~800 million
2009
Westmere
8 threads/die
.045 mm
~1 billion
2011
Sandy Bridge
12 threads/die
.032 mm
~1.2 billion
2013
Ivy Bridge
16 threads/die
.022 mm
~1.4 billion
Year
Processor
Speed
Transistor Size
Transistors
2008
240 threads/die
.065 mm
1.4 billion
2010
512 threads/die
.040 mm
3.0 billion
2012
1536 threads/die
.028 mm
3.5 billion
Geometric Abstraction
IC Fabrication
Si Wafer
8 Wafer
8 Wafer
1.
Performance X Performance Y
Execution timeY Execution timeX n
10s on A, 15s on B
Execution TimeB / Execution TimeA
= 15s / 10s = 1.5
So A is 1.5 times faster than B
Chapter 1 Computer Abstractions and Technology 21
Example
Assume C defects per area and a die area of D. Calculate
the improvement in yield if the number of defects is
1
reduced by 1.5.
2
1
(1 (Defects per area Die area/2))2
1.5 2 =
1
2
1+ 2
1+
2
1+ 2
2
1+
1.5 2
2 2
1 + + 4
=
2 2
1+
+ 9
1.5
CSCE 212 23
Example
1
(1 (Defects per area Die area/2))2
Assume a 20 cm diameter wafer has a cost of 15, contains 100 dies, and
has 0.031 defects/cm2.
1. If the number of dies per wafer is increased by 10% and the defects per area unit
increases by 15%, find the die area and yield.
die area20cm = wafer area / dies per wafer = pi*10^2 / (100*1.1) = 2.86 cm2
yield20cm = 1/(1+(0.03*1.15* 2.86/2))^2 = 0.9082
2.
Assume a fabrication process improves the yield from 0.92 to 0.95. Find
the defects per area unit for each version of the technology given a die
area of 200 mm2.
defects per area0.92 = (1-y^.5)/(y^.5*die_area/2) =
(1-0.92^.5)/(0.92^.5*2/2) = 0.043 defects/cm2
defects per area0.95 = (1-y^.5)/(y^.5*die_area/2) =
(1-0.95^.5)/(0.95^.5*2/2) = 0.026 defects/cm2
CSCE 212 24
Throughput
Total work done per unit time
e.g., tasks/transactions/ per hour
CPU time
Time spent processing a given job
Discounts I/O time, other jobs shares
CPU Clocking
Operation of digital hardware governed by a
constant-rate clock
Clock period
Clock (cycles)
Data transfer
and computation
Update state
CPU Time
CPU Time CPU Clock Cycles Clock Cycle Time
CPU Clock Cycles
Clock Rate
Performance improved by
Reducing number of clock cycles
Increasing clock rate
Hardware designer must often trade off clock rate against
cycle count
CPU TimeB
6s
Clock Cycles A CPU TimeA Clock Rate A
10s 2GHz 20 109
1.2 20 109 24 109
Clock RateB
4GHz
6s
6s
Chapter 1 Computer Abstractions and Technology 29
ClockRate
Instruction Count for a program
Determined by program, ISA and compiler
CPI Example
CPU Time
B I 600ps 1.2
CPU Time
I 500ps
A
CPU Time
by this much
n
Clock Cycles
Instruction Counti
CPI
CPIi
Instruction Count i1
Instruction Count
Relative frequency
Chapter 1 Computer Abstractions and Technology 32
CPI Example
Alternative compiled code sequences using
instructions in classes A, B, C
Class
IC in sequence 1
IC in sequence 2
Sequence 1: IC = 5
Clock Cycles
= 21 + 12 + 23
= 10
Avg. CPI = 10/5 = 2.0
Sequence 2: IC = 6
Clock Cycles
= 41 + 12 + 13
=9
Avg. CPI = 9/6 = 1.5
Performance Summary
Instructions Clock cycles Seconds
CPU Time
Program
Instruction Clock cycle
Performance depends on
Example
Suppose one machine, A, executes a program with an
average CPI of 2.1
Suppose another machine, B (with the same instruction set
and an enhanced compiler), executes the same program
with 25% less instructions and with a CPI of 1.8 at 800MHz
In order for the two machines to have the same performance,
what does the clock rate of the first machine (machine A)
need to be?
=
800 106
CSCE 212 35
Example
Suppose a program has the following instruction classes, CPIs,
and mixtures:
Instruction type
CPI
ratio
A
1.4
55%
B
2.4
15%
C
2
30%
Your engineers give you the following options:
Option A: Reduce the CPI of instruction type A to 1.1
Option B: Reduce the CPI of instruction type B to 1.2
Which option would you choose and why?
= .55 1.1 + .15 2.4 + .30 2 = 1.565
= .55 1.4 + .15 1.2 + .30 2 = 1.550
CSCE 212 36
Instruction count
MIPS
Execution time 106
Instruction count
Clock rate
6
Instruction count CPI
CPI
10
6
10
Clock rate
Example
Consider two different implementations, M1 and M2, of the same instruction set.
There are three classes of instructions (A, B, and C) in the instruction set. M1 has a
clock rate of 800 MHz and M2 has a clock rate of 2 GHz. The average number of
cycles for each instruction class and their frequencies (for a typical program) are as
follows:
Instruction class
A
B
C
Machine M1 CPI
1
2
4
Frequency
50%
20%
30%
Machine M2 CPI
2
3
4
Frequency
60%
30%
10%
Calculate the average CPI for each machine, M1, and M2.
Example (Cont)
How many less instructions would M1 need to execut to
match the speed of M2?
M1 => 800 * 2.1 = 1680
M2 => 2000 * 2.5 = 5000
5000/1680
CSCE 212 39
Power Trends
In CMOS IC technology
5V 1V
1000
Reducing Power
Suppose a new CPU has
85% of capacitive load of old CPU
15% voltage and 15% frequency reduction
0.85
0.52
2
Pold
Cold Vold Fold
Example
Assume:
Processor
Pentium 4
Core i5
Clock
3.6 GHz
3.4 GHz
Voltage
1.25 V
0.9 V
Dynamic P
90 W
40 W
Static P
10 W
30 W
CSCE 212 42
Example
For given processor, assume we reduce the voltage by 10%
and increase the frequency by 5%. What is the
improvement to dynamic power consumption?
2
2
=
=
.9 2 (1.05)
.9 2 (1.05)
2
1
=
=
= 1.18
.81 2 (1.05) .81(1.05)
CSCE 212 43
10
10
SPEC CPU2006
i1
Timproved
Taffected
Tunaffected
improvement factor
80
Cant be done!
20
20
n
Corollary: make the common case fast
Chapter 1 Computer Abstractions and Technology 49
Example
Use Amdahls Law to compute the new execution time for
an architecture that previously required 25 seconds to
execute a program, where 15% of the time was spent
executing load/store instructions, if the time required for a
load/store operation is reduced by 40% (amount of
improvement for load/stores = 1/.60 = 1.67).
CSCE 212 50
Example
Suppose you have a machine which executes a program
consisting of 50% multiply instructions, 20% divide
instructions, and the remaining 30% are other instructions.
Management wants the machine to run 4 times faster. You
can make the divide run at most 3 times faster and the
multiply run at most 8 times faster. Can you meet
managements goal by making only one improvement, and
which one?
CSCE 212 51
Multiprocessors
Multicore microprocessors
More than one processor per chip
Hard to do
Programming for performance
Load balancing
Optimizing communication and synchronization
Example
Assume the following instruction classes and corresponding CPIs
and dynamic execution counts:
Type
CPI Count
arithmetic
load/store
branch
+
+ =
+ +
0.7 4
CSCE 212 53
Example
Assume the following instruction classes and corresponding CPIs
and dynamic execution counts:
Type
CPI Count
arithmetic
load/store
branch
1 ++
+
+
6
.7
++
CSCE 212 54
Concluding Remarks
Cost/performance is improving
Due to underlying technology development