how a 32bit processor can address 4 gigabytes of memory [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Cl开发者_开发知识库osed 12 years ago.
Improve this questionI didnt understand this because 2^32 is 4 giga bits not bytes right ? since 2^2 * 1024* 1024* 1024 bits right ? Am I wrong ?
The smallest individually addressable unit of memory is a byte. Bits don't have addresses. You have to read a byte or more and then do bit masking and such to get at the individual bits.
As far as i can recall from my college days, this is how it goes
If 32 = size of the address bus, then the total number of memory addresses that can be addressed = 2^32 = 4294967296
However, these are 4294967296 Addresses of memory locations. Since each memory location itself = 1 Byte, hence this gives us 4294967296 bytes that can be addressed.
Hence 4GB Memory can be addressed.
No, it is Gigabytes. A byte has 8 bits so you have to multiply the resulting number by 8 to get the bits. As john said in his answer you cant address individual bits, you will have to do bit shifting and masking to get to individual bits.
In the old console days SNES and Megadrive games were measured in MegaBits because by definition an 8MegaBit game sounds bigger than a 1 MegaByte game. In the end most people said 8Megs so again the confusion gave the impression of 8Megabytes for most people. Im not sure if brett is talking about SNES or Megadrive programming but remember 8 Megabits = 1 Megabyte.
the above answer solves it, and if you wish to address more then 4 gb then you can use an offset memory register, that can help you address a wider range.
精彩评论