Reputation: 111
This is my first logic before any research:
since it's a 32 bit machine, there will be 2 ^ 32 spaces (which is ~ 4 billion) But they are in bits, so I have to convert it into bytes. (~4billion / 8) Then I get ~ 500 million bytes, or ~500MB.
I was actually curious why it's not 500 MB, so I found this:
"By definition, a 32-bit processor uses 32 bits to refer to the location of each byte of memory. 2^32 = 4.2 billion, which means a memory address that's 32 bits long can only refer to 4.2 billion unique locations (i.e. 4 GB)." (original source)
But then I'm confused again since, each memory address is 32-bit long, and there are 4.2 billion of them. Each memory address is 4 bytes, not 1 byte. So it will be 4.2 Giga * 4 bytes = 16.8 GB.
Well obviously I'm missing something in my logic. Any clarifications?
Upvotes: 2
Views: 1218
Reputation: 179779
You're confusing the length of an address with the size of the memory located at that address. They are pretty unrelated.
By far the most common choice for 32 bits machines it to organize the memory in 2^32 unique addresses, each of which holds 8 bits (1 byte). To uniquely address each bit, you therefore need 32+3 bits. In practice, memory is loaded into cache in 128 or 256 bit chunks (8 or 16 byte), so physically only 32-3 or 32-4 address lines are needed. So why do we still use the term 32 bits? That's because the address registers are physically 32 bits big. There are "load byte" instructions but usually not "load bit". (If there are, you typically have 8 of them)
Upvotes: 1
Reputation:
A 32-bit CPU means it can access 2^32=42,94,967,296 memory locations (each memory location is 1 byte long). If we divide 4294967296 bytes of memory by 1024 we get 4194304 KB of memory. Further if we divide again by 1024 we get 4096 MB of memory which is 4 GB.
Upvotes: 1
Reputation: 43728
In a typical modern machine each byte is addressable individually. Thus, 4G addresses means 4G Bytes.
Upvotes: 1