0% found this document useful (0 votes)
11 views

Exercise 3 & 12

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Exercise 3 & 12

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Exercise 3 &

12
Phạm Nhật Minh –
23BI14298
A6 – Group 5
Given data:
 -3 different CPI measurements for a machine for 3 different
class:
 + For A, it’s 2 CPI
 + For B, it’s 5 CPI
 + For C, it’s 7 CPI
 - For code sequence 1, there are 15 millions, 5 millions and 3
millions instruction counts in class A, B and C, respectively.
 - For code sequence 2, there are 25 millions, 2 millions and 2
millions instruction counts in class A, B and C, respectively.
 - The machine’s clock rate is 500 Mhz.
 Part a) requires us to calculate the MIPS (million
instructions per second) and use it to determine whether
code sequence 1 or code sequence 2 will execute faster.
a) Which code  MIPS is calculated by a formula:
sequence will
execute faster
according to
MIPS?  We need to separately calculate the MIPS of both code
sequence, then make a comparison. The higher the MIPS
rating, the faster the sequence will execute.
 = = 3.304
 = = 2.552
===
===
 Conclusion: Since > , the code sequence 2 will execute faster.

Solution for part a)


b) How much  We already know that the code sequence 2 will execute
according to faster due to higher MIPS rating, but part b) ask that if
faster, then how much faster than sequence 1.
the execution  We need to find the execution time of both code sequence.
time of each  The execution time is calculated by a formula:
code
sequence?
 = 0.502 seconds
 = 0.378 seconds
 - = 0.502 – 0.378 = 0.124 seconds
 Conclusion: The code sequence 2 will execute faster than the code sequence 1 by approximately
0.124 seconds.

Solution for part b)


Given data:
 - Arithmetic instructions: 1 CPI
 - Load/store instructions: 12 CPIs
 - Branch instructions: 5 CPIs
 - Requirements on a single processor:
 + 2.56* arithmetic instructions
 + 1.28* load/store instructions
 + 256* branch instructions
 - When run on multiple cores, arithmetic and load/store
instructions per processor is divided by 0.7*p, but the branch
instructions remains the same.
a) Find the total
execution time for  The total execution time can be calculated by a formula:

this program for 1,


2, 4 and 8
processors, and
show the relative
speedup of the 2,  Speedup of the processor(s) relative to other processor(s) can be calculated
by a formula:
4 and 8 processor
result relative to
the single
processor result
 Calculate the total cycle used of each instructions:
= 2.56**1 = 2.56*
= 1.28**12 = 15.36*

Total cycles = + + = 19.2*


 Calculate the total execution time on a single processor:
Clock frequency = 2 GHz = 2* cycles/second
= = 9.6 seconds

Solution for part a)


.

 Calculate the total instructions for 2, 4 and 8 processors.

Solution for part a)


.

 Calculate the execution time for each processor configuration.

Solution for part a)


.

 Calculate the relative speedup.

Solution for part a)


b) If the CPI of the
arithmetic  The new CPI of the arithmetic instructions
instructions was is now 2, so we have to recalculate the
doubled, what execution time with this new CPI.
would the impact
be on the
execution time of
the program on 1,
2, 4, or 8
processors?
 Recalculate the execution time with doubled CPI for arithmetic instructions.

Solution for part b)


 Using four processors and the original CPI values, we calculated earlier that
the total execution time is 3.84 seconds
c)To what should
the CPI of
load/store
instructions be
reduced in order
for a single while using a single processor results in the total execution time to be 9.6
processor to seconds.

match the • Setting the value of the CPI of load/store instructions as x, we need to find
x so that the total execution time will reduce from 9.6 to 3.84.
performance of
four processors
using the original
CPI values?
 Calculate the new CPIs for load/store instructions

Solution for part c)


a) T1 = 9.6 seconds, T2 = 7.04 seconds, T3 = 3.84 seconds, T4 = 2.24 seconds.
b) T1’ = 10.88 seconds, T2’ = 8.32 seconds, T3’ = 4.48 seconds, T4’ = 2.56 seconds.
c) The new CPIs of the load/store instructions should be 3.25.

Conclusion

You might also like