Skip to content
BetterDL

Byte addressing

Also called: byte-addressable, byte addressable memory, byte-addressable memory, byte address

A memory scheme in which every byte has its own address. A 4-byte word then spans four consecutive addresses, and word i starts at byte address 4i.

Most computers are byte-addressable: every 8-bit byte has its own address, even when the processor works with 32-bit or 64-bit words.

With 32-bit (4-byte) words:

  • each word occupies 4 consecutive byte addresses
  • word 0 is at bytes 0–3, word 1 at bytes 4–7, and so on
  • word i starts at byte address 4i

In binary, multiplying by 4 is shifting left two places. So the low two bits of a word's starting address are 00, and the bits above them are the word number. An address whose low two bits are 00 is aligned.

Going the other way, any byte address splits into two fields:

  • drop the low 2 bits → the word number
  • the low 2 bits → which byte within the word (0–3)

Counting address bits: a byte-addressable memory of 2ᵏ bytes needs k address bits. Here log₂ of the bytes is correct, because each address holds exactly one byte. In a ×16 or ×32 memory where each address holds a whole word, you'd use log₂ of the words instead.

1
16
1
8
1
4
0
2
0
1

Worked examples

Example

Where is word 7?

Byte-addressable memory, 32-bit words, word 0 at address 0.

  1. 1.

    Start: 4 × 7 = 28 = 1C₁₆.

  2. 2.

    It covers bytes 28, 29, 30, 31 (1C₁₆–1F₁₆). The last byte is 28 + 4 − 1 = 31.

  3. 3.

    In binary 28 = 11100: low bits 00, and the upper bits 111 = 7 are the word number.

Example

Which word holds byte 45?

Same memory.

  1. 1.

    45 = 101101.

  2. 2.

    Low two bits 01 → byte 1 within the word.

  3. 3.

    Upper bits 1011 = 11 → word 11.

  4. 4.

    Check: word 11 starts at 44, so byte 45 is its second byte (byte 1). ✓

Common mistakes

  • Giving consecutive words consecutive addresses (0, 1, 2…). With 4-byte words they are 0, 4, 8….

  • Taking log₂ of the words for a byte-addressable memory. Each address is a byte, so count bytes.

  • Putting a word's last byte at start + 4. It's start + 3: the same start + size − 1 rule as any block.

Practice Byte addressing

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

Learn it step by step

Byte addressing is taught in Memory and Basic CPU / Computer Architecture.