-5

What I don't understand is where the 4 GigaBytes comes from.

Most of the articles I read say that 2^32bits = 4 GigaBytes, but this doesn't seem correct given that 8 bits = 1 byte.

For a 32 bit OS: 2^32 = 4,294,967,295 bits = 4.2 Giga bits = 536870911.875 bytes = 0.4999999998836 Giga bytes

Can someone please enlighten me as to what I'm missing?

2
  • 5
    Let me Stackoverflow that for you: stackoverflow.com/questions/1119278/…
    – Ryan Ries
    May 3, 2013 at 23:33
  • It's the address space. Unless you resort to Kludges, that's what is directly addressable by the processor and therefore the OS written for that processor. Get a 64 bit OS and the next level processor quits having to emulate the previous version. This has been answered many times, many many times. No, we aren't stupid and we didn't get the math wrong. MEGO May 4, 2013 at 0:53

1 Answer 1

2

It's not "2^32 bits = 4 GigaBytes", it's "2^32 bytes = 4 GigaBytes". A CPU doesn't handle memory in bits, it handles memory in bytes (*).

In order to use memory, a CPU needs to be able to address it; the address of a byte in memory is a 32-bit number which acts as an index in the computer's RAM. Thus, a 32-bit CPU is able to address at most 2^32 bytes, i.e. 4 GB.

For more details, see here.

(*) Usually.

3
  • 1
    "Thus, a 32-bit CPU is able to address at most 2^32 bytes, i.e. 4 GB." This is completely untrue. 32-bit CPUs have been handling more than 4GB of RAM for about 20 years now. In the x86 lineup, the Pentium Pro, released in 1995, was a 32-bit CPU that could address up to 64GB of memory. The 4GB limit is a software limitations of some 32-bit operating systems, not a hardware limitation of 32-bit CPUs. May 4, 2013 at 10:07
  • I know there is a little more than "4 GB is the roof limit". I was just trying to keep it simple so not to confuse the OP even more.
    – Massimo
    May 4, 2013 at 16:33
  • 1
    It is often challenging to keep something simple without saying things that are actually false. But I think it's important. May 4, 2013 at 18:55

Not the answer you're looking for? Browse other questions tagged .