GATE / CS ARCHIVE

GATE CSE 2020 / QUESTION 30

GATE CSE 2020 Q30

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2020 paper

GATE 2020, Q30 2 marks · MCQ
Report issue

Cache Memory

Question 30, GATE 2020: A 32-bit-word system has 16 MB byte-addressable memory and a 64 KB four-way set-associative cache with 256-byte blocks. Addresses: A1=0x42C8A4, A2=0x546888, A3=0x6A289C, A4=0x5E4880. Which is true? A A1,A4 map to different sets; B A2,A3 same set; C A3,A4 same set; D A1,A3 same set.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Worked explanation

Compute organization before extracting bits. Total cache blocks=216/28=28; four blocks per set gives 26 sets. A 24-bit physical byte address therefore divides as tag 10 bits | set 6 bits | byte offset 8 bits. Shifting each address right by 8 discards its final byte; masking the next six bits gives 0x08,0x28,0x28,0x08, or 8,40,40,8. Same set does not require equal tags or equal byte offsets, and four-way associativity does not change this index extraction. Only B among the offered statements is true.

Derivation and answer

The cache has 65536/256=256 lines and 64 four-way sets. Offset uses 8 bits and set index 6 bits, so index=(address>>8)&63. The four addresses map to sets 8, 40, 40, 8, respectively. Exactly A2 and A3 share a set among the listed positive claims, B; A1 and A4 actually also share a set, contrary to A.

Original paper, page 10 · Answer key