Download presentation
Presentation is loading. Please wait.
Published byColleen Griffin Modified over 9 years ago
1
CPU Performance using Different Parameters CS 250: Andrei D. Coronel, MS,CEH,PhD Cand
2
CPU time = CPU clock cycles for a program X Clock cycle time = CPU clock cycles for a program Clock rate
3
CPI (Cycles per Instruction) Cycles per Instruction = CPU clock cycles for a program Instruction count Therefore: CPU clock cycles for a program = CPI * IC
4
Replace “clock cycles for a program” with (CPI*IC) CPU time = CPU clock cycles for a program X Clock cycle time = CPU clock cycles for a program Clock rate = (CPI * IC) * Clock cycle time = (CPI * IC) Clock rate
5
CPU performance is dependent on 3 factors Clock cycle time Cycles per Instruction (CPI) Instructions per program –It is difficult to change one parameter in complete isolation from others because the basic technologies involved in changing each characteristic are also interdependent
6
CPU performance is dependent on 3 factors Clock cycle time –Hardware technology and organization Cycles per Instruction (CPI) –Organization and Instruction Set architecture Instructions per program –Instruction set architecture and compiler technology
7
Another look at CPI * IC CPU clock cycles = CPI * IC Actual number of cycles per instruction multiplied by the actual number of that instruction in a program However there may be more than one type of instruction
8
This is better CPU clock cycles = Σ CPI i * IC i Where i = 1 to n
9
Formula adjustment CPU time = ( Σ CPI i * IC i ) * clock cycle time
10
Overall CPI therefore… CPI = ( Σ CPI i * IC i ) IC
11
Overall CPI therefore… CPI = ( Σ CPI i * IC i ) IC = Σ CPI i * ( IC i ) IC
12
A familiar problem FPSQR (floating pt sq root) is responsible for 20% of the exec time of a machine FP instructions are responsible for 50% of the execution time Which is faster? A.Add FPSQR hardware that can speed up this operation by 10 B.Make all FP instructions twice faster
13
Option A Fraction enhanced = 20% Speedup enhanced = 10 Speedup FPSQR = 1 (1 – 0.2) + 0.2/10) = 1.25
14
Option B Fraction enhanced = 50% Speedup enhanced = 2 Speedup FPSQR = 1 (1 – 0.5) + 0.5/2) = 1.33
15
Problem Suppose we have made the following measurement: –Frequency of all FP operation = 25% –Average CPI of FP operations excluding FPSQR = 4.0 –Average CPI of all other (non-FP) instructions = 1.33 –Frequency of FPSQR = 3% –CPI of FPSQR = 20 Assume that the two design alternatives are to reduce the CPI of FPSQR to two, or to reduce the CPI of all FP operations to 2
16
Answer CPI original = 1.33 * (1 - 0.25) + 4 * (0.25 - 0.03) + 20 * (0.03) = 2.4775 CPI new FPSQR = 1.33 * (1 - 0.25) + 4 * (0.22) + 2 * (0.03) = 1.9375 CPI new FP = 1.33 * (1- 0.25) + 2 * (0.22) + 2 * (0.03) = 1.4975 Speedup = 2.4775 / 1.4975
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.