2,710 views
2 2 votes
A computer has 256KB , k way set associative write back data cache with block size of 32 B. The addresss sent to the cache controller by the processor is of 32 bits. In addition to the address tag , each cache directory contains 2 valid bis and 1 modified bit . if 16 bits are used to address tag then what is the min vallue of k

2 Answers

Best answer
1 1 vote

Number of Cache entries in the cache of size $256KB$  having each block size $32B$

$=\frac{2^{8}*2^{10}} {2^{5}}=2^{13}$

Given tag size bits$=16$

As processor is of $32$ bits and cache is using set associative,

number of bit to represent tag+number of bit to represent sets+number of bit to represent block size$=32$

$16+x+5=32 \Rightarrow x=11$

number of sets$=2^{11}$

 

$\Rightarrow 2^{11}=\frac{2^{13}}{k}$

$k=2^{2}=4$


[Edit]

To find Cache Tag Directory size-:

$\text{Cache Tag Directory size}=\text{Number of sets } \times k \times \text{tag bit+valid+modified bits}$

$=2^{11} \times 4 \times  (16+2+1) \text{bits}$

                                                        

• edited by
Position:
Show:

Related questions

0 0 votes
0 0 answers
878
878 views
altamash asked May 13, 2019
878 views
Block set associative cache consists of a total of 64blocks divided into 4blocks sets .The main memory contains 4096blocks ,each consisting of 128 words.how many bits for...
0 0 votes
0 0 answers
371
371 views
mehul vaidya asked Jan 20, 2019
371 views
Doubling the associativity doubles the number of tags in the cache. Is this statement true or false . I have seen answer at https://gateoverflow.in/227782/cache-memory?sh...
0 0 votes
1 1 answer
1.4k
1.4k views