地址空间和字节寻址能力
微处理器采用24位地址总线和16位数据总线进行字节寻址,一个字包含两个字节。有人问我一个关于连接外设、添加内存和地址空间的问题,其中有一些一般概念,我不明白它们为什么起作用。
为什么要使用地址总线而不是数据总线来计算地址空间?地址空间是地址总线的函数还是与微处理器有关?一个字包含两个字节有何关系?
A microprocessor is byte addressable with 24bit address bus and 16bit data bus and one word contains two bytes. I was asked a question regarding attaching peripherals, adding memory, and address space and there's a few general concepts I don't see why they work.
Why is it that to calculate the address space you use the address bus not the data bus? Is the address space a function of the address bus or does it have to do with the microprocessor? How is it relevant that one word contains two bytes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为地址位会发送到内存子系统,告诉它们您要读取或写入哪个内存位置。数据位仅携带正在读取或写入的数据。
是的,地址空间是地址总线的一个函数,尽管您可以使用一些技巧来扩展可以使用的内存量。
一个例子是存储体切换,它为您提供了更多可访问的内存,但没有更多的地址空间(多个内存块共存于同一地址,一次一个)。
下面显示了另一个示例,只要您愿意只读取和写入单词,您就可以有效地将可用内存加倍。
数据总线大小通常决定存储单元的大小。更大的内存单元可能意味着您可以拥有更多的可用内存,但并不是更多的内存单元。
以您的示例为例,假设您只能访问单词,您可以获得 16 兆单词,即 32 兆字节。
当然,这取决于内存是如何组合在一起的。您可能能够访问单个字节边界上的内存(例如,字节 0/1 或 1/2 或 2/3),而不仅仅是字边界,这意味着您实际上并没有获得完整的 32MB,而只是当您读取地址
FFFFFF
处的字时,可能需要 16MB 加上一个额外字节)。Because it's the address bits that go out to the memory subsystem to tell them which memory location you want to read or write. The data bits just carry the data being read or written.
Yes, the address space is a function of the address bus though there are tricks you can use to expand how much memory you can use.
An example of that is bank switching which gives you more accessible memory but no more address space (multiple blocks of memory co-exist at the same address, one at a time).
Another example is shown below where you can effectively double the usable memory, provided you're willing to only read and write words.
The data bus size generally dictates the size of a memory cell. Larger memory cells can mean you can have more memory available to you but not more memory cells.
With your example, assuming you can only access words, you could get 16 megawords which is 32 megabytes.
This depends, of course, on how the memory is put together. It may be that you are able to access memory on individual byte boundaries (e.g., bytes 0/1 or 1/2 or 2/3) rather than just word boundaries, which would mean you don't actually get that full 32MB but only 16MB plus maybe one extra byte when you read the word at address
FFFFFF
).