5
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ superuser.com/questions/235030/… \$\endgroup\$
    – dim
    Jul 26, 2019 at 11:05
  • \$\begingroup\$ Historic reason for why it is like that. It was easier to work in nybble and octal formats when computer engineers invented instruction sets. Read history 70s to 80s. Could also read about early punch cards. And yes, base-2 is simplest form of arithmetic when you only got two voltage levels. Read on transistors and so on also. \$\endgroup\$ Jul 27, 2019 at 11:59

4 Answers 4

13
\$\begingroup\$

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.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Implied but unsaid: each address line can have two states, 0 and 1. If you had tri-state address lines, you could have 59049 bits. (Or trits, if those were also tri-state). That is why the question explicitly mentions binary logic. \$\endgroup\$
    – MSalters
    Jul 26, 2019 at 15:57
  • \$\begingroup\$ @MSalters actually the word "tri-state" has a commonly understood meaning which is high impedance, or open. I think what you meant was 3-state. We can extend this logic to Quits, or quad-states etc etc. \$\endgroup\$ Aug 2, 2019 at 7:38
25
\$\begingroup\$

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.

\$\endgroup\$
5
\$\begingroup\$

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).

\$\endgroup\$
1
\$\begingroup\$

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?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.