GATE | Gate IT 2008 | Question 78

Consider a computer with a 4-ways set-associative mapped cache of the following character­istics: a total of 1 MB of main memory, a word size of 1 byte, a block size of 128 words and a cache size of 8 KB.

While accessing the memory location 0C795H by the CPU, the contents of the TAG field of the corresponding cache line is
(A) 000011000
(B) 110001111
(C) 00011000
(D) 110010101


Answer: (A)

Explanation:  

TAG will take 9 bits
SET will need 4 bits and
WORD will need 7 bits of the cache memory location
Thus, using the above conclusion as derived in previous question.
The memory location 0C795H can be written as 0000 1100 0111 1001 0101
Thus TAG= 9 bits = 0000 1100 0
SET =4 bits =111 1
WORD = 7 bits =001 0101
Therefore, the matching option is option A.

 

This solution is contributed by Namita Singh .

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.