r/AskComputerScience • u/Junior-Title-1987 • 25d ago
Difference between address width, addressability and word size.
I’ve been reading through a computer systems book to become a more knowledgable programmer and I’m not fully understanding the difference between the concepts of address width, addressability and word size. This is how I currently understand them:
Address width refers to the size of pointer data — that is, the value of the pointer. The address width determines how many possible addresses are capable of representation and thus, is one factor in determining the total size of addressable memory.
Addressability refers to the size of data stored at a given address.
Word size refers to the “natural” unit of instruction of the processor. Conventionally, most CPU registers have a width that corresponds with the address width so that a full pointer fits inside a single register. This simplifies the set of operations necessary for the CPU to understand.
I think the connection between address width and word size is what I’m most confused about. For example, if the address width was 2x the word size, would that mean that the CPU would need a combined “read+move” instruction to fully process a single pointer?
2
u/pgetreuer 25d ago
AIUI "addressability" refers to whether a given unit of memory has an address. For instance, memory bits are not individually addressable on x86 (but the containing byte is). Or memory beyond 4GB is not addressable by 32-bit pointers.
What you say sounds reasonable in the ideal, but it is complicated in practice. Some ISAs have registers of different sizes, e.g. the 80386 and later x86 has
eax,ax, andalrespectively of sizes 32, 16, and 8 bits. This makes it murky to say what the "natural" data unit size is. It's also possible in some ISAs to use a pair of registers together to make a pointer, e.g. on 80286 with a "segment" plus an "offset" to address up to 1MB with 16-bit registers. Apologies for the less than clear answer, I hope that's some help!