The size of the physical address space of a processor is 2𝑃 bytes

Q. The size of the physical address space of a processor is 2𝑃 bytes. The word length is 2π‘Š bytes. The capacity of cache memory is 2𝑁 bytes. The size of each cache block is 2𝑀 words. For a 𝐾-way set-associative cache memory, the length (in number of bits) of the tag field is

(A) 𝑃 βˆ’ 𝑁 βˆ’ log2 𝐾                                          (B) 𝑃 βˆ’ 𝑁 + log2 𝐾

(C) 𝑃 βˆ’ 𝑁 βˆ’ 𝑀 βˆ’ π‘Š βˆ’ log2 𝐾                          (D) 𝑃 βˆ’ 𝑁 βˆ’ 𝑀 βˆ’ π‘Š + log2 𝐾

Ans: 𝑃 βˆ’ 𝑁 + log2 𝐾

Sol:

Physical Address Space = 2P Bytes. Word Length is 2W bytes, which means each word is of size 2W bytes.
Cache memory size = 2N Bytes and Tag Size = 2X Bytes.
Physical address is P – W bits
Number of blocks in cache = 2(N-W-M)

It is a K-way set associative cache memory, each set in cache will have K-blocks.
So, Number of sets = 2(N-W-M)/ K
SET bits will be N-W-M-logk
Offset bits will be M

We know,
TAG bits = Main memory bits – SET bits – offset bits
So, TAG bits(x) = P – W – (N-M-W-logk)- M
Β  Β  Β  = P – W – N + M + W + logk – M
Β  Β  Β  x = P – N + logk

Take Mock Tests

Government Schemes Mock Test Start Test!
Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
We will be happy to hear your thoughts

Leave a reply

Gkseries.com
Logo
Register New Account