字可寻址和字节可寻址之间的区别 [英] Difference between word addressable and byte addressable
问题描述
有人可以解释Word
和Byte
可寻址之间的区别吗?它与内存大小等有什么关系?
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.
- 二进制地址始终始终仅指向
a single
字节. - 字仅为
a group of
字节–2
,4
,8
取决于数据总线size of
CPU. - A binary address always points to
a single
byte only. - A word is just
a group of
bytes –2
,4
,8
depending upon the data bussize of
the CPU. - MAR (内存地址寄存器)
- MDR (内存数据寄存器)
- PC (程序计数器寄存器)
- MBR (内存缓冲区寄存器)
- MAR(memory address register)
- MDR(memory data register)
- PC(program counter register)
- MBR(memory buffer register)
-
32-bits
用于数据/地址
OPCODE 的 -
8-bit
. 32-bits
for data/addresses8-bit
for OPCODE.
存储单元 是可寻址的 .这是我们使用内存的唯一方法.
Memory units are addressable. That is the only way we can use memory.
实际上,内存只是 可寻址的字节 .这意味着:
In reality, memory is only byte addressable. It means:
要了解 内存操作 完全,您必须熟悉 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:
RAM 具有two
种内存端口:
假设 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
机器的字节 4
,5
,6
,7
.在实际物理内存中,仅字节可寻址.因此,有一个技巧来处理单词寻址.
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屋!