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

this is a question from computer organization and design book 4th edition. i nee

ID: 3581769 • Letter: T

Question


this is a question from computer organization and design book 4th edition. i need solution please

Consider a system has a main memory and a cache with directed-mapping orgarnization 1) The main memory is byte-addressable with 16-bit address 2) The least significant 3 bits of the address of the main memory is used as the index of the cache 3) Each block of the cache contains two bytes of data Questions a) How many blocks does the cache contain? b) For each cache block, how is the size for its valid bits part, tag part and data part?

Explanation / Answer

The cache is divided into groups of blocks, called sets.

If each set has 2x blocks, the cache is an 2x-way associative cache

1)

#blocks = Capacity / block size = 2^16 / 2*8 =2^12.

Number of blocks=2^60

#sets = #blocks / #ways = 2^12 / 2^3 = 2^9.

associative =(16*2*8)/2=16*8=This is a 128-way set-associative cache

3)

Overall cache size= sets* block size* associative=2^9*2*8*128=2^20

2)

TAG

LINE

BLOCK

Block = log2 (16) = log2 (24) = 4 bits (note that the log-base2 of a power of two is its power!)

Line = log2 (220/2) = log2 (219) = 19 bits?( Line = log2 (CacheSize/BytesPerLine) = number of bits needed to represent max line)

Tag = 32 - 19- 4 = 9 bits(Tag = 32 - Line - Block = 32 bits minus the number of bits needed for the line and the block).

TAG

LINE

BLOCK