虚拟内存 - 计算虚拟地址 Space

Virtual Memory - Calculating the Virtual Address Space

我明天准备考试,遇到这个问题:

You are given a memory system with 2MB of virtual memory, 8KB page size,
512 MB of physical memory, TLB contains 16 entries, 2-way set associative.

How many bits are needed to represent the virtual address space?

我以为是20位,因为2^10是1024,所以我简单地乘以2^10*2^10得到2^20。然而,答案最终是21,我不知道为什么。

所需的虚拟地址space为2MB。

正如您所计算的,20 位可以容纳 1MB 的 VM space。您需要 21 位来容纳 2MB。