正在计算页面大小 table

Calculating the size of a page table

我有一个带有以下提示的作业:

The page size for a virtual memory system is 8KB.
The instruction TLB is direct-mapped with 2 sets and each block contains one translation.
^(I don't believe this is relevant for the following 3 questions, as there are two more questions about the TLB)

The number of bits in a virtual address is 20.
The number of bits in a physical address is 15.

(1) What is the number of virtual pages?

我想我已经弄明白了。

页面大小 = 8 * 2^10 = 8192,因此偏移量为 13 bits
虚拟页码 = 20 - 13 = 7
虚拟页面 = 2^7

(2) What is the number of physical pages?

这是我有点困惑的地方。我想我应该将有效位、脏位和引用位添加到物理页码(即 2,来自 15 - 13)。然而5 * 2^7 = 640 bytes,这看起来小得难以置信。

(3) How many bits are used in the virtual address for the page offset?

上面回答了,好像是13 bits.

谁能指出我正确的方向?谢谢!

有效位、脏位和引用位位于页面 table 条目中,但不是地址位的一部分。因此使用您的结果有 2^24 个物理页面。

是的,这看起来确实很小,但意识到只有 2^1532K 字节的物理内存。