...
Question 12404 – TIFR PHD CS & SS 2014
December 25, 2023
Question 14291 – Computer-Organization
December 25, 2023
Question 12404 – TIFR PHD CS & SS 2014
December 25, 2023
Question 14291 – Computer-Organization
December 25, 2023

Cache

Question 13
 Consider a set-associative cache of size 2KB (1KB = 210bytes) with cache block size of 64 bytes. Assume that the cache is byte-addressable and a 32-bit address is used for accessing the cache. If the width of the tag field is 22 bits, the associativity of the cache is ______
A
2
Question 13 Explanation: 

Cache size = 2KB

Block size = 64 Bytes = 2^6 bytes. So the OFFSET is 6 bits long.

The TAG field is 22 bits. And the physical address is 32 bits.

Since it is given as a set associative cache, the physical address is divided as (TAG, SET, OFFSET).

 

From the given information we can find the SET number = 32 – 22 – 6 = 4 bits.

Using the 4 SET bits, the number of sets possible = 2^4 = 16.

 

Number of blocks in the cache = Cache size / Block size = 2KB /  64 = 2^11/2^6 = 2^5.

 

Number of sets in the cache = Number of blocks in the cache / Number of blocks in each set

 

Number of blocks in each set is also called the associativity.

 

16 = 2^5/associativity

Associativity = 2^5/16 = 2

Correct Answer: A
Question 13 Explanation: 

Cache size = 2KB

Block size = 64 Bytes = 2^6 bytes. So the OFFSET is 6 bits long.

The TAG field is 22 bits. And the physical address is 32 bits.

Since it is given as a set associative cache, the physical address is divided as (TAG, SET, OFFSET).

 

From the given information we can find the SET number = 32 – 22 – 6 = 4 bits.

Using the 4 SET bits, the number of sets possible = 2^4 = 16.

 

Number of blocks in the cache = Cache size / Block size = 2KB /  64 = 2^11/2^6 = 2^5.

 

Number of sets in the cache = Number of blocks in the cache / Number of blocks in each set

 

Number of blocks in each set is also called the associativity.

 

16 = 2^5/associativity

Associativity = 2^5/16 = 2

Leave a Reply

Your email address will not be published. Required fields are marked *