edited by
15,370 views
47 47 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 _______

8 Answers

Best answer
61 61 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
21 21 votes
$32 - 9 - 5 = 18$
12 12 votes
Main memory = 32 bits

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

Tag bits = 32 - 14 = 18 bits
4 4 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

Answer:
Position:
Show:

Related questions

123 123 votes
8 answers 8 answers
47.8k
47.8k views
Madhav asked Feb 14, 2017
47,755 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 ...
101 101 votes
9 answers 9 answers
46.8k
46.8k views
Arjun asked Feb 14, 2017
46,831 views
In a two-level cache system, the access times of $L_1$ and $L_2$ caches are $1$ and $8$ clock cycles, respectively. The miss penalty from the $L_2$ cache to main memory i...
75 75 votes
9 answers 9 answers
39.6k
39.6k views
Kathleen asked Sep 13, 2014
39,632 views
The access times of the main memory and the Cache memory, in a computer system, are $500$ n sec and $50$ nsec, respectively. It is estimated that $80\%$ of the main memor...
243 243 votes
25 answers 25 answers
117k
117k views
Madhav asked Feb 14, 2017
116,991 views
Two transactions $T_1$ and $T_2$ are given as$T_1:r_1(X)w_1(X)r_1(Y)w_1(Y)$$T_2:r_2(Y)w_2(Y)r_2(Z)w_2(Z)$where $r_i(V)$ denotes a $\textit{read}$ operation by transaction...