Due date: On or before Monday, February 12, 2024 Absolutely no copying others’ works |
Name: _____Professor Hu_____ |
Processor | Clock Rate | CPI |
---|---|---|
P1 | 2.5 GHz | 2.0 |
P2 | 2.0 GHz | 1.5 |
Clock rate ÷ CPI ⇒ (cycles/second) ÷ (cycles/instruction) = instructions/second Clock rateP1 ÷ CPIP1 = ( 2.5×109 ) ÷ 2.0 = 1.25×109 instructions/second Clock rateP2 ÷ CPIP2 = ( 2.0×109 ) ÷ 1.5 = 1.33×109 instructions/secondTherefore, P2 has the higher performance.
Number of instructionsP1 = 1.25×109 instructions/second × 15 seconds = 1.875 × 1010 instructions Number of instructionsP2 = 1.33×109 instructions/second × 15 seconds = 1.995 × 1010 instructions Number of clock cyclesP1 = Number of instructionsP1 × CPI = 1.875×1010 instructions × 2.0 cycles/instruction = 3.75×1010 cycles Number of clock cyclesP2 = Number of instructionsP2 × CPI = 1.995×1010 instructions × 1.5 cycles/instruction = 2.9925×1010 cycles
Execution timenew = Execution timeold × 0.85 = 15 seconds × 0.85 = 12.75 seconds CPInew = CPIold × 1.10 CPIP1 = 2.0 × 1.10 = 2.20 CPIP2 = 1.5 × 1.10 = 1.65 Clock rate = Number of instructions × CPI ÷ Execution time Clock rateP1 = (1.875×1010 instructions) × (2.20 cycles/instruction) ÷ (12.75 seconds) = 3.24×109 cycles/second = 3.24 GHz Clock rateP2 = (1.995×1010 instructions) × (1.65 cycles/instruction) ÷ (12.75 seconds) = 2.58×109 cycles/second = 2.58 GHz
Compiler A | Compiler B | ||
---|---|---|---|
Instruction count | Execution time | Instruction count | Execution time |
2.0×109 | 2.0 s | 1.0×109 | 2.5 s |
TA/Tn
where
TA
: the execution time by using the A compiler and
Tn
: the execution time by using the new compiler.