edited by
11,757 views
13 votes
13 votes
An $8$-way set associative cache of size $64 \mathrm{~KB} \;(1 \mathrm{~KB}=1024\; \text{bytes})$ is used in a system with $32$-bit address. The address is sub-divided into $\text{TAG, INDEX},$ and $\text{BLOCK OFFSET.}$

The number of bits in the $\text{TAG}$ is ___________.
edited by

4 Answers

17 votes
17 votes

System is 32-bit address. 

Cache Size : 64 KB = $2^{6} * 2^{10} = 2^{16}$. So, cache bits = 16.

So Tag Bits = 32 – 16 = 16 bit.

 

NOTE : If cache is k-way set associative then we have to transfer $log _{2}k$ bits from cache line bits to Tag bits.

 

As, Cache is 8-way set associative. So, we have to transfer 3 bits to tag side.

So, final Tag bits = 16 + 3 = 19.

Number of bits in Tag Field = 19.

edited by
13 votes
13 votes

Given that for set associative mapping technique:

  • Cache memory size $(CM’s)=64 KB=2^{16} $ bytes
  • Main memory size $(MM’s)=32$ bits
  • $P=8$way SAM
  • Tag bit size (y) =?

since block size is not given we assume it is $2^x$ byte.

Number of cache block $(N)= \frac{CM’s}{B’s}\implies \frac{2^16}{2^x}=2^{16-x}$

Number of sets $(S) = \frac{N}{P}= \frac{2^{16-x}}{2^3}=2^{13-x}$

as we know that for set associative mapping technique:

$\text{TAG+SLO+B’S=MM’s}$ 

$\implies y+13-x+x=32$bits

$\implies y=32-13$ bits

$\implies y=19$ bits

so the correct value of the tag size is $19$ bits.

 

4 votes
4 votes

Answer: 19 bits

Let size of block be $2^x$

Let tag bits be $t$

$\text{Number of sets} = {\large \frac{64*2^{10}}{2^x *2^3}} = 2^{13-x}$

             $t$                  $13-x$         $x$

Given address = $32$ bits

Tag bits = $32 – (13-x+x) = 32-13 = 19$ bits

1 votes
1 votes

Given that for set associative mapping technique:

  • Cache memory size $(CM’s)=64 KB=2^{16} $ bytes
  • Main memory size $(MM’s)=32$ bits
  • $P=8$way SAM
  • Tag bit size (y) =?

since block size is not given we assume it is $2^x$ byte.

Number of cache block $(N)= \frac{CM’s}{B’s}\implies \frac{2^16}{2^x}=2^{16-x}$

Number of sets $(S) = \frac{N}{P}= \frac{2^{16-x}}{2^3}=2^{13-x}$

as we know that for set associative mapping technique:

$\text{TAG+SLO+B’S=MM’s}$ 

$\implies y+13-x+x=32$bits

$\implies y=32-13$ bits

$\implies y=19$ bits

so the correct value of the tag size is $19$ bits.

Answer:

Related questions