retagged by
532 views
0 votes
0 votes
A computer uses a 2-way set associative cache of size 128 KBytes with block (line) size of 32 Bytes. The cache accepts 32 bit addresses of the form $b_{31}b_{30} \dots b_2b_1b_0$ where $b_{31}$ is the most significant address and $b_0$ is the least significant address bit. Which bits are used by the cache controller for indexing into the cache directory?
retagged by

1 Answer

1 votes
1 votes

block size = 32B

cache size = 128KB

number of cache lines = cache size/ block size

                                      = 128kb/32b= 4096

number of cache sets = number of cache lines/p-way

                                  s = 4096/2 = 2048

 tag           s           block size          

16 bits   11 bits    5bits

       tag                                                                      s                     block size

b31b30 b29 b28 b27 b26 b25 b24 b23 

b22 b21 b20 b19 b18 b17 b16

            b15 b14 b13 b12 b11 b10 bb8 b7 b6b5                                                     b4  b3  b2 b1 b0
 A method of addressing a cache directory, comprising:
computing a parity of an address tag field within a presented address;
computing an index including:
the computed parity within a bit of the index; and
an index field within the presented address within remaining bits of the index.
The index field of an address maps to low order cache directory address lines. The remaining cache directory address line, the highest order line, is indexed by the parity of the address tag for the cache entry to be stored to or retrieved from the corresponding cache directory entry. Thus, even parity address tags are stored in cache directory locations with zero in the most significant index/address bit, while odd parity address tags are stored in cache directory locations with one in the most significant index/address bit. The opposite arrangement (msb 1=even parity; msb 0=odd parity) may also be employed, as may configurations in which parity supplies the least significant bit rather than the most significant bit.
 

now in the set (s) field msb is used as a parity bit the remaining set field bits are used for indexing...along with parity bit

so clearly b15 b14 b13 b12 b11 b10 bb8 b7 b6b5 are used for indexing 

edited by

Related questions

0 votes
0 votes
2 answers
3
go_editor asked Jun 8, 2016
451 views
Which of the following statement(s) is(are) true?If $n$ is odd prime number then $2^{n-1} \text{ mod } n =1$If $2^{n-1} \text{ mod } n =1$ for a number $n$ then $n$ is pr...
2 votes
2 votes
1 answer
4
go_editor asked Jun 8, 2016
335 views
Write the truth table for the connective: "If A then B"