Académique Documents
Professionnel Documents
Culture Documents
Engineering Faculty
Department of Computer Engineering
ECOM 3010: Computer Architecture Discussion
Chapter 4
Exercises with solutions
November, 2013
2 Computer Architecture Discussion
For P1:
Performance M2/Performance M1 = Execution time M1/ Execution time M2
= (2 sec/1.5 sec) = 4/3
M2 is 4/3 times as fast asM1.
For P2:
Performance M1/Performance M2 = Execution time M2/ Execution time M1
= (10 sec/5 sec) = 2
M1 is 2 times as fast asM2.
For P1 on M1:
The execution rate = number of instructions / time
= 5 109 instructions /2 seconds = 2.5 109 IPS
For P1 on M2:
The execution rate = number of instructions / time
= 6 109 instructions /1.5 seconds = 4 109 IPS
3 Computer Architecture Discussion
The ideal instruction sequence for P1 is one composed entirely of instructions from class A
(which have CPI of 1).
So P1's peak performance is (4 109 cycles/second) / (1 cycle/instruction) = 4000 MIPS.
The ideal sequence for P2 contains only instructions from A, B, and C (which all have a CPI of 2).
So P2's peak performance is (6 109 cycles/second) / (2 cycles/instruction) = 3000 MIPS.
CPI = Execution time (second) clock rate (cycles/second) / number of instructions (Instructions)
CPI of P1 on M1 is
(2.0 seconds) (4 109 cycles/second) / (5 109 instructions) = 1.6 CPI
CPI of P1 on M2 is
(1.5 seconds) (6 109 cycles/second) / (6 109 instructions) = 1.5 CPI.
6 Computer Architecture Discussion
We have the CPI, the clock rate, and the total execution time, and we're trying to find the total
number of instructions. Using the following equation:
Instructions = Execution time (second) clock rate (cycles/second) / CPI (Cycles/instruction)
instructions in P2 on M1 is
(5.0 seconds) (4 109 cycles/second) / (1.6 Cycles/ instructions) = 12.5 109 instructions
instructions in P2 on M2 is
(10.0 seconds) (6 109 cycles/second) / (1.5 Cycles/ instructions) = 40 109 instructions
Best Wishes