字可寻址和字节可寻址之间的区别 [英] Difference between word addressable and byte addressable

查看:450
本文介绍了字可寻址和字节可寻址之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释WordByte可寻址之间的区别吗?它与内存大小等有什么关系?

Can someone explain what's the different between Word and Byte addressable? How is it related to memory size etc.?

推荐答案

  • 字节是一个 内存单元 存储
  • 的strong>
  • 内存芯片 充满了这些字节.
    • A byte is a memory unit for storage
    • A memory chip is full of such bytes.
    • 存储单元 可寻址的 .这是我们使用内存的唯一方法.

      Memory units are addressable. That is the only way we can use memory.

      实际上,内存只是 可寻址的字节 .这意味着:

      In reality, memory is only byte addressable. It means:

      • 二进制地址始终始终仅指向a single 字节.
      • 仅为a group of 字节248取决于数据总线size of CPU.
      • A binary address always points to a single byte only.
      • A word is just a group of bytes2, 4, 8 depending upon the data bus size of the CPU.

      要了解 内存操作 CPU 的各种寄存器 RAM 内存端口 .我认为您知道它们的含义:

      To understand the memory operation fully, you must be familiar with the various registers of the CPU and the memory ports of the RAM. I assume you know their meaning:

      • MAR (内存地址寄存器)
      • MDR (内存数据寄存器)
      • PC (程序计数器寄存器)
      • MBR (内存缓冲区寄存器)
      • MAR(memory address register)
      • MDR(memory data register)
      • PC(program counter register)
      • MBR(memory buffer register)

      RAM 具有two内存端口:

      1. 32-bits用于数据/地址
      2. OPCODE
      3. 8-bit.
      1. 32-bits for data/addresses
      2. 8-bit for OPCODE.


      假设 CPU 要从地址读取a (例如4 字节) xyz起. CPU将地址放在 MAR 上,向存储器控制器芯片发送存储器读取信号.接收到地址读取信号后,内存控制器会将数据总线连接到32-bit 地址 xyz开始的端口4 bytes将从端口流出到 MDR .


      Suppose CPU wants to read a word (say 4 bytes) from the address xyz onwards. CPU would put the address on the MAR, sends a memory read signal to the memory controller chip. On receiving the address and read signal, memory controller would connect the data bus to 32-bit port and 4 bytes starting from the address xyz would flow out of the port to the MDR.

      如果 CPU 要获取下一条指令,则会将地址放入 PC寄存器并将获取的信号发送到内存控制器.收到地址并获取信号后,内存控制器会将数据总线连接到 8位于接收到的地址的位端口 a single字节长 操作码会从 RAM 放入 CPU MDR .

      If the CPU wants to fetch the next instruction, it would put the address onto the PC register and sends a fetch signal to the memory controller. On receiving the address and fetch signal, memory controller would connect the data bus to 8-bit port and a single byte long opcode located at the address received would flow out of the RAM into the CPU's MDR.

      因此,当我们说某个寄存器可寻址内存字节可寻址时,这就是什么意思.现在,当您在 MAR 上的binary中放置decimal 2并意图读取单词 2而不是( byte 2)?

      So that is what it means when we say a certain register is memory addressable or byte addressable. Now what will happen when you put, say decimal 2 in binary on the MAR with an intention to read the word 2, not (byte no 2)?

      单词2表示32-bit机器的字节 4567.在实际物理内存中,仅字节可寻址.因此,有一个技巧来处理单词寻址.

      Word no 2 means bytes 4, 5, 6, 7 for 32-bit machine. In real physical memory is byte addressable only. So there is a trick to handle word addressing.

      MAR 放置在地址总线上时,其32位不会映射到32 地址行( 0-31).而是将 MAR bit 0连接到地址总线 line 2,将 MAR bit 1连接到地址总线 line 3等. MAR 的高位2 bits被丢弃,因为只有2^32以上的字地址才需要它们,而这对我们的32 bit机器都不是合法的.
      使用此映射,当 MAR 1时,address 4放在总线上,当 MAR 2放在公共汽车上,依此类推.

      When MAR is placed on the address bus, its 32-bits do not map onto the 32 address lines(0-31 respectively). Instead, MAR bit 0 is wired to address bus line 2, MAR bit 1 is wired to address bus line 3 and so on. The upper 2 bits of MAR are discarded since they are only needed for word addresses above 2^32 none of which are legal for our 32 bit machine.
      Using this mapping, when MAR is 1, address 4 is put on the bus, when MAR is 2, address 8 is put on the bus and so forth.

      一开始很难理解.我从 Andrew Tanenbaums 结构化计算机组织 .

      It is a bit difficult in the beginning to understand. I learnt it from Andrew Tanenbaums's structured computer organisation.

      这篇关于字可寻址和字节可寻址之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆