6 Answers
6

Memory is closely tied to the CPU, so making their size a power of two means that multiple modules can be packed requiring a minimum of logic in order to switch between them; only a few bits from the end need to be checked (since the binary representation of the size is 1000...0000 regardless of its size) instead of many more bits were it not a power of two.

Hard drives are not tied to the CPU and not packed in the same manner, so exactness of their size is not required.

Simply speaking, computers work in 1s and 0s. That's what binary is. The computer uses this system to address memory. In a simple (read "ancient") system, a certain number of processor lines or memory address unit lines are dedicated to selecting the address of a particular location in memory. Since those lines can only carry values of "high" or "low" each line represents a binary digit. So the number of locations that can be addressed is two to the power of the number of lines.

There is a correspondence between this and the address registers in the processor. Two to the number of bits in the register is the number of locations that can be addressed.

As memory sizes increased and computers became more powerful, a number of schemes have been employed to extend this capability and work around various limitations.

Please note that this overview is a greatly simplified look at a complex subject.

The binary system is known as base 2 because there are two possible values: 0 and 1 (on and off, high and low, 5V and 0V), compared to the normal natural number system known as base 10 (0-9). Hard drive manufacturers want their capacity to appear higher, so a 1GB drive (base 10, 1 billion bytes, 109) is really only 0.9313GiB (base 2, 2something) (this is also the reason for the disparity between what the computer reports and what the box says). The same is true for DVD discs.

Digital electronics used in computers have two states: on and off. So storage of numbers in memory is made up of collections of elements each of which is on or off.

So one element can therefore only represent the numbers 0 and 1 (two values).
If you combine two of these you can now represent 2 to the power of two (four) numbers 0…3.

off, off = 0

off, on = 1

on, off = 2

on, on = 3

If you have three elements you can represent two to the power of three (eight) numbers 0…7.

off,off,off = 0

off,off,on = 1

off,on,off = 2

off,on,on = 3

on,off,off = 4

on,off,on = 5

on,on,off = 6

on,on,on = 7

And so on.

The element might be a switching transistor or something equivalent which is in an on or an off state, it could be a tiny patch of hard disk surface that is magnetised parallel or perpendicular to the direction of rotation (two states).

Hence everything naturally is organised in powers of two.

We only use powers of 10 because we have ten fingers (including thumbs), Computers don't.

Bulk production is usually cheaper then diverse production. Producing 128MB and 256MB prints can be more expensive then just producint 256MB prints.

So if not a whole lot of different ram is produced you can best 'double' them to achieve the cheapest result.

Installing two of the same ram strips has the advantage that they should work together. Mixing different brands can result in some small differences slowing your machine down.

Dual channel ram works really great together if you add two strips off ram that are the same.

Ram is produced using smaller 'sub' chips. These chips are usually locked into a usable size. OS'es from a histroically prospective like simple 1024Kb blocks to use. So you wan't a multiple from that installed.