A computer system with a word length of 32 bits has a 16 MB byte-addressable main memory and a 64 KB, 4-way set associative cache memory with a block size of 256 bytes. Consider the following four physical addresses represented in hexadecimal notation.

A1=0x42C8A4,

A2=0x546888,

A3=0x6A289C,

A4=0x5E4880

Which one of the following is TRUE?

A.

A1 and A4 are mapped to different cache sets.

B.

A2 and A3 are mapped to the same cache set.

C.

A3 and A4 are mapped to the same cache set.

D.

A1 and A3 are mapped to the same cache set.

Solution:

16 MB byte addressable main memory requires 24 bits.
64 KB - 4-way set associative cache is given. Block size 256 bytes so, block offset requires 8 bits.

Total number of sets = 64 KB4×256 B=64×10244 × 256=64 sets = 26 sets

TAG bits = 24 – 6 – 8 = 10 bits.

Set bits = 6, block bits = 8

Memory Address:

Since we need to check whether the options belong to the same set or not.

∴ A1 = 0 × 42 C8A4  Since we know the tag is of 10 bits ∴ leave 10 bits from LHS and check the next 6 bits of each no.