Assuming that a given CPU has 8,192 cache blocks in the cache memory and that th
ID: 640866 • Letter: A
Question
Assuming that a given CPU has 8,192 cache blocks in the cache memory and that the main memory (RAM) hs 4,096,000 memory blocks, answer the following questions.
A) If this cache memory uses an 8-way set associative design, how many cache sets are there? ( I know there are 1024 sets)
What is the number of (set) index bits (in the memory address) needed for identifying cache sets?
What is the number of tag bits( in the memory address) needed for identifying a memory block in a particular cache block?
My teacher says "you don't need block size for anything because I did not ask for the whole address format and/or the bits for byte index." I am totally lost on how to do this without the block size. Was sketchy knowing how to do it with the block size. Anyone help?
Explanation / Answer
CPU has 8,192 cache blocks means we need 13 bits to address a block (2^13=8192)
main memory (RAM) hs 4,096,000 memory blocks means we need 22 bits to address a block (2^22=4194304)
cache memory uses an 8-way set associative design so no os set = 2^13/2^3=2^10=1024 sets.
number of (set) index bits (in the memory address) needed for identifying cache sets = 10 since cache has 1024 sets.
Therefore number of tag bits( in the memory address) needed for identifying a memory block in a particular cache block = 22-10=12.
your teacher is correct since here we are not interested in a line witnin a block, so thete is no need of block size.
Here we are intrested in a block address not a line address within balock.
TAG bit = No of required to address a block in main memory - no of bits required to address a set in cache memory
TAG bits = 22-10 = 12.