The information of a virtual memory system is assumed to be: Page size: 1024 words; Number of virtual pages: 8; Number of physical pages: 4; The current page table is
| VPN | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| PPN | 2 | 1 | NULL | NULL | 3 | NULL | 0 | NULL |
For the following (decimal) virtual word addresses: VA1: 57, VA2: 2048, VA3: 1026, VA4: 7749, VA5: 6150, their corresponding physical addresses are PA1, PA2, PA3, PA4, PA5. \(K=(PA1+PA2+PA3+PA4+PA5)\bmod5\), where "mod" is the modulo operator, and PA = −1 if it is a page fault. What is "K"?
(A) 0 (B) 1 (C) 2 (D) 3 (E) 4
\(\text{VPN}=\lfloor VA/1024\rfloor\),offset \(=VA\bmod1024\),\(PA=PPN\times1024+\text{offset}\)
VA1 \(=57\):VPN 0 \(\to\) PPN 2 → \(PA1=2048+57=2105\)
VA2 \(=2048\):VPN 2 \(\to\) NULL → \(PA2=-1\)
VA3 \(=1026\):VPN 1、offset 2 \(\to\) PPN 1 → \(PA3=1024+2=1026\)
VA4 \(=7749\):VPN 7 \(\to\) NULL → \(PA4=-1\)
VA5 \(=6150\):VPN 6、offset 6 \(\to\) PPN 0 → \(PA5=0+6=6\)
\(2105-1+1026-1+6=3135\),\(3135\bmod5=0\)
(A)