memory addresses usually start at zero and progress upward. Figure 4.4 illustrates
this concept.
An address is almost always represented by an unsigned integer. Recall from
Chapter 2 that 4 bits is a nibble, and 8 bits is a byte. Normally, memory is byteaddressable,
which means that each individual byte has a unique address. Some
machines may have a word size that is larger than a single byte. For example, a
computer might handle 32-bit words (which means it can manipulate 32 bits at a
time through various instructions), but still employ a byte-addressable architecture.
In this situation, when a word uses multiple bytes, the byte with the lowest
address determines the address of the entire word. It is also possible that a computer
might be word-addressable, which means each word (not necessarily each
byte) has its own address, but most current machines are byte-addressable (even
though they have 32-bit or larger words). A memory address is typically stored in
a single machine word.
If all this talk about machines using byte-addressing with words of different
sizes has you somewhat confused, the following analogy may help. Memory is
similar to a street full of apartment buildings. Each building (word) has multiple
apartments (bytes), and each apartment has its own address. All of the apartments
are numbered sequentially (addressed), from 0 to the total number of apartments
in the complex. The buildings themselves serve to group the apartments. In computers,
words do the same thing. Words are the basic unit of size used in various
instructions. For example, you may read a word from or write a word to memory,
even on a byte-addressable machine.
If an architecture is byte-addressable, and the instruction set architecture word is
larger than 1 byte, the issue of alignment must be addressed. For example, if we wish
to read a 32-bit word on a byte-addressable machine, we must make sure that: (1) the
word was stored on a natural alignment boundary, and (2) the access starts on that
boundary. This is accomplished, in the case of 32-bit words, by requiring the address
to be a multiple of 4. Some architectures allow unaligned accesses, where the desired
address does not have to start on a natural boundary.
Memory is built from random access memory (RAM) chips. (We cover memory
in detail in Chapter 6.) Memory is often referred to using the notation L x W
(length x width). For example, 4M x 16 means the memory is 4M long (it has