varun
varun

Reputation: 361

Is it true to say that 32bit machine can access 2^32 bytes of RAM

just a curiosity. I have seen this in many articles and posts on the internet. when comparing between 32bit and 64bit architectures, many a times people refers to the maximum amount of memory they can access. Are statements like "a 32bit processor can access 4G(2^32) of RAM" always correct.?

As per my understanding 32/64 bit refers to the size of CPU registers. But the actual amount of RAM the CPU can access depends on its address bus size.

For example 8086 which is a 16bit ,memory is not limited to 64KB(2^16) but 1MB(2^20)[which it achieves through segmentation] because its address bus is 20bit long. Similarly current 64bit CPUs cannot access the entire 2^64 memory locations since most of them have only 48bit address bus.

Your suggestions please.

Upvotes: 1

Views: 570

Answers (2)

VAndrei
VAndrei

Reputation: 5590

There are (many) cases where 32 bit CPUs can access more than 4GB of RAM. Most 32 bit CPU's have Physical Address Extension mechanism, allowing the access of more than 4GB.

This is a HW feature that is enabled by the Operating System. The HW part is a wider Addrees BUS with some control mechanisms, the OS part is virtual memory management.

Even if the machine is able to access more than 4GB, the virtual address length remains the same (32 bit) if you have a 32 bit OS running on a 32 bit machine. This means that each process can access 4GB of virtual memory (usually backed up by physical RAM). However, there are cases when even a 32 bit process, can use more than 4GB, due to OS features - see here for Windows.

Even with no features like AWE, in a machine with PAE, running multiple processes means using more than 4GB of RAM.

Your last paragraph is correct. But from a programmer's point of view, you would be interested more in what your process can use.

Is it true to say that 32bit machine can access 2^32 of RAM?

Yes, it's true that 32 bit systems can access 2^32 B of RAM. It's wrong to say that 32 bit systems can access only 2^32 B of RAM.

Upvotes: 3

user3344003
user3344003

Reputation: 21647

Are statements like "a 32bit processor can access 4G(2^32) of RAM" always correct.?

No, such statements are generally incorrect.

A lot of processors had hardware limits that reduced the amount of physical memory from their theoretical maximum.

As mentioned above, some processors use segmentation methods to expand the address space beyond the theoretical processor limits. However, it was more common to have larger address spaces with smaller addresses. For example, later PDP-11, 16-bit computers often had a megabyte of memory.

The general trend in 32-bit processors was that segments would extend the virtual memory but not the physical memory. For example, a 80386 chip could theoretically access 4GB of physical memory and 64th of virtual memory.

64-bit processors arrived before the general need for more than 4GB of memory with 32-bit processors.

(I am omitting the problem of kernel v. user spaces)

Upvotes: 1

Related Questions