Lecture 8
Lecture 8
Lecture 8
Web Site
crystal.uta.edu/~cse3322
TEST 1 – Tuesday March 3
Lectures 1 - 8, Ch 1,2
• HW Due Feb 24
– 1.4.1 p.60
– 1.4.4 p.60
– 1.4.6 p.60
– 1.5.2 p.60-61
– 1.5.4 p.61
– 1.5.5 p.61
CPI
“Average clock cycles per instruction”
CPI = Clock Cycles / Instruction Count
= (CPU Time * Clock Rate) / Instruction Count
Typical Mix
Example (RISC
processor)
Base Machine (Reg / Reg)
Op Freq Cycles F(i)CPI(i) % Time
ALU 50% 1 .5
Load 20% 5 1.0
Store 10% 3 .3
Branch 20% 2 .4
Typical Mix
2.2 = CPI ave
Example (RISC processor)
Base Machine (Reg / Reg)
Op Freq Cycles F(i)CPI(i) % Time
ALU 50% 1 .5
Load 20% 5 1.0
Store 10% 3 .3
Branch 20% 2 .4
Typical Mix
2.2 = CPI ave
2.2/1.6 = 1.375
Instruction Count
MIPS =
Execution time x 10 6
A popular performance metric is MIPS, the number
of millions of instructions per second.
Instruction Count
MIPS =
Execution time x 10 6
Instruction Count
MIPS =
Execution time x 10 6
Instruction Count
MIPS =
Execution time x 10 6
• Example:
Suppose a program runs in 100 seconds on a
machine, with multiply responsible for 80 seconds of this
time. How much do we have to improve the speed of
multiplication if we want the program to run 4 times
faster?
Amdahl's Law
Execution Time After Improvement =
Execution Time Unaffected +
( Execution Time Affected / Amount of Improvement )
• Example:
Suppose a program runs in 100 seconds on a machine, with
multiply responsible for 80 seconds of this time. How much do
we have to improve the speed of multiplication if we want the
program to run 4 times faster?
Improved Time = (100 – 80) + 80/n = 100/4
Amdahl's Law
Execution Time After Improvement =
Execution Time Unaffected +
( Execution Time Affected / Amount of Improvement )
• Example:
Suppose a program runs in 100 seconds on a machine, with
multiply responsible for 80 seconds of this time. How much do we have
to improve the speed of multiplication if we want the program to run 4
times faster?
Improved Time = (100 – 80) + 80/n = 100/4
20 + 80/n = 25
80 = 5n ; n = 16
Amdahl's Law
Execution Time After Improvement =
Execution Time Unaffected +
( Execution Time Affected / Amount of Improvement )
• Example:
Suppose a program runs in 100 seconds on a
machine, with multiply responsible for 80 seconds of this
time. How much do we have to improve the speed of
multiplication if we want the program to run 4 times faster?
How about making it 5 times faster?
Amdahl's Law
Execution Time After Improvement =
Execution Time Unaffected +
( Execution Time Affected / Amount of Improvement )
• Example:
Suppose a program runs in 100 seconds on a machine, with
multiply responsible for 80 seconds of this time. How much do
we have to improve the speed of multiplication if we want the
program to run 4 times faster?
How about making it 5 times faster?
Improved Time = (100 –80) + 80/n = 100/5
Amdahl's Law
Execution Time After Improvement =
Execution Time Unaffected +
( Execution Time Affected / Amount of Improvement )
• Example:
Suppose a program runs in 100 seconds on a machine, with multiply
responsible for 80 seconds of this time. How much do we have to improve
the speed of multiplication if we want the program to run 4 times faster?
How about making it 5 times faster?
Improved Time = (100 –80) + 80/n = 100/5
20 + 80/n = 20
80/n = 0 Impossible!
Remember