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:


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:

(A) 9, 6, 5 (B) 7, 7, 6 (C) 7, 5, 8 (D) 9, 5, 6

EXPLANATION

 Cache size = 128 lines = 2^7.

Each set consists 4 blocks or lines.

So, no. of sets = 2^u = 128/4 = 32 = 2^5.
Line size = block size = 64 words=2^6, so w = 6.

Total no. of blocks = 2^20/2^6= 2^14, so, s = 14.

So TAG = 9, Line = 5 (The set no. decides the line. If, the line in the set no. u has tag field equal to
corresponding bits in address, then it is hit), word = 6. So choice (D) is correct.

Leave a comment

Your email address will not be published. Required fields are marked *