Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. You have an application whose memory access pattern is a stream and its entir

ID: 3559212 • Letter: 1

Question

1.

You have an application whose memory access pattern is a stream and its entire data set is 128kB. The data cache in your machine has a capacity of 64kB. It is word-addressable and direct-mapped with 32B lines. It is able to fetch one line at a time.

Given the access pattern: 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, ...., 32768, where each access is a 4B word.

a. What is the miss rate?

b. Can the miss rate be reduced by using a larger cache?

c. Can the miss rate be reduced if the size of the data set were reduced?

2.

You have an application whose memory access pattern is a stream and its entire data set is 1MB. The data cache in your machine has a capacity of 64kB. It is word-addressable and direct-mapped with 256B lines. It is able to fetch one line at a time.

Given the access pattern: 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40,

Explanation / Answer

Solving the first part:

a) 1)Using the concept of given cache that 32B of caches is loaded and the access is as follows, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, ...., 32768, we can understand that the misses will occur on the first instance (first cache loading) and then not occur till 32, as it cache size is 32B and then occur at 36B and so on.

So the miss ratio is calculated by estimating that the each miss occurs after 8 loadings, so the miss ratio = 1/8.

2) Yes the miss ratio can be reduced by increasing larger data cache. If it were increased to 64B for example, the miss ratio would be 1/16.

3) No, the miss rate cannot be reduced if the size of the data set were reduced. It is independent of data set size.

b) Solving 2nd part:

Similar to 1st part:

The miss ratio is = 4/256 = 1/64.

c)

64kB = 65536 B

Every block contains one word, and each word is 32b. So, 65536B * 8 = 524288b

524288/ 32 = 16384b/8 = 2048 entries.

Index: 2048= 2^11= i.e. 11 bits

Offset: Each block contains 1 word * 4B/word) = 4 = 2^2, so offset is 2bits.

Tag : 32 b-(11b+2b) = 19bits

Total Size: 2048(32b + 19b + 1b) = 106,496b

So, 16384b are actual data bits out of 106,496b. 15.38%.