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 = 2PBytes. Word Length is 2Wbytes, which means each word is of size 2Wbytes.
Cache memory size = 2NBytes and Tag Size = 2XBytes.
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

We will be happy to hear your thoughts

Leave a reply

Gkseries.com
Logo
Register New Account