edited by
9,379 views
29 votes
29 votes
Consider a machine with a byte addressable main memory of $2^{32}$ bytes divided into blocks of size $32$ bytes. Assume that a direct mapped cache having $512$ cache lines is used with this machine. The size of the tag field in bits is _______
edited by

8 Answers

2 votes
2 votes

In Direct Mapped Cache

Tag bits = log(Main Memory size/ cache size) 

Cache size = No of blocks * Block size = 512*32 = 2^14

Tag bits = log(2^32/2^14) = log(2^18) = 18 bits

1 votes
1 votes

Answer is 18 bit

In the case of direct mapping Tag field is the ratio of main memory and cache memory. 

1 votes
1 votes
tag bits are Log of (Main memory size) divided by (cache size) in case of direct mapped cache..
So , log of $(2^{32})\div(512*32)$ is 18 ans.
0 votes
0 votes

Given that it is a byte addressable memory and the main memory is of size 2^32 Bytes.
So the physical address is 32 bits long.
Each block is of size 32(=2^5) Bytes. So block offset 5.
Also given that there are 512(=2^9) cache lines, since it is a direct mapped cache we need 9 bits for the LINE number.
When it is directed mapped cache, the physical address can be divided as
(Tag bits + bits for block/LINE number + bits for block offset)
So, tag bits + 9 + 5 = 32
Tag bits = 32 - 14 = 18

Answer:

Related questions

78 votes
78 votes
5 answers
1
Madhav asked Feb 14, 2017
29,747 views
The read access times and the hit ratios for different caches in a memory hierarchy are as given below:$$\begin{array}{|l|c|c|} \hline \text {Cache} & \text{Read access ...