Why are computer memory capabilities often multiples of a power of two, such as 2^10 = 1024 bytes?
I think it is something related to the binary logic, but I do not understand the precise reason for that.
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityWhy are computer memory capabilities often multiples of a power of two, such as 2^10 = 1024 bytes?
I think it is something related to the binary logic, but I do not understand the precise reason for that.
A 1024 x 1 memory chip requires 10 address lines and you get full utilisation of all addresses. Now, if someone brought out a 600 x 1 memory chip, it would still need 10 address lines. It can’t use 9 because that could only uniquely define 512 memory positions.
Then think of what would happen if someone wanted to use two of the 600 x 1 memory chips to give a combined memory size of 1200. How would the address lines (plus 1 more) cope with numerically embracing each address slot uniquely and, if there is an MCU incrementing through memory in order to store contiguous data, that MCU would need special knowledge about the binary address numbers that are unused.
Memory addresses are binary numbers. The range of an N-bit (unsigned) binary number is 0 to 2N-1, a total of 2N different values.
Since addresses are passed to memory chips as binary numbers, it makes sense to build them in capacities of powers of 2. That way, none of the address space is wasted, and it's easy to combine multiple chips/modules to build larger memory systems with no gaps in the address space.
With 1 address wire you can access 2 different addresses. With N address bits or wires, you can access 2^N different addresses. Not much more complex than labeling 10 different items with single decimal digit or 26 different items with a single letter (depending on how many letters you have in your alphabet of course).
This is true for computers which use the binary system for number representation, and all modern computers do. Using powers of the base means using round numbers, which makes the math a lot easier, and easier math means simpler implementation.
For example, how many grams are in 5 kg? 5000, right? Now imagine we define a kilogram as a unit of 679 grams. How many grams are 5 kg now?