Addressability refers to the size of memory elements that are given consecutive addresses.
If each byte has a unique address, we have byte addressing.
If each word is given a unique address, but the bytes within a single word cannot be distinguished, we have word addressing.
byte word addressable addressable ------- ------- 0 | | 0 | | ------- ------- 1 | | 1 | | ------- ------- 2 | | 2 | | ------- ------- 3 | | 3 | | ------- ------- 4 | | 4 | | ------- ------- 5 | | 5 | | ------- ------- | | | |
Notice that these diagrams look the same. The difference is in the number of bits that is contained in the box. Given in MIPS precisions, there are 8 bits in each box of the byte addressable diagram, and there would be 32 bits in each box of the word addressable diagram.
MAL (and MIPS in general) is byte addressable. The x86 Intel architecture is also byte addressable.
An interesting, and possibly useful diversion. . .
If we have an integer-sized piece of data, we may want to identify the various bits. This can be done by numbering the bits.
Start numbering from 0, on the right side (least significant end)
31 30 29 2 1 0 --------------------------------------------- | | | | . . . | | | | ---------------------------------------------
This is called little endian numbering (of bits).
Equally valid and logical would be to start numbering from 0, on the left side (most significant end)
0 1 2 29 30 31 --------------------------------------------- | | | | . . . | | | | ---------------------------------------------
This is called big endian numbering (of bits).
We can discuss similar numbering issues when considering the bytes within words (integer-sized data) on a byte-addressable machine.
word address --------------------------------- 0 | | | | | --------------------------------- 4 | | | | | --------------------------------- 8 | | | | | ---------------------------------
If the machine is byte addressable, then each byte has a unique address. Which is byte 0 (within word 0)?
big endian numbering of bytes within (32-bit) words is --------------------------------- 0 | | | | | ----^-------^-------^-------^---- | | | | | | | --- byte 3 | | --- byte 2 | --- byte 1 --- byte 0
little endian numbering of bytes within (32-bit) words is --------------------------------- 0 | | | | | ----^-------^-------^-------^---- | | | | | | | --- byte 0 | | --- byte 1 | --- byte 2 --- byte 3
It is common to have byte addressability, and access words. A word address is defined to be the smallest byte address of the bytes within that word.
Copyright © Karen Miller, 2006 |