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

byte-addressable computer that has 16bit address, a cache with capability of sto

ID: 3653630 • Letter: B

Question

byte-addressable computer that has 16bit address, a cache with capability of storing 2K bytes of data, and blocks of 8 byte. Including field name and sizes, show the format of a 16-bit memory address for: a) Direct mapped b) Fully associative c) 4 way set associative I already have answers for a.) b.) and c.) i just need to get d.) i dont know how to map with the three techniques >>>>> >> d) Where ( block or set) in cache would the memory address BAD016 be mapped for each of three mapping technique above? If you wish, you can specify the answer in decimal.

Explanation / Answer

Block Size = 8 bytes
so offset consists of 3 bytes because 2^3 = 8.
cache size = 2^11
number of blocks = cache size / block size = 2^8

a ) for direct mapping

offset bit = 3

block bits = 8

tag = 16 - 8 - 3 = 5

b ) for 2-way set associative
Number of sets in cache = Cache size/(Set size * Block size)
            = 2^11 / ( 2 * 2^3)

            = 2^7
offset bit = 3
set bit =   7
tag bit = 16 - ( 7 +3 ) = 6

c ) for 4 way

Number of sets in cache = Cache size/(Set size * Block size)
            = 2^11 / ( 2^2 * 2^3) = 2^6

OFFSET BIT = 3

SET BIT = 6

TAG BIT = 16 - (6+3) = 7