通常的做法是将大组位(如地址中的位)划分为更小的子组,以使它们更易于管理。 有时它们会因物理原因而被划分,例如地址引脚和存储卡; 有时是出于逻辑原因,例如 IP 地址和子网。 美妙之处在于实现细节与最终用户无关。 如果您访问地址 0x48C7D3AB 处的内存,您不必关心它位于哪个 RAM 芯片中,也不必关心内存是如何排列的,只要内存单元存在即可。 当您浏览到 67.199.15.132 时,您并不关心计算机是否位于 C 类子网上,只要它接受您的投票即可。 :-)
Your answers are exactly right.
With a 32-bit address bus, you can access a virtual space of 2^32 unique addresses.
Each 4K page uses 2^12 (physical) addresses, so you can fit (2^32) / (2^12) = 2^20 pages into the space.
Good luck with your exam!
Edit to address questions in the comments:
How do you know you cannot access more than 2^32 addresses?
A 32-bit address bus means there are 32 wires connected to the address pins on the RAM--each wire is represented by one of the bits. Each wire is held at either a high or low voltage, depending on whether the corresponding bit is 1 or 0, and each particular combination of ones and zeroes, represented by a 32-bit value such as 0xFFFF0000, selects a corresponding memory location. With 32 wires, there are 2^32 unique combinations of voltages on the address pins, which means you can access 2^32 locations.
So what about the 4K page size?
If the system has a page size of 4K, it means the RAM chips in each page have 12 address bits (because 2^12 = 4K). If your hypothetical system has 128K of RAM, you'd need 128K/4K = 32 pages, or sets of RAM chips. So you can use 12 bits to select the physical address on each chip by routing the same 12 wires to the 12 address pins on every RAM chip. Then use 5 more wires to select which one of the 32 pages contains the address you want. We've used 12 + 5 = 17 address bits to access 2^17 = 128K of RAM.
Let's take the final step and imagine that the 128K of RAM resides on a memory card. But with a 32-bit address bus, you still have 32-17 = 15 address bits left! You can use those bits to select one of 2^15 = 32768 memory cards, giving you a total virtual address space of 2^32 = 4G of RAM.
Is this useful beyond RAM and memory cards?
It's common practice to divide a large set of bits, like those in the address, into smaller sub-groups to make them more manageable. Sometimes they're divided for physical reasons, such as address pins and memory cards; other times it's for logical reasons, such as IP addresses and subnets. The beauty is that the implementation details are irrelevant to the end user. If you access memory at address 0x48C7D3AB, you don't care which RAM chip it's in, or how the memory is arranged, as long as a memory cell is present. And when you browse to 67.199.15.132, you don't care if the computer is on a class C subnet as long as it accepts your upvotes. :-)
发布评论
评论(1)
你的答案完全正确。
使用 32 位地址总线,您可以访问 2^32 个唯一地址的虚拟空间。
每个 4K 页面使用 2^12 个(物理)地址,因此您可以在该空间中容纳 (2^32) / (2^12) = 2^20 个页面。
祝你考试顺利!
编辑以解决评论中的问题:
你怎么知道你不能访问超过 2^32 个地址?
32 位地址总线意味着有 32 根电线连接到RAM 上的地址引脚——每条线都由其中一位表示。 每条线都保持在高电压或低电压,具体取决于相应的位是 1 还是 0,并且每个特定的 1 和 0 组合(由 32 位值(例如 0xFFFF0000)表示)选择相应的存储位置。 使用 32 根电线,地址引脚上有 2^32 种独特的电压组合,这意味着您可以访问 2^32 个位置。
那么 4K 页面大小又如何呢?
如果系统的页面大小为 4K,则意味着每个页面中的 RAM 芯片有 12 个地址位(因为 2^12 = 4K)。 如果您的假设系统有 128K RAM,则需要 128K/4K = 32 页或 RAM 芯片组。 因此,您可以使用 12 位来选择每个芯片上的物理地址,方法是将相同的 12 根电线路由到每个 RAM 芯片上的 12 个地址引脚。 然后再使用 5 根电线来选择 32 个页面中的哪一页包含您想要的地址。 我们使用了 12 + 5 = 17 个地址位来访问 2^17 = 128K 的 RAM。
让我们进行最后一步,想象 128K RAM 驻留在存储卡上。 但是对于 32 位地址总线,您仍然剩下 32-17 = 15 个地址位! 您可以使用这些位来选择 2^15 = 32768 个存储卡之一,从而获得 2^32 = 4G RAM 的总虚拟地址空间。
除了 RAM 和存储卡之外,这还有用吗?
通常的做法是将大组位(如地址中的位)划分为更小的子组,以使它们更易于管理。 有时它们会因物理原因而被划分,例如地址引脚和存储卡; 有时是出于逻辑原因,例如 IP 地址和子网。 美妙之处在于实现细节与最终用户无关。 如果您访问地址 0x48C7D3AB 处的内存,您不必关心它位于哪个 RAM 芯片中,也不必关心内存是如何排列的,只要内存单元存在即可。 当您浏览到 67.199.15.132 时,您并不关心计算机是否位于 C 类子网上,只要它接受您的投票即可。 :-)
Your answers are exactly right.
With a 32-bit address bus, you can access a virtual space of 2^32 unique addresses.
Each 4K page uses 2^12 (physical) addresses, so you can fit (2^32) / (2^12) = 2^20 pages into the space.
Good luck with your exam!
Edit to address questions in the comments:
How do you know you cannot access more than 2^32 addresses?
A 32-bit address bus means there are 32 wires connected to the address pins on the RAM--each wire is represented by one of the bits. Each wire is held at either a high or low voltage, depending on whether the corresponding bit is 1 or 0, and each particular combination of ones and zeroes, represented by a 32-bit value such as 0xFFFF0000, selects a corresponding memory location. With 32 wires, there are 2^32 unique combinations of voltages on the address pins, which means you can access 2^32 locations.
So what about the 4K page size?
If the system has a page size of 4K, it means the RAM chips in each page have 12 address bits (because 2^12 = 4K). If your hypothetical system has 128K of RAM, you'd need 128K/4K = 32 pages, or sets of RAM chips. So you can use 12 bits to select the physical address on each chip by routing the same 12 wires to the 12 address pins on every RAM chip. Then use 5 more wires to select which one of the 32 pages contains the address you want. We've used 12 + 5 = 17 address bits to access 2^17 = 128K of RAM.
Let's take the final step and imagine that the 128K of RAM resides on a memory card. But with a 32-bit address bus, you still have 32-17 = 15 address bits left! You can use those bits to select one of 2^15 = 32768 memory cards, giving you a total virtual address space of 2^32 = 4G of RAM.
Is this useful beyond RAM and memory cards?
It's common practice to divide a large set of bits, like those in the address, into smaller sub-groups to make them more manageable. Sometimes they're divided for physical reasons, such as address pins and memory cards; other times it's for logical reasons, such as IP addresses and subnets. The beauty is that the implementation details are irrelevant to the end user. If you access memory at address 0x48C7D3AB, you don't care which RAM chip it's in, or how the memory is arranged, as long as a memory cell is present. And when you browse to 67.199.15.132, you don't care if the computer is on a class C subnet as long as it accepts your upvotes. :-)