Skip to main content
Be Bitwise

What Are Addresses?

Addresses & Pointers · Memory & Systems track

3 min read

In this module

Every Byte Has a Number

Computer memory is one long stretch of bytes, and every byte gets its own numeric address. Byte 0 sits at address 0, byte 1 at address 1, all the way up to whatever ceiling the system's address space allows. On a 32-bit system that ceiling is roughly 4 billion (2^32) addresses. On a 64-bit system the ceiling — 2^64 bytes — is silly to even write out.

How the CPU Uses Addresses

When the CPU needs to read or write data, the dance is short:

  1. The CPU drops the target address onto the address bus — a set of wires running to the memory controller.
  2. The memory controller finds the physical cell at that address.
  3. On a read, the cell's data flies back to the CPU on the data bus. On a write, the CPU shoves new data onto the data bus and the controller stores it.

Here's one read drawn out, with time running downwards. The address only ever travels away from the CPU; the data comes back on separate wires.

The address and value here are made up for the example. A real memory system moves a whole cache line per trip rather than one byte, but the shape of the conversation is the same.

How wide the address bus is decides how many unique addresses the system can talk about. A 32-bit address bus reaches 2^32 = 4,294,967,296 bytes (4 GB). A 64-bit bus reaches vastly more, though no real-world system actually wires up the full range — chip designers settle for a useful subset.

Key Concept

Every byte in memory has a unique numeric address. The CPU uses the address bus to specify which byte it wants to access and the data bus to transfer the actual data. The width of the address bus determines the maximum amount of addressable memory.

Addressing Schemes

Not all architectures address memory the same way:

SchemeDescription
Byte addressingEach address refers to a single byte (most common today)
Word addressingEach address refers to a word (e.g., 4 bytes), less common

Most modern systems use byte addressing: each address picks out exactly one byte. Want to store something bigger? A 32-bit integer takes 4 bytes, so it sprawls across four consecutive addresses. By convention the integer's address is the address of its first byte.

You can watch that happen. This program prints the address of each element in an int array and a char array, along with the gap from the previous element. Predict both gaps first.

Try itSwitch the int array to double or long long and predict the new gap. The addresses themselves change from run to run; the gaps don't.
C (GCC 9.2.0)

Why Addresses Matter

Addresses are the bedrock for everything that follows. Pointers, arrays, structs, function calls, virtual memory — all of them lean on the idea that every piece of data sits at a specific, numbered slot. Write arr[i] and the compiler emits instructions that compute the element's address and ask the memory system to fetch the bytes there. Understanding addresses is understanding how the machine actually locates your data.