retagged by
825 views
0 votes
0 votes
Number of sets = 128
2 way set Associative
Cache size = 4Kbytes
Main memory has 21 bit address
What are the sizes of the cache blocks and number of cache blocks respectively?
retagged by

2 Answers

0 votes
0 votes

Number of Sets = 128

2 way Set Associative mapping, it means that covering two blocks making 1 set

#f blocks = Total Size of the cache /(Number of sets * set size)

                 =4K Bytes/(128*2) = 2^12/2^8 = 16 blocks.

Block size = Cache size /#f blocks= 4K Bytes/16 = 256.

Memory Block is addressed with 21 bit.

Tag bit Set index word/block offset
6 7 8

 

 

 

0 votes
0 votes
NO of sets=128

NO of pages in cache =2*128  (since it is 2 way set associativity)

no of pages in cache or no of lines in cache=256=2^8

cache size = no of lines *size of one block

2^12=2^8*m

m=2^4

m=16B (block size).

No related questions found