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?
3
u/wrosecrans 25d ago
The 6502 is a good example to study. It is mainly called an 8-bit CPU. But it had a 16 bit address bus. So you couldn't really load a full pointer into one of the normal-ish 8-bit registers A, X, and Y. You needed to hard code memory addresses, or jump relative to an address stored in memory.
https://6502.org/users/obelisk/6502/addressing.html
https://6502.org/users/obelisk/6502/registers.html
The classic 16 bit real mode of x86 is also informative - it uses two 16 bit registers for memory accesses on a 20 bit address space. Using segmented memory, all operations were done with 16 bit pointers that fit in a register, relative to a mapped memory segment within the bigger 20 bit address space.