Professional Documents
Culture Documents
MIS 6110 Assignment #1 (Spring 2015)
MIS 6110 Assignment #1 (Spring 2015)
MIS 6110 Assignment #1 (Spring 2015)
ASSIGNMENT #1
Given on: 30th January 2015
Question #2 (6 marks)
For problems below, use the information about access time for every type of memory
in the following table.
Ca
b) Find how long it takes to read a file from a disk if it takes 2 microseconds from the
cache memory.
Cache a = 2000 / 5 = 400
Cache b = 2000 / 7 = 285.7142857
Now to multiply the times accessed by DRAMs access time
Time a
400 * 50 = 20000 ns
20000 / 1000 = 20 microseconds
Time b
285.71 * 70 = 19999.7 ns
19999.7/ 1000 = 19.9997 microseconds
Approximately 20 microseconds
c) Find how long it takes to read a file from a flash memory if it takes 2 microseconds from
the cache memory.
Number of times to be accessed
Cache a = 2000 / 5 = 400
Cache b = 2000 / 7 = 285.7142857
Therefore
Time a = 400 * 5 = 2000 s
Time b = 285.71 * 15 = 4285.65 s
Question #3 (6 marks)
Consider three different processors P1, P2, and P3 executing the same instruction set with
the clock rates and CPIs given in the following table.
a) Which processor has the highest performance expressed in instructions per second?
Execution time = (instruction count * cycles per instruction) / clock rate
ic = instruction count
Processor p1 part a:
10 = ic * (5.5 * 10^ -10)
Number of instructions = 1.8 * 10^10
Processor p2 part a:
Time = (ic *1.5) / (2.5* 10^9)
1 = ic * (4.0 * 10^-10)
ic = 2.5 * 10^9
Processor p3 part a:
Time = (ic *2.2) / (4.0* 10^9)
1 = ic * (5.5 * 10^-10)
ic = 1.8 * 10^9
Processor p1 part b:
Time = (ic *1.2) / (2.0* 10^9)
1 = ic * (6.0 * 10^-10)
ic = 1.67 * 10^9
Processor p2 part b:
Time = (ic *= 0.8) / (3.0* 10^9)
1 = ic * (2.67 * 10^-10)
ic = 3.75 * 10^9
Processor p3 part b:
Time = (ic *= 2.0) / (4.0* 10^9)
1 = ic * (5.0 * 10^-10)
ic = 2.0 * 10^9
Processor P2 has the highest performance as it has more instructions per second.
b) If the processors each execute a program in 10 seconds, find the number of cycles and
the number of instructions.
From question a above we can use the value 10 instead of 1 to equate to
(Instruction count * cycles per instruction) / clock rate
Processor p1 part a:
10 = ic * (5.0 * 10^ -10)
Number of instructions = 2.0 * 10^10
CPI = cycles / instructions
= cycles / (2.0 * 10^10) = 1.5
=3.0 * 10^10 cycles
Processor p2 part a:
10 = ic * (4.0 * 10^ -10)
Number of instructions = 2.5 * 10^10
Cycles/2.5 * 10^10 = 1
2.5 * 10^10 cycles
Processor p3 part a:
10 = ic * (5.5 * 10^ -10)
Number of instructions = 1.8 * 10^10
Cycles/1.8 * 10^10 = 2.2
3.96 * 10^10 cycles
Processor p1 part b:
10 = ic * (6.0 * 10^ -10)
Number of instructions = 1.67 * 10^10
Cycles/1.67 * 10^10 = 1.2
2.004 * 10^10 cycles
Processor p2 part b:
10 = ic * (2.67 * 10^ -10)
Number of instructions = 3.75 * 10^10
Cycles/3.75 * 10^10 = 0.8
3.0 * 10^10 cycles
Processor p3 part b:
10 = ic * (5.0 * 10^ -10)
Number of instructions = 2.0 * 10^10
Cycles/2.0 * 10^10 = 2.0
4.0 * 10^10 cycles
c) We are trying to reduce the 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?
To reduce time using the 10 seconds used in question b above:
10 (10 * 0.3) = 7
Percentage increase in CPI = (100 + 20)%
=120%
=1.2 increase in CPI
Processor p1 part a:
Processor p2 part a:
7 = (2.5 * 10^10 * 1.2 * 1.0) / Clock
= 5.29 GHz
Processor p3 part a:
7 = (1.8 * 10^10 * 1.2 * 2.2) / Clock
= 6.79 GHz
Processor p1 part b:
7 = (1.67 * 10^10 * 1.2 * 1.2) / Clock
= 3.44 GHz
Processor p2 part b:
7 = (3.75 * 10^10 * 1.2 * 0.8) / Clock
= 5.14 GHz
Processor p3 part b:
7 = (2.0 * 10^10 * 1.2 * 2.0) / Clock
= 6.86 GHz
Question #4 (6 marks)
Consider two different implementations of the same instruction set architecture.
There are four classes of instructions, A, B, C, and D. The clock rate and CPI of each
implementation are given in the following table.
a) Given a program with 106 instructions divided into classes as follows: 10% class A, 20%
class B, 50% class C, and 20% class D, which implementation is faster?
Class A:
106 * .1 = 10.6 = 11
Class B:
106 * .2 = 21.2 = 21
Class C:
106 * .5 = 53 = 53
Class D:
106 * .2 = 21.2 = 21
Time = ((Ia * CPIa) + (Ib * CPIb) + (Ic * CPIc) + (Id * CPId)) / Clock
p1 part a:
((11 * 1) + (21 * 2) + (53 * 3) + (21 * 3)) / (2.5*10^9)
= 1.1 * 10^-7
p2 part a:
((11 * 2) + (21 * 2) + (53 * 2) + (21 * 2)) / (3*10^9)
= 7.067 * 10^-8
p1 part b:
= 1.19716981132
Question #5 (6 marks)
Consider two different implementations, P1 and P2, of the same instruction set. There are
five classes of instructions (A, B, C, D, and E) in the instruction set. The clock rate and CPI
of each class is given below.
Clo
ate CPI Class A CPI Class B CPI Class C CPI Class D CPI Class E
a) Assume that peak performance is defined as the fastest rate that a computer can execute
any instruction sequence. What are the peak performances of P1 and P2 expressed in
instructions per second?
Execution time = (instruction time * cycles per instruction) / clock frequency
T = 1second
Fastest execution rate = Lowest CPI Class
P1 part a:
1 = (I * 1)/(2.0 * 10^9)
1 * (2.0 * 10^9) = (I * 1)
(1 * (2.0 * 10^9))/1 = I
=2.0 * 10^9 instructions per second
P2 part a:
1 = (I * 1)/(4.0 * 10^9)
1 * (4.0 * 10^9) = (I * 1)
(1 * (4.0 * 10^9)) / 2 = I
=2.0 * 10^9 instructions per second
P1 part b:
1 = (I * 1)/(2.0 * 10^9)
1 * (2.0 * 10^9) = (I * 1)
(1 * (2.0 * 10^9))/1 = I
=2.0 * 10^9 instructions per second
P2 part b:
1 = (I * 1)/(3.0 * 10^9)
1 * (3.0 * 10^9) = (I * 1)
(1 * (3.0 * 10^9))/1 = I
=3.0 * 10^9 instructions per second
b) If the number of instructions executed in a certain program is divided equally among the
classes of instructions except for class A, which occurs twice as often as each of the others,
which computer is faster? How much faster is it?
2 Instructions for Class A, 1instruction for the rest
T = (2 * 1 + 2 + 3 + 4 + 3) / (2.0 * 10^9)
= 7.0 * 10^-9
T = (2 * 2 + 2 + 2 + 4 + 4) / (4.0 * 10^9)
=4.0 * 10^-9
P = ( 4*10^-9) / (2.0 * 10^-9) = 2.0 times faster
T = (2 * 1 + 1 + 2 + 3 + 2) / (2.0 * 10^9)
=5.0 * 10^-9
T = (2 * 1 + 2 + 3 + 4 + 3) / (3.0 * 10^9)
=4.67*10^-9
P = ( 5.0 * 10^-9) / (4.67*10^-9) = 1.07 times faster
c) If the number of instructions executed in a certain program is divided equally among the
classes of instructions except for class E, which occurs twice as often as each of the others,
which computer is faster? How much faster is it?
2 Instructions for Class E, 1instruction for the rest
T = (2 * 3 + 2 + 3 + 4 + 1) / (2.0 * 10^9)
= 8.0 * 10^-9
T = (2 * 4 + 2 + 2 + 4 + 2) / (4.0 * 10^9)
=4.5 * 10^-9
P = ( 8.0 * 10^-9) / (4.5 * 10^-9) = 1.78 times faster
T = (2 * 2 + 1 + 2 + 3 + 1) / (2.0 * 10^9)
=5.5 * 10^-9
T = (2 * 3 + 2 + 3 + 4 + 1) / (3.0 * 10^9)
=5.33 * 10^-9
P = ( 5.5 * 10^-9) / (5.33 * 10^-9) = 1.04 times faster
Question #6 (6 marks)
The table below shows instruction-type breakdown for different programs. Using this data,
you will be exploring the performance trade-offs for different changes made to an MIPS
processor.
a) Assuming that computes take 1 cycle, loads and store instructions take 10 cycles, and
branches take 3 cycles, find the execution time on a 3 GHz MIPS processor.
Program 1:
Execution time of A = ((600*1) + (200 *10) + (600*10) + (50*3)) / (3*10^9)
=600 + 2000 + 6000 + 150) / (3*10^9)
Execution time = 2.92 * 10^-6
Program 2:
Execution time of A = ((900*1) + (100 *10) + (500*10) + (200*3)) / (3*10^9)
=900 + 1000 + 5000 + 600) / (3*10^9)
Execution time = 0.0000025
b) Assuming that computes take 1 cycle, loads and store instructions take 2 cycles, and
branches take 3 cycles, find the execution time on a 3 GHz MIPS processor.
Program 1:
Execution time of A = ((600*1) + (200 *2) + (600*2) + (50*3)) / (3*10^9)
=600 + 400 + 1200 + 150) / (3*10^9)
Execution time = 7.83 * 10^-7
Program 2:
Execution time of A = ((900*1) + (100 *2) + (500*2) + (200*3)) / (3*10^9)
=900 + 200 + 1000 + 600) / (3*10^9)
Execution time = 0.0000009
c) Assuming that computes take 1 cycle, loads and store instructions take 2 cycles, and
branches take 3 cycles, what is the speedup if the number of compute instruction can be
reduced by one-half?
Program 1:
Execution time of A = ((600*1) + (200 *2) + (300*2) + (50*3)) / (3*10^9)
=600 + 400 + 600 + 150) / (3*10^9)
Execution time = 5.83 * 10^-7
Program 2:
Execution time of A = ((900*1) + (100 *2) + (250*2) + (200*3)) / (3*10^9)
=900 + 200 + 500 + 600) / (3*10^9)
Execution time = 7.33 * 10^-7