 # Memory page table TLB

#1

#2

4 words = 2^2 Words
So page offset = 2 bits
Hence, last 2 bits of each virtual memory reference would be used as page offset.

(a)

29 = 11101 (in binary)
offset = 01
Virtual page number = 111 = 7
Physical page number = 4 (See the table given in qn) = 100 (in binary)
Physical address = 10001 = 17

31 = 11111 (in binary)
offset = 11
Virtual page number = 111 = 7
Physical page number = 4 (See the table given in qn) = 100 (in binary)
Physical address = 10011 = 19

7 = 00111 (in binary)
offset = 11
Virtual page number = 001 = 1
Physical page number = 0 (See the table given in qn) = 000 (in binary)
Physical address = 00011 = 3

14 = 01110 (in binary)
offset = 10
Virtual page number = 011 = 3
Physical page number = 3 (See the table given in qn) = 011 (in binary)
Physical address = 01110 = 14

4 = 00100 (in binary)
offset = 00
Virtual page number = 001 = 1
Physical page number = 0 (See the table given in qn) = 000 (in binary)
Physical address = 00000 = 0

(b)
Just see the virtual page number that we just calculated above.

29 - 7 (TLB Miss)
31 - 7 (Hit)
7 - 1 (TLB Miss)
14 - 3 (TLB Miss)
4 - 1 (Hit)