104k views
7 votes
Assume that the execution time for a program is directly proportional to instruction access time. The access to an instruction in the cache is 10 times faster than access to an instruction in the main memory. If an instruction is not found in the cache, i.e., cache miss, it is fetched from the main memory to the cache and then fetched from the cache to be executed. Assume that a requested instruction will cause cache miss has a probability of 0.08. Let the speedup factor is defined as the ratio of program execution time without the cache to program execution time with the cache.

a. Calculate the speedup factor to execute such a program.
b. using this assumption, assuming that the cache is 20 times faster than the main memory.

1 Answer

10 votes

Answer:

a. 5.81

B. 7.93

Step-by-step explanation:

A.

X is the time it takes to load instructions from cache

10X = time to execute program

0.08 = probability of cache instructions

1-0.08 = 0.92(92% instructions are going to be loaded from cache).

Tc = time to execute with cache

Tc = 0.92X+0.08x10X

= 0.92X+0.8X

= 1.72X

Speed factor = tm/tc

= 10X/1.72X

= 5.81

B.

If cache is 20 times faster

Tm = 20X

Tc = 0.92X + 0.08 x 20X

= 0.92X + 1.6X

= 2.52X

Speed factor = 20X/2.52X

= 7.93

User Lidkxx
by
5.2k points