1

我有一个带有以下提示的任务:

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, from 15 - 13)中。然而5 * 2^7 = 640 bytes,这似乎非常小。

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

上面回答,好像是13 bits

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

4

1 回答 1

1

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

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

于 2015-04-21T04:19:03.077 回答