retagged by
18,242 views
50 votes
50 votes
The width of the physical address on a machine is $40$ bits. The width of the tag field in a $512$ KB $8$-way set associative cache is ________ bits.
retagged by

4 Answers

Best answer
113 votes
113 votes

Physical Address $=40$

  •  Tag + Set + Block Offset $=40$
  •  $T + S + B = 40\qquad \to (1)$

We have: Cache Size  =  number of sets $\times$ blocks per set $\times$ Block size

  • $512\ KB$ = number of sets $\times\ 8\ \times$ Block size
  •  Number of sets $\times$ Block size $=\dfrac{512}{8}\ KB = 64\ KB$
  •  $S + B =16 \qquad \to (2)$

From $(1), (2)$ 

T = 24  bits (Ans)


Second way

Cache Size $= 2^{19}$
MM size $=2^{40}$
This means, We need to map $\dfrac{2^{40}}{2^{19}}=2^{21}$ Blocks to one line. And a set contain $2^3$ lines.
Therefore, $2^{24}$ blocks are mapped to one set.
Using Tag field, I need to identify which one block out of $2^{24}$ blocks are present in this set.
Hence, $24$ bits are needed in Tag field.

edited by
72 votes
72 votes
In question block size has not been given,so we can assume  block size  $2^x$ Byte.

Number of Blocks:-   $\dfrac{512\times 2^{10}}{2^x} =\large2^{19-x}$

Number of sets:-    $\dfrac{2^{19-x}}{8 }=\large2^{16-x}$

So number of bits for sets $=16-x$

Let number of bits for Tag $=T$

And we have already assumed block size $2^x$ Byte,therefore number of bits for block size is $x$

And finally,

$T + (16-x) + x = 40$

$T+16 = 40$

$T = 24.$
edited by
12 votes
12 votes
Do not get confused due to missing block size...Assume block size as 2^x byte and solve...Later , it will get cancel and TAG field can be found....
Remember that , block size data is not mandatory :)
2 votes
2 votes

………………………………………………………………………………….

Answer:

Related questions

15.5k
views
13 answers
63 votes
Akash Kanase asked Feb 12, 2016
15,536 views
A file system uses an in-memory cache to cache disk blocks. The miss rate of the cache is shown in the figure. The latency to read a block from the cache ... required to ensure an average read latency of less than $6$ ms is _________ MB.
23.3k
views
12 answers
100 votes
Akash Kanase asked Feb 12, 2016
23,279 views
Suppose the functions $F$ and $G$ can be computed in $5$ and $3$ nanoseconds by functional units $U_{F}$ and $U_{G}$, respectively. ... all other delays, the minimum time required to complete this computation is ____________ nanoseconds.
21.6k
views
4 answers
68 votes
Akash Kanase asked Feb 12, 2016
21,594 views
Consider a processor with $64$ registers and an instruction set of size twelve. Each instruction has five distinct fields, namely, opcode, two source register ... amount of memory (in bytes) consumed by the program text is _________.
20.0k
views
8 answers
76 votes
Akash Kanase asked Feb 12, 2016
19,964 views
Consider a $3 \ \text{GHz}$ (gigahertz) processor with a three stage pipeline and stage latencies $\large\tau_1,\tau_2$ and $\large\tau_3$ such that ... new frequency is __________ $\text{GHz}$, ignoring delays in the pipeline registers.