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

A byte-addressable computer with 24-bit addresses has a 64KB cache with 32-byte

ID: 3554825 • Letter: A

Question

A byte-addressable computer with 24-bit addresses has a 64KB cache with 32-byte blocks. What is the format (tag, set and offset fields) of the memory address if the cache is: djrect mapped fully associative 4-way set associative 2. A byte-addressable computer has 221 bytes of main memory and a set associative cache of 64 blocks. What is the format (tag, set, offset fields) of the memory address if the cache is: 2-way set associative 4-way set associative A byte-addressable computer has 224A bytes of main memory and a fully associative cache of 128 blocks of 64 bytes each. What is the format (tag, set, and offset fields) of a memory address? In which cache block will the memory address 01D88216 map?

Explanation / Answer

1.

a) direct mapped

given cache size=64kB=2^16

cache block=cache size/block size

=2^16/2^5

blocks=2^11

hence,

block field=11 bits

word field=5 bits

tag=8 bts

b) fully associative

since 5 bits are needed for word, tag gets 19 bits

c) 4 way set associative

set field=9 bits

word=5 bits

tag= 10 bits

2

Address format: Word=6 bits (64-byte line size), Tag=32-6=26 bits

         Number of addressable units: 232, i.e. 4Giga unit

         Number of block in main memory: 232/26, i.e. 226

         Number of lines in cache: undetermined

         Size of tag: 26 bits

Address format: Tag= 9 bits, Word=6 bits (64-byte line size), Set=32-9-6=17 bits

         Number of addressable units: 232, i.e. 4Giga unit

         Number of block in main memory: 232/26, i.e. 226

         Number of lines in set: 4

         Number of sets in cache: 217

         Number of lines in cache: 4*217=219

         Size of tag: 9 bits

3. The cache is divided into 16 sets of 4 lines each. Therefore, 4 bits are needed to identify the set number. Main memory consists of 4K = 212 blocks. Therefore, the set plus tag lengths must be 12 bits and therefore the tag length is 8 bits. Each block contains128 words. Therefore, 7 bits are needed to specify the word.