Why does a 32-bit OS support 4 GB of RAM?

前端 未结 13 2003
不知归路
不知归路 2020-12-08 04:18

Just reading some notes in a purdue lecture about OSs, and it says:

A program sees memory as an array of bytes that goes from address 0 to 2^32-1 (0

13条回答
  •  时光说笑
    2020-12-08 04:53

    Everybody is saying 2^32 = 4GiB, which is right. Just in case, here is how we got there:

    A 32-bit machine uses 32 bits to address memory. Each bit has a value of 0 or 1. If you have 1 bit, you have two possible addresses: 0 or 1. A two-bit system ( pun aside ) has four possible address: 00 =0, 01=1, 10=2, 11=3. 2^2=4. Three bits have 8 possble 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 are at 4GiB.

提交回复
热议问题