Why are RAM module capacities in powers of two (512 MiB, 1, 2, 4, 8 GiB)?

23

8

Newer computers usually have 2, 4, 8, etc. GiB of RAM. The older ones usually have 128, 256, 512 MiB or less but also in powers of two.

What is the reason behind this? Why don't hard disks and DVD discs follow this norm?

Louis Rhys

Posted 2011-01-19T03:10:39.930

Reputation: 1 543

Note that MB and GB are NOT powers of two, MiB and GiB are. – arielnmz – 2015-11-26T13:19:01.277

Answers

27

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.

Ignacio Vazquez-Abrams

Posted 2011-01-19T03:10:39.930

Reputation: 100 516

By hard drives, does that include SSDs? Because I noticed SSD sizes are also powers of 2. The same for flash drives and SD cards (With exceptions like the SanDisk 200 GB sd card) – Abdul – 2016-06-01T11:17:42.250

@Abdul: They're powers of 2-ish. They still follow the HD practice of using kB, MB, etc. instead of kiB, MiB, etc. which would make them true powers of 2. They do so in order to provide extra blocks that can be remapped to in the event of block damage. But the underlying media is indeed powers of 2 or multiples thereof. – Ignacio Vazquez-Abrams – 2016-06-01T13:22:31.030

Sorry, I should clarify my question; I meant since SSDs, flash drives, and SD cards aren't tied to the CPU, like RAM is, is it as important to be a power of 2? – Abdul – 2016-06-01T13:37:17.343

@Abdul: It includes all secondary storage. – Ignacio Vazquez-Abrams – 2016-06-01T13:39:30.660

9

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.

Also see the Wikipedia article on Memory addressing.

Paused until further notice.

Posted 2011-01-19T03:10:39.930

Reputation: 86 075

5

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.

squircle

Posted 2011-01-19T03:10:39.930

Reputation: 6 365

this is also the reason for the disparity between what the computer reports and what the box says, more like the disparity between what Windows reports, many Linux desktops and apps now use the correct suffix for capacities. I believe also Mac OS does. – arielnmz – 2015-11-26T13:15:37.697

Check out this Wikipedia article for more info - http://en.wikipedia.org/wiki/Power_of_two

– Nick Josevski – 2011-01-19T03:46:40.740

1Here's some other relevant information! – Mateen Ulhaq – 2011-01-19T06:10:41.523

3@muntoo: You have linked to relevant info but your comment text is totally misleading and makes you look spammy. – Linker3000 – 2011-01-19T08:29:08.487

I edited @Muntoo's comment – Ivo Flipse – 2011-01-19T16:20:35.947

-1

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.

Jason

Posted 2011-01-19T03:10:39.930

Reputation: 99

-3

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.

Barfieldmv

Posted 2011-01-19T03:10:39.930

Reputation: 660

Only the last paragraph is related to this question, and even that is wrong... – jiggunjer – 2015-11-21T12:28:20.090