Open In App

GATE | Gate IT 2008 | Question 78

Like Article
Like
Save
Share
Report

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


Last Updated : 19 Nov, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads