Computer Architecture Lab1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Phạm Nhật Phương-1752042

LAB 1
Question 1:
a) Instruction per second:
P1 : (3*109)/1.5 = 2*109 instruction per second
P2 : (2.5*109)/1 = 2.5*109 instruction per second
P3 : (4*109)/2.2 = 1.8*109 instruction per second
Conclusion: P2 has the highest performance expressed in instruction per
second
b) Number of cycles:
P1: 3GHz * 10 = 3 * 10^10 cycles
P2: 2.5GHz * 10 = 2.5 * 10^10 cycles
P3: 4GHz * 10 = 4 * 10^10 cycles
Number of instructions:
P1: 3GHz * 10 / 1.5 = 2 * 1010 instructions
P2: 2.5GHz * 10 / 1.0 = 2.5 * 1010 instructions
P3: 4GHz * 10 / 2.2 = 1.82 * 1010 instructions
c)
Execution time = (Number of instructions * CPI) / (Clock rate)
By reducing the execution time by 30%, and CPI increases by 20%, we
have:
Execution time x 0.7 = (Number of instructions * CPI * 1.2) / (New clock
rate)
 New clock rate = Clock rate * 1.2 / 0.7 = 1.71 * Clock rate
P1: 3GHz * 1.71 = 5.13 GHz
P2: 2.5GHz * 1.71 = 4.27 GHz
P3: 4GHz * 1.71 = 6.84 GHz
Question 2:
a)
IPC-new = 1/CPI-old = Number of instructions/ (time * clock rate)
P1 = (20 )/(7 * 3) = 0.952 IPC
P2 = (30)/(10 * 2.5) = 1.2 IPC
P3 = (90)/(9 * 4) = 2.5 IPC
b)
Find the clock rate for P2 that reduces its execution time to that of P1.
Time-new/Time-old = 7/10 = 0.7
Clock rate-new = Clock rate-old/0.7 = 2.5 GHz/0.7 = 3.57 GHz
c)
Find the number of instructions for P2 that reduces its execution time to that
of P3.
Time-new/Time-old = 9/10 = 0.9.
Instructions-new = Instructions-old * 0.9 = (30 * 109)* 0.9 = 27 × 109
Question 3:
a) CPU time: Sum of (ICs * CPI) / Clock Rate
P1 = (106 * (0.1* 1 + 0.2 * 2 + 0.5 * 3+ 0.2 * 3)) /2.5 * 109 = 1.04 * 10-3
second
P2 = (106 * 2 * (0.1 + 0.2 +0.5 +0.2)) / 3 *109 = 0.67 *10-3 second
P2 is Faster

b) Global CPI = (CPU time * Clock Rate) / Instructions


P1 = (1.04 * 10-3 * 2.5 * 109) / 106 = 2.6
P2 = (0.67 * 10-3 * 3 * 109) / 106 = 2.01

c) Clock Cycle = Global CPI * Instructions


P1 = 2.6 * 106
P2 = 2.01 * 106

Question 4:
a)
CPU time = Sum of (ICs * CPI) / Clock Rate
Execution time = 1000 * (0.2 *2.5 + 0.1 * 1 +0.2 * 1.5 + 0.5 * 2) / 2 * 109=
9.5 *10-7 (s)
b)
Average CPI = 0.2 *2.5 + 0.1 + 0.2 * 1.5 + 0.5 *2 = 1.9
c)
CPU time new = 1000 * (0.2 *2.5/2 + 0.1 * 1 +0.2 * 1.5 + 0.5 * 2) / 2 *
10^9 =
8.25 * 10-7 (s)
Speed up = CPU time / CPU time new = 1.15
Question 5:
Original model:
CPI original = Sum of (CPIi*ICi/IC)=4 * 25% + 1.33 * 75% =1.9975
Model 1:
CPI (new FPSQR) = CPI original – 2% *(CPI FPSQR – CPI new FPSQR)
= 1.9975 – 2%*(20-2)=1.6375
Model 2:
CPI (new FQ) = 1.33 * 75% + 25% * 2.5 = 1.6225
Model 2 is more effective: H2/H1=CPI1/CPI2=1.009
Question 6:
a) CPU time /CPU new time = 2
So 50 * x + 110 *1 + 80 *4 + 16 *2 = 1/2* (50 * 1 + 110 *1 + 80 *4 + 16
*2)
x = - 4.12 Cannot reduce the CPI of FP
b) 50 * 1 + 110 *1 + 80 *x + 16 *2 == 1/2* (50 * 1 + 110 *1 + 80 *4 + 16
*2 )
x= 0.8 Reduce the CPI of L/S by 80%
c) (50 * 1 + 110 *1 + 80 *4 + 16 *2) /(50 * 1*0.6 + 110 *1*0.6 + 80 *4*0.7
+ 16 *2 *0.7) = 1.495
So the time reduces 33.125%

You might also like