Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is RAM in powers of 2?

Why is the amount of RAM always a power of 2?

512, 1024, etc.

Specifically, what is the difference between using 512, 768, and 1024 RAM for an Android emulator?

like image 499
Evorlor Avatar asked Feb 28 '14 13:02

Evorlor


People also ask

Why are computers in powers of 2?

Because two is the base of the binary numeral system, powers of two are common in computer science. Written in binary, a power of two always has the form 100...000 or 0.00...001, just like a power of 10 in the decimal system.

What is RAM's power?

The ram represents the power to penetrate, overcome, and achieve. It reflects the assertion of strength in creative ways to achieve a breakthrough. It is also associated with sacrifice. The ram serves as the icon for action, the fifth element of heroism.

What happens to RAM's contents when you turn the power off?

Random Access Memory is volatile. That means data is retained in RAM as long as the computer is on, but it is lost when the computer is turned off. When the computer is rebooted, the OS and other files are reloaded into RAM, usually from an HDD or SSD.

Why are bytes in multiples of 8?

Originally a byte was designed to be able to hold the entire ASCII table in it, well not the table itself but to be able to represent all if it's possible characters. The extended ASCII table is 255 characters which is 2^8 - 1, basically that's why it is 8 bits.


2 Answers

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.

from https://superuser.com/questions/235030/why-are-ram-size-usually-in-powers-of-2-512-mb-1-2-4-8-gb

as referenced by BrajeshKumar in the comments on the OP. Thanks Brajesh!

like image 148
Evorlor Avatar answered Oct 20 '22 23:10

Evorlor


Because computers deal with binary values such as 0 and 1, because registers are on(1) or off(0)

So if you use powers of 2, your hardware will use 100% of the registers.

If computers used ternary values in their circuits, then we'd have memory, processors and anything else in powers of 3.

like image 38
Leo Avatar answered Oct 20 '22 22:10

Leo