So you know that RAMs contain storage space. Common sense. Every byte of memory on RAM requires to have an address allocated to it. A 32-bit machine uses 32 bits long address to designate each byte of memory. And a memory that does not have an address allocated can not be seen by the machine.
Now let’s understand how these addresses work.
Each bit has a value of 0 or 1. If you have 1 bit long address, you have two possible addresses: 0 or 1. A two-bit system has four possible address: 00 =0, 01=1, 10=2, 11=3. 2^2=4. Three bits have 8 possible addresses: 000=0, 001=1, 010=2, 011=3, 100=4, 101=5, 110=6, and 111=7.
Each bit doubles the potential address space, which is why 2^n tells you how many addresses you use for a given number of bits. 2^1 = 2, 2^2 = 2*2 = 4, 2^3 = 2*2*2 = 8, etc. By the time you get to 32 bits, you have allocated address to 2^32 = 4294967296 bytes of RAM space which is equal to 4GB
.
(((2^32bytes/2^10)KB)/2^10)MB)/2^10)GB = 2^2GB
Okay, so if the processor, and the operating system designed for that processor, can only handle 4GB, why can’t your PC (if it’s 32-bit) see that much practically?
Because not all of those addresses are available for RAM. There are other pieces of hardware inside your computer that need addresses, such as the PCI bus and the USB host adapter, Graphics card, etc.
Whenever you store something in the memory, you need to save the address to be able to read or manipulate it. Usually, the CPU uses only one register (32 bit in size) to store this address. Since there are only 2^32
different addresses, anything exceeding the 4GB
mark remains unused.
However, there are techniques like Physical Address Extension (PAE) that allow a 32-bit OS to address more than 4GB
of RAM.