Section 12.9: Trade-offs (Frame 2)                     [prev][home][next]

Let's go through a calculation. Suppose that addresses are 24 bits wide, meaning there are 16 megabytes of virtual memory. If pages were 8K (8192 bytes), then 2048 pages would exist in a program's page table since 16M ÷ 8K = 2048. 13 bits are required to address 2048 words. Also suppose there are only 2 megabytes of real memory. 2097152 (2M) divided by 8192 gives 256, which is the actual number of frames. Thus, a 13 bit page number must be mapped into a 8 bit frame number.

Assuming two additional bits are needed in the page table for each entry (present/absent and dirty bits), each page table entry, without disk addresses, needs 2+8=10 bits. Since it is difficult to allocate part of a byte, this would have to be rounded up to 16 bits per entry, or 2 bytes. Thus the page table would be 2048*2=4096 bytes long, which is 4K. This is how much each individual process or program would need just for its page table.