我有一个带有以下提示的任务:
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
。
谁能指出我正确的方向?谢谢!