edited by
7,117 views
27 votes
27 votes

A computer system has a level-$1$ instruction cache ($1$-cache), a level-$1$ data cache ($D$-cache) and a level-$2$ cache ($L2$-cache) with the following specifications:

\begin{array}{|l|c|c|c|} \hline \text {} &  \textbf{Capacity }& \textbf{Mapping Method} & \textbf{Block Size}\\\hline \text{$I$-Cache} & \text{$4K$ words}& \text{Direct mapping} & \text{$4$ words} \\\hline \text{$D$-Cache} & \text{$4K$ words}& \text{$2$ -way set associative mapping} & \text{$4$ words}\\\hline \text{$L2$-Cache} & \text{$64K$ words}& \text{$4$-way set associative mapping} & \text{$16$ words} \\\hline \end{array}

 

The length of the physical address of a word in the main memory is $30$ bits. The capacity of the tag memory in the $I$-cache, $D$-cache and $L2$-cache is, respectively,

  1. $1$ K x $18$-bit, $1$ K x $19$-bit, $4$ K x $16$-bit
  2. $1$ K x $16$-bit, $1$ K x $19$-bit, $4$ K x $18$-bit
  3. $1$ K x $16$-bit, $512$ x $18$-bit, $1$ K x $16$-bit
  4. $1$ K x $18$-bit, $512$ x $18$-bit, $1$ K x $18$-bit
edited by

2 Answers

Best answer
44 votes
44 votes

1. I-cache

  • Number of blocks in cache $=\dfrac{4K}{4} = 2^{10} \text{ blocks}.$
  • Bits to represent blocks $= 10$
  • Number of words in a block $= 4 = 2^2 \text{words}.$
  • Bits to represent words $= 2.$
  • tag bits $= 30 - (10+2) = 18.$
  • Each block will have it's own tag bits. So total tag bits $= 1K \times 18 \text{ bits}.$

2. D-cache

  • Number of blocks in cache $=\dfrac{4K}{4} = 2^{10} \text{ blocks}.$
  • Number of sets in cache $= \dfrac{2^{10}}{2} = 2^9 \text{ sets}.$
  • Bits to represent sets $= 9.$
  • Number of words in a block $= 4 = 2^2 \text{ words}.$
  • Bits to represent words $= 2$
  • tag bits $= 30 - (9+2) = 19$
  • Each block will have it's own tag bits. So total tag bits $= 1K \times 19 \text{ bits}.$

3. L2 cache

  • Number of blocks in cache $=\dfrac {64K}{16} = 2^{12} \text{ blocks}.$
  • Number of sets in cache $= \dfrac{2^{12}}{4} = 1024\text{ sets}.$
  • Bits to represent sets $= 10$
  • Number of words in cache $= 16 = 2^4\text{ words}.$
  • Bits to represent words $= 4.$
  • tag bits $= 30 - (10+4) = 16$
  • Each block will have it's own tag bits. So total tag bits $= 2^{12} \times 16\text{-bits} = 4K \times 16\text{-bits}.$

Option (A).

edited by
1 votes
1 votes

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

Answer:

Related questions

42 votes
42 votes
2 answers
1
Ishrat Jahan asked Oct 31, 2014
11,732 views
A cache line is $64$ bytes. The main memory has latency $32$ $ns$ and bandwidth $1$ $GBytes/s$. The time required to fetch the entire cache line from the main memory is:$...