Skip to content
BetterDL

Word address

Also called: word number, word index, word addressing, word-addressable, word-addressable memory

The number of a whole word in memory. In a byte-addressable memory with 4-byte words, word n starts at byte address 4n, and the word number is the byte address ÷ 4.

Two ways of numbering memory meet in this idea.

Word-addressable memory. Every address names a whole word. Address 5 is the sixth word, however many bits it has. All the 2ᵏ × n memories in this topic are word-addressed: each address holds one n-bit word.

Byte-addressable memory. Every byte has an address (byte addressing), and a word spans several addresses. The word number (word address) then has to be converted:

  • word n starts at byte address 4n (for 4-byte words)
  • byte address b is in word ⌊b ÷ 4⌋, at byte b mod 4

In binary that's just a split: the low two bits of a byte address pick the byte within the word, and the remaining bits are the word number. That's also why aligned words start at addresses ending in 00.

The address bits needed differ too. 64K 16-bit words need 16 bits as a word address, but the same 128 KiB needs 17 bits if every byte has its own address.

1
32
0
16
0
8
1
4
1
2
0
1

Worked examples

Example

Byte address to word number

Byte-addressable memory, 32-bit words. Which word holds byte address 38?

  1. 1.

    38 = 100110, shown in the diagram.

  2. 2.

    Low two bits 10 → byte 2 within the word.

  3. 3.

    Remaining bits 1001 = 9 → word 9.

  4. 4.

    Check: word 9 starts at 36 and covers 36–39. ✓

Example

Word number to byte address

Same memory. Where does word 12 start?

  1. 1.

    4 × 12 = 48 = 30₁₆.

  2. 2.

    It covers bytes 48–51 (30₁₆–33₁₆).

Common mistakes

  • Using the word number as the byte address. In a byte-addressable memory, word 5 starts at 20, not 5.

  • Dividing by the word size in bits. For 32-bit words, divide the byte address by 4 (bytes), not 32.

Practice Word address

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

Learn it step by step

Word address is taught in Memory.