Consider a cache with 32-bit addresses, 768 blocks, and a block size of 128…

Consider a cache with 32-bit addresses, 768 blocks, and a block size of 128 bytes. Tags are 17 bits. How many sets are there, and what is the associativity of the cache?

Answer: B. 256 sets, 3-way set associativity.Tag = 17 bits Block size = 2^7 bytes i.e. 7 bits for word offset Index bits = Total address bits - (Tag bits + Word offset bits) =32-(17+7) = 8 bits Hence,…

  1. A.

    128 sets, 6-way set associativity.

  2. B.

    256 sets, 3-way set associativity.

  3. C.

    128 sets, 8-way set associativity.

  4. D.

    Data inadequate

Attempted by 23 students.

Show answer & explanation

Correct answer: B

Tag = 17 bits

Block size = 2^7 bytes

i.e. 7 bits for word offset

Index bits = Total address bits - (Tag bits + Word offset bits) =32-(17+7) = 8 bits

Hence, Number of sets = 2^8 sets = 256 sets

And, Total 768 blocks makes 768/256 = 3 way set associative.

Explore the full course: Zero To Hero

Loading lesson…