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

前端 未结 13 2005
不知归路
不知归路 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 05:15

    A CPU with 32 bit registers will need the operating system to calculate everything in chunks of 32 bits. It's a hardware requirement to which the OS must conform. Similarly, CPUs with 64 bit registers will need an operating system that reads and writes data from the RAM in chunks of 64 bits. (Every time you read data from memory, you need to read it into one of those registers - be it 32 bit, or 64 bit, or 16 bit, etc.)

    A 32 bit register can store 2^32 different RAM addresses. Each RAM address corresponds to a byte (8 bits) in modern RAMs. (The 4 GB argument is true only for those RAMs that have addresses for every byte.)

    => 2^32 = 4,294,967,296‬ addresses, → that corresponds to 4,294,967,296‬ bytes.

    Now, 1 KB = 2^10 bytes or 1024 bytes (in the binary system)

    Therefore, 4,294,967,296‬ bytes / 1024 = 4,194,304‬ KB

    4,194,304‬ KB / 1024 = 4,096‬ MB

    4,096‬ MB / 1024 = 4 GB

    0 讨论(0)
提交回复
热议问题