A two-way set associative cache memory uses blocks of four words. The cache can accommodate a total of 4096 words from main memory. The main memory size is 256K x 32. a) How many bits are there in tag, index, block, and word fields of the address format. b) How many bits are there in each words of cache, and how are they divided into functions? c) How many blocks can the cache accommodate
Answers
Answer:
Main memory consists of 64-Mbyte/16 bytes = 222 blocks. Therefore, the set plus tag lengths must be 22 bits, so the tag length is 14 bits and the word field length is 4 bits.
Explanation:
Answer:
SET bits will be 8 bits .
BLOCK OFFSET 2 bits
TAG bits is 9
Explanation:
Main memory size 217 * 32 words
Given no of words in a block = 4
So offset is 2 bits and
No of main memory cells = 217
No of cache blocks = 2048 W / 4 = 512 so we need 9 bits to represent them .
no of sets = 29 / 2 (2 is the associativity i.e. k)
= 28
SET bits will be 8 bits .
BLOCK OFFSET 2 bits
And for TAG we know , no of memory addresses that can be mapped
to same set which is = No of main memory cells / No of sets
= 217 / 28
= 29
So no of TAG bits = log2 (2)9
= 9