edited by
13,038 views
22 votes
22 votes

Consider a $4$-way set associative cache consisting of $128$ lines with a line size of $64$ words. The CPU generates a $20-bit$ address of a word in main memory. The number of bits in the TAG, LINE and WORD fields are respectively:

  1. $9, 6, 5$
  2. $7, 7, 6$
  3. $7, 5, 8$
  4. $9, 5, 6$
edited by

1 Answer

Best answer
29 votes
29 votes

Number of sets $=\dfrac{\text{cache size}}{\text{(size of a block * No. of blocks in a set)}}$

$=\dfrac{128 * 64}{(64 * 4)}\text{ (4 way set associative means 4 blocks in a set)}$

$= 32.$

So, number of index (LINE) bits $= 5$ and number of WORD bits $= 6$ since cache block (line) size is $64.$

So, number of TAG bits $= 20 - 6 - 5 = 9.$

Answer is (D) choice

edited by
Answer:

Related questions

30 votes
30 votes
2 answers
3
go_editor asked Apr 23, 2016
9,840 views
Consider the following program segment. Here $\text{R1, R2}$ and $\text{R3}$ are the general purpose registers.$$\begin{array}{|l|l|l|c|} \hline & \text {Instruction} & \...
35 votes
35 votes
5 answers
4
go_editor asked Apr 23, 2016
9,355 views
Consider the following program segment. Here $\text{R1, R2}$ and $\text{R3}$ are the general purpose registers.$$\small \begin{array}{|c|l|l||c|} \hline & \text {Instruct...