Only part B Assume the following information is gathered about a system: • 95% o
ID: 3848943 • Letter: O
Question
Only part B
Assume the following information is gathered about a system:
• 95% of all main memory accesses are found in the cache.
• 25% of references to the cache are writes.
• Each cache block is two words, and the whole block is read on any miss.
• At any time, 30% of the blocks in the cache have been modified.
• The cache uses write allocate on a write miss.
• The bus reads or writes a single word at a time (the memory system can not read or write two words at once).
A) Assuming that write-through is used, find the average number of memory accesses per CPU reference to the cache. Note that when updating the block in memory, only the modified word is written to memory, not the entire block. Hint: to find the average memory accesses per request to cache, find the number of accesses to memory on cache hits and cache misses separately. Also, you need to distinguish between read-hits, read-misses, write-hits and write-misses. Consequently, you need to fill out the following table:
B) Repeat part a, but assuming the cache uses write-back.
hit? Access Type Block dirty? Frequency Memory accesses Vg. of memory accesses Cache Read Write Yes No Read Write No TotalExplanation / Answer
b.)cache uses write-back:
Read hit = 0 (Hit means that the reference is already found in the cache, so no bus bandwidth is used in this case)
miss ratio = 1- hit ratio = 1 - 0.95 = 0.05
reads are 75% of total number of references
writes are 25% of total number of references
block size = 2 words
Read miss = 0.05 * 0.75 *107 * [ 2 * 0.3 + 2] (The term 2*0.3 refers to replacing the dirty block . We write back the dirty block and read needed block so 2 block + 2 block. )
write hit =0 (Write hit does not generate any traffic on the bus, it just makes the block in cache dirty.)
write miss = 107 * 0.05* 0.25 * [2 * 0.3 + 2] (On a write miss we have to load a block to cache and write a dirty block back to main memory, therefore 2*0.3)
therefore total bandwidth used= BW on Read hit+ BW on Read miss+ BW on Write hit+ BW used on write miss
=0 + 107 * 0.05 * 0.75 * [2 * 0.3 + 2] + 0 + 107 * 0.05 * 0.25 * [2 * 0.3 + 2]
=107 *0.195
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.