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

. This question investigates cache use in different types of cache. Consider a s

ID: 3581411 • Letter: #

Question

.

This question investigates cache use in different types of cache. Consider a system of 16Kbytes of byte-addressable main memory partitioned into blocks of 128bytes each. The system has cache of size 2Kbytes. The main memory blocks are being accessed in the following order: 1, 5, 5, 7, 5, 1, 2,7, 2,5 (the numbers are in decimal). Assuming the cache is empty at the start. a. Complete the following information: Value Reason Information Block size Number of cache blocks Memory address length b. Scenario 1: The system uses directly mapped cache. i. How is the memory address to be interpreted? Value Reason Address field Word field length: Block field length: Tag field ength ii. Show whether each memory block access is a hit or a miss. Then compute R+ the hit ratio Memory Address Address Address Maps to Hit/Miss block Tag field Block field Word field cache block Total

Explanation / Answer

a) Block Size is 128 bytes which is given in description
Number of cache blocks =cache size/each block size
= 2*1024 bytes/128 bytes
= 16

b) ii)

Hit/Miss Description 1 Miss Fetched 1 and kept in cache 1 5 Miss Fetched 5 and kept in cache 5 5 Hit Already in cache 5 7 Miss Fetched 7 and kept in cache 7 5 Hit Already in cache 5 1 Hit Already in cache 1 2 Miss Fetched 2 and kept in cache 2 7 Hit Already in cache 7 2 Hit Already in cache 2 5 Hit Already in cache 2