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

Handling Cache Miss Question. You purchased a computer with the following featur

ID: 3914281 • Letter: H

Question

Handling Cache Miss

Question. You purchased a computer with the following features:

95% of all memory accesses are found in the cache.

Each cache block is two words, and the whole block is read on any miss.

The processor sends references to its cache at the rate of 109 words per second.

25% of those references are writes.

Assume that the memory system can support 109 words per second, reads or writes.

The bus reads or writes a single word at a time (the memory system cannot read or write two words at once).

Assume at any one time, 30% of the blocks in the cache have been modified.

The cache uses write allocate on a write miss.

You are considering adding a peripheral to the system, and you want to know how much of the memory system bandwidth is already used.

Calculate the percentage of memory system bandwidth used on the average in the two cases below. Be sure to state your assumptions.

a) Case 1: The cache is write through.

b) Case 2: The cache is write back.

Explanation / Answer

According to the given 95% memory accesses in cache, Missrate is 5%
So Miss rate=0.05
block size = 2 words
Frequency of memory operation from processor=109
Frequency of writes from processor= 0.25*109

Remember the point that Bus can transfer only one word at a time to processor or from the processor

Given that 30% of the blocks in the cache have been modified on an average.

Cache is write allocate
Hence,
Fraction of read hits=0.75*0.95=0.7125
Fraction of read misses=0.75*0.05=0.0375
Fraction of write hits=0.25*0.95=0.2375
Fraction of write misses=0.25*0.05=0.0125

1)Case 1:The cache is write through.

->On a read hit there is no memory access But On a read miss memorey must send 2 words to the cache.
->So on a write hit the cache must send 1 word to memory. So on a write miss memory must send 2 words to the cache, and then the cache must send 1 word to the memory.


Hence


Average words transferred=0.7125*0+0.0375*2+0.2375*1+0.0125*3 = 0.35

Average bandwidth used=0.35*109=38.15

Fraction of bandwidth used=0.35*109/109=0.35

2)Case 2: The cache is write back cache

->For a read hit there is no memory access


-> On read miss there are two possibilities as given below
a.If the replaced line is modified then cache will send 2 words to memory,and then memory will send 2 words to the cache.
b.If the replaced line is clean(no modifications) then memory will send 2 words to the cache.


->For a write hit there is no memory access


->On a write miss there are two possibilities as given below

a. If replaced line is modified then cache will send 2 words to memory, and then
memory will send 2 words to the cache
b. If replaced line is clean(no modifications) then memory will send two words to the cache

Hence we can write,

Average words transferred = 0.7125 * 0 + 0.0375 *(0.7*2 + 0.3*4) + 0.2375*0 + 0.0125*(0.7*2 + 0.3*4) = 0.13

Average bandwidth used = 0.13*109=14.17

Fractionof bandwidthused = 0.13*109/109=0.13

Comparing Case1 and Case2 we can come to a conclusion that the write through cache uses more than twice the cache-memory bandwidth of the write back cache.

So percentage of bandwidth used in case 1 is 35% and case 2 is 13%

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote