Skip to content
BetterDL

Memory address

Also called: memory addresses, location number, storage address

The number that identifies one location in a memory. Addresses start at 0, so a memory with N words has addresses 0 to N − 1.

Every location in a memory has a number, its address. To read or write a word, you put its address on the address lines and the memory connects that one location to the data lines.

Three facts to hold on to:

  • Addresses start at 0. A memory with N words uses addresses 0, 1, …, N − 1. The last address is one less than the number of words.
  • The address is fixed, the contents change. Address 5 is always the same location; what it holds depends on the last write.
  • Addresses are binary numbers on wires. With k address lines, the addresses run from all 0s to all 1s, that is from 0 to 2ᵏ − 1.

Because long binary numbers are hard to read, addresses are usually written in hexadecimal: each hex digit is exactly 4 address bits. A 12-bit address runs from 000₁₆ to FFF₁₆.

Inside the chip, an address decoder turns the address into one active word line. In a whole system, the high address bits also choose which chip responds, laid out in a memory map.

1
8
1
4
0
2
1
1

Worked examples

Example

Putting an address on the lines

A memory has 16 words. Which pattern selects address 13?

  1. 1.

    16 words = 2⁴, so there are 4 address lines, A3–A0.

  2. 2.

    13 = 8 + 4 + 1 = 1101₂, shown in the diagram.

  3. 3.

    So A3 A2 A1 A0 = 1 1 0 1.

  4. 4.

    The highest address is 15 = 1111₂ = F₁₆.

Example

Last address of a 512-word memory

Find it in decimal and in hex.

  1. 1.

    512 words → addresses 0 to 511.

  2. 2.

    511 = 1 1111 1111₂ (nine 1s, since 512 = 2⁹).

  3. 3.

    In hex: 1FF₁₆.

Common mistakes

  • Starting at 1. The first address is 0, so the last is N − 1, not N.

  • Thinking the address changes when you write. Writing changes the contents; the address stays.

  • Dropping leading zeros when splitting an address into fields. Write all k bits before reading off the high bits.

Practice Memory address

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Memory address is taught in Memory and Basic CPU / Computer Architecture.