edited by
9,371 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

Best answer
52 votes
52 votes
No. of blocks of main Memory $= \dfrac{2^{32}}{2^5} = 2^{27}$

And there are $512 = 2^9$ lines in Cache Memory.

Tag bits tell us to how many blocks does $1$ line in Cache memory points to

$1$ cache line points to $ \large \dfrac{2^{27}}{2^9} = 2^{18}$ lines

So, $18$ bits are required as TAG bits.
edited by
14 votes
14 votes
$32 - 9 - 5 = 18$
11 votes
11 votes
Main memory = 32 bits

Cache memory = 512 lines = 9 bits + 5 bits for block offset = 14 bits

Tag bits = 32 - 14 = 18 bits
Answer:

Related questions

78 votes
78 votes
5 answers
1
Madhav asked Feb 14, 2017
29,719 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 ...