# Consider a set-associative cache of size 2 KB (1 KB = 210 bytes) with cache block size of 64 bytes. Assume that the cache is byte-addressable and a 32

267 views
in Computer
closed
Consider a set-associative cache of size 2 KB (1 KB = 210 bytes) 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 _______

by (41.6k points)
selected by

Data:

Main memory size (MM) = 232 B (32 bit address)

Cache Memory Size (CS) = 2 KB = 211 B

Block Size (BO) = 64 B = 2

Tag = 22 bits

Set Associative Mapped Cache:

let 2x - way set associative mapping

$number~of~lines=\frac{{{2}^{11}}}{{{2}^{6}}}={{2}^{5}}$

$number~of~sets=\frac{{{2}^{5}}}{2^x}={{2}^{5-x}}$

Formula: To find number of bits in tag in set associative mapping

MM = tag + set + BO

32 = 22 + 5 - x + 6

∴ x = 1

Therefore it is 21 - way set associative mapping

The associativity of the cache is 2.