in CO and Architecture retagged by
651 views
1 vote
1 vote
A system is having $4$ way set associative cache of $256$ KB. The cache line size is $8$ words and each word has $32$ bits. Suppose memory addresses are $64$ bits long. Then number of bits required for the index field of the cache memory is _______
in CO and Architecture retagged by
by
651 views

2 Comments

@Bikram sir ,Since word ,by definition, is the smallest collection of bits with which processor can deal with, and given 1 word=32bits=4bytes. This means this whole architecture is not byte addressable. Now, each line has 8=2^3 words, and processor deals with word only, so i took block offset bits to be 3 rather than 5. what is wrong with this?

0
0
@ayush.5

 

Cache size is 256 KB .

Cache line size is 8 words and each word has 32 bits = 4 Bytes ,

so cache Block size is 8 * 4 = 32 Bytes

32 = 25 so 5 bits require for block offset .

It is 4 way set associative cache , so number of sets are ( 256 KB/ 4 * 32 B ) = (28 * 210 / 22 * 25 ) = 218/27 = 211

 

so 11 bits require for the index field .

 

page number 8 , http://www.cs.utexas.edu/users/mckinley/352/lectures/16.pdf

https://www.quora.com/How-do-I-calculate-the-length-of-the-block-offset-field-and-index-field
1
1

2 Answers

1 vote
1 vote
Best answer

Cache size is 256 KB .

4 way set associative cache means number of blocks per set is 4 .

Cache line size is 8 words( means each block size is 8 words ) and each word has 32 bits = 4 Bytes ,  

so total Block size is 8 * 4 = 32 Bytes 

32 = 2so 5 bits require for block offset .

There are 4 blocks /set and each block size is 32 Bytes .

It is 4 way set associative cache , so number of sets are ( 256 KB/ 4 * 32 B )

= (28 * 210 / 22 * 25 ) =218/27

= 211

Hence 11 bits require to represent the index field .

selected by

4 Comments

 manu00x

please read above comments..

index bits will be same as set offset bits

0
0
in direct mapping index is line offset+word offset?

someone plz confirm
0
0
For block offset calculation why are we taking it as byte addressable. in the question it is not mentioned anywhere that memory is byte addressable.  so shouldn’t  default we assume memory to be word addressable (not byte addressable)

someone pls explain
0
0
0 votes
0 votes
if index offset is set offset in set associativity then answer is 11 bits.
edited by

1 comment

@Hem chandra Joshi

Cache size is 256 KB .

Cache line size is 8 words and each word has 32 bits = 4 Bytes so cache Block size is 8 * 4 = 32 Bytes 

32 = 25 so 5 bits require for block offset .

It is 4 way set associative cache , so number of sets are ( 256 KB/ 4 * 32 B ) = (28 * 210 / 22 * 25 ) =218/27

= 211

so 11 bits require for the index field .

0
0
Answer:

Related questions