Consider a $4$-way set associative cache consisting of $128$ lines with a line size of $64$ words. The CPU generates a $20-bit$ address of a word in main memory. The number of bits in the TAG, LINE and WORD fields are respectively:
Number of sets $=\dfrac{\text{cache size}}{\text{(size of a block * No. of blocks in a set)}}$ $=\dfrac{128 * 64}{(64 * 4)}\text{ (4 way set associative means 4 blocks in a set)}$ $= 32.$ So, number of index (LINE) bits $= 5$ and number of WORD bits $= 6$ since cache block (line) size is $64.$
So, number of TAG bits $= 20 - 6 - 5 = 9.$ Answer is (D) choice
64.3k questions
77.9k answers
244k comments
80.0k users