0% found this document useful (0 votes)
8 views2 pages

Exercises Chapter 1

Uploaded by

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

Exercises Chapter 1

Uploaded by

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

Student name: Vũ Gia Nam

Student ID: 20235982


Exercises Chapter 1.
Exercise 1.6. Consider three different processors P1, P2, and P3 executing
the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2 has a
2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz clock rate and has a CPI
of 2.2.
a. Which processor has the highest performance expressed in instructions per second?
b. If the processors each execute a program in 10 seconds, find the number of
cycles and the number of instructions.
c. We are trying to reduce the execution time by 30%, but this leads to an increase
of 20% in the CPI. What clock rate should we have to get this time reduction?
Solution:
a)
t_1 = IC*CPI_1/f_1 = IC*0.5 ns
t_2 = IC*CPI_2/f_2 = IC*0.4 ns
t_3 = IC*CPI_3/f_3 = IC*0.55 ns
So P2 has highest performance
b)
n_1 = t*f_1 = 3*10^10 cycles
n_2 = t*f_2 = 2.5*10^10 cycles
n_3 = t*f_3 = 4*10^10 cycles
IC_1 = n_1/CPI_1 = 2*10^10 instructions
IC_2 = n_2/CPI_2 = 2.5*10^10 instructions
IC_3 = n_3/CPI_3 = 1.81*10^10 instructions
c)
0.7*(IC*CPI/f_old) = IC*(1.2*CPI)/f_new
f_new = 1.71*f_old
f1_new = 5.13
f2_new = 4.27 GHz
f3_new = 6.84 GHz
Exercise 1.7. Consider two different implementations of the same instruction set
architecture. The instructions can be divided into four classes according to their CPI
(classes A, B, C, and D). P1 with a clock rate of 2.5 GHz and CPIs of 1, 2, 3, and 3, and
P2 with a clock rate of 3 GHz and CPIs of 2, 2, 2, and 2.
Given a program with a dynamic instruction count of 1.0E6 instructions divided into
classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D, which is
faster: P1 or P2?
a. What is the global CPI for each implementation?
b. Find the clock cycles required in both cases.
Solution:
a)
Class A = ½ class B = 1/5 class C = ½ class D = 10^5
Global CPI_1 = (10^5 + 2*2*10^5 + 3*5*10^5 + 3*2*10^5)/10^6 = 2.6
Global CPI_2 = 2
b)
n_1 = CPI_1*IC =2600000
n_2 = CPI_2*IC = 2000000

You might also like