我的作业有以下提示:
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
。
有人能指出我正确的方向吗?谢谢!
答案 0 :(得分:1)
有效,脏和引用位在页表条目中,但不是地址位的一部分。因此,使用您的结果有2^2
或4
个物理页面。
是的,这似乎很小,但意识到物理内存只有2^15
或32K
个字节。