68

What is meant by 32bit or 64 bit machine?

It’s the processor architecture…a 32 bit machine can read and write 32bit data at a time same way with 64 bit machine….

whats the maximum memory that a 32 bit machine can access?

It is 2^32=4Gb (4Gigabit = 0.5 GigaByte)

That means 4Gb ram?

If I consider the same way for a 64 bit machine then I can have a ram of 16ExbiBytes ..is that possible?

Are my concepts right?

GorvGoyl
  • 27,835
  • 20
  • 141
  • 143
haris
  • 1,863
  • 4
  • 22
  • 24
  • 15
    2^32 = 4GB( here GB is gigabytes not gigabits because the addresses are not accessed/addressed to bit level by your OS). So, 2^32 = 4GB = 32 Gb – anurag86 Oct 09 '15 at 10:47
  • 3
    @anurag86 GB refers to the decimal value (1000^3) while GiB is used for the binary value (1024^3). – chipit24 Oct 25 '15 at 20:09
  • 1
    https://en.wikipedia.org/wiki/32-bit – chipit24 Oct 25 '15 at 20:09
  • http://www.translatorscafe.com/cafe/EN/misc/unitconv/mobile.asp?m=cvt&c=data-storage – anurag86 Oct 26 '15 at 04:19
  • 4
    Understanding the byte addressable scheme used by computers is critical to understanding this. Computers always work on addresses of bytes NOT bits. So using 32 bit addressing scheme you can address 4 Giga bytes of addresses. Please following this link - http://stackoverflow.com/questions/2724449/different-between-word-addressable-and-byte-addressable – RBT Aug 17 '16 at 05:42

7 Answers7

50

Yes, a 32-bit architecture is limited to addressing a maximum of 4 gigabytes of memory. Depending on the operating system, this number can be cut down even further due to reserved address space.

This limitation can be removed on certain 32-bit architectures via the use of PAE (Physical Address Extension), but it must be supported by the processor. PAE eanbles the processor to access more than 4 GB of memory, but it does not change the amount of virtual address space available to a single process—each process would still be limited to a maximum of 4 GB of address space.

And yes, theoretically a 64-bit architecture can address 16.8 million terabytes of memory, or 2^64 bytes. But I don't believe the current popular implementations fully support this; for example, the AMD64 architecture can only address up to 1 terabyte of memory. Additionally, your operating system will also place limitations on the amount of supported, addressable memory. Many versions of Windows (particularly versions designed for home or other non-server use) are arbitrarily limited.

Cody Gray
  • 222,280
  • 47
  • 466
  • 543
  • 2
    can you explain me the concept of reserved address space what does it mean? – haris Jan 15 '12 at 12:29
  • 5
    @haris: It just refers to the range of addresses that the operating system keeps for itself (for things like device drivers) and does not make available for use by applications. – Cody Gray Jan 15 '12 at 12:32
  • @CodyGray This answer is more confusing than explaining. You are constantly mixing physical address space (used by a processor) to virtual address space (used by software) – Saurabh Jan 18 '12 at 10:33
  • I hardly think they're "mixed". Yes, I mention both of them because they're both important constraints, but the distinction seems clear to me. Perhaps I'm biased. Feel free to improve the construction if you can think of a better way to express it. – Cody Gray Jan 20 '12 at 02:21
  • I am not sure what is the best way to rephrase it, but I will point out the confusion causing points: >>>>Yes, a 32-bit architecture is limited to addressing a maximum of 4 gigabytes of memory. Depending on the operating system, this number can be cut down even further due to reserved address space. <<<< Now you see you are mixing 32 bit physical address space by the kernel virtual address space. Also the mention of processor address space along with PAE can add to the confusion. The person who asked the question, is interested in 32 bit CPU vs 64 bit CPU – Saurabh Jan 25 '12 at 07:37
  • some facts to back your post: **1.** today's [most powerful supercomputer](http://www.top500.org) have "just" 1410 TB of RAM (a little over 2^50) **2.** virtual memory on Win7 x64 is [limited to 8 TB](http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx#memory_limits) (=2^43) – Alexander Malakhov Mar 01 '12 at 09:55
  • 1
    beware it's 4Gb (Gigabit) not 4GB(Gigabyte) – GorvGoyl Jul 07 '15 at 18:59
  • 7
    @jerry No, it isn't. It's 2^32 bytes, which is about 4.3 billion bytes. In other words, 4 gigabytes (GB). [Also known as 4 gibibytes (GiB)](https://blogs.msdn.microsoft.com/oldnewthing/20090611-00/?p=17933). Gigabits are a completely different thing meaning ~1 billion *bits*, not ~1 billion *bytes*. (Perhaps what's confusing you is that on a 32-bit architecture, RAM is addressed in terms of bytes, so the machine can access 2^32 bytes.) – Cody Gray Feb 08 '16 at 10:07
  • @CodyGray I have a question: where are the addresses stored? In other words, if I can have 2^32 addresses that point to 2^32 bytes of memory (in a 32-bit system), who is storing those addresses? For example, lets say the address `adr=00...01` is the first one, and is pointing to the first 8-bit block on the RAM: who is storing `adr`? – tomasyany Jul 28 '16 at 20:56
22

What's typically meant by 32-bit or 64-bit machine is the size of the externally visible ("architected") general-purpose integer registers.

This has very little to do with how the hardware is built though. For example, let's consider the (long obsolete) Intel Pentium Pro. It's normally considered a "32-bit" processor, even though it supports up to 36-bit physical addresses, has a 64-bit wide data bus, and internally computations on all supported operand types are carried out in a single set of registers (which are therefore 80 bits wide, to support the largest floating point type).

At least in the case of Intel processors, even though larger physical addressing has been available for a long time, the largest amount of memory directly visible within the address space of any one process on a 32-bit processor is also limited to 4 gigabytes (32-bit addressing). The 36-bit physical addressing allows addressing up to 64 gigabytes of RAM, but only 4 gigabytes of that can be directly visible at any given time.

The change to 64-bit machines mostly involved changing what was made visible to the user (or to code at the assembly language level). Again, what you see is rarely identical to what's real. For example, most 64-bit code sees pointers/addresses as being 64 bits, but actual processors don't support that large of addresses. Current CPUs support 48-bit virtual addresses, and (at least as far as I've noticed) a maximum of 40 bits of physical addressing. On the other hand, they're designed so in the future, when larger memory becomes practical, they can extend the physical addressing out to 48 bits without affecting software at all. Even when they increase the 48-bit virtual addressing, in a typical case it'll only affect a small amount of the operating system kernel (normal code is unaffected, because it already assumed addresses are 64 bits).

So, no: a 64-bit machine does not really support up to 64 bits of physical addressing, but most typical 64-bit software should remain compatible with a future processor that did support directly addressing that much RAM.

Jerry Coffin
  • 437,173
  • 71
  • 570
  • 1,035
  • It's worth noting that while languages didn't really support 8086 segmentation very well, a variation which simply simply extended segment registers to 32 bits could easily extend the amount of memory available in a framework like Java or .NET to 64GB, and with a few tweaks far beyond that. The reduced cache overhead of resulting from the use of 32-bit rather than 64-bit offset registers could make use of such code faster than 64-bit linear addressing. Too bad Intel never extended the segment registers beyond 16 bits. – supercat Feb 11 '14 at 07:06
  • Pentium used 80 bits for floating point, not general use. And AFAIU the 36-bit addresses (PAE) are a lot later than Pentium Pro. – vonbrand Mar 08 '14 at 17:03
  • @supercat, the 8088 (original PC) was a 16 bit CPU, but capable of addressing 1MiB (20 bits address) via segment shenanigans. Did never really work (just mention in front of some old hand the terms "near and far pointers" and "arrays larger than 64KiB," but be prepared to have to run away *fast*). AFAIU the IBM 370 architecture still does something similar. – vonbrand Mar 08 '14 at 17:08
  • @vonbrand: The point is that it used 80-bit *registers* for both integer and floating point operations. As far as addressing goes, see page 60 of the [Intel manual](http://download.intel.com/support/processors/pentiumpro/sb/24357001.pdf), specifically the description of `A[35:3]#` (though the fact that it goes up to `A35` should be a pretty solid indication in itself). – Jerry Coffin Mar 08 '14 at 18:19
  • @vonbrand: If one confined individual objects to 16-byte alignment, then having each object start at a constant offset in its segment (possibly zero, or possibly something else if one stores memory-management information at the start of each segment) could make addressing more efficient than it would have been using 32-bit pointers. This was easy to do in assembly language, but I don't know of any mainstream languages that could do it. The overhead from 16-byte alignment was really not severe, given the reduction in the size of pointers. The 8086 design suffered... – supercat Mar 08 '14 at 18:45
  • ...from having only one "non-dedicated" segment register, but I've not seen any other 16-bit processor since that could do a better job accessing a meg. The 80286 segmenting was far worse than that of the 8088, since every segment needs a dedicated entry in the descriptor table, which needs to be reloaded every time one switches segments. Imagine, though, if the segment registers on the 80286 were split into 3+13 bits; the top bit identifies one of eight super-segments, whose descriptors are kept in the CPU. Each super-segment has defined bounds, access rights, and a scaling factor... – supercat Mar 08 '14 at 18:52
  • ...so that an effective address will be (superseg-base) + (lower 13 bits of segment * scalefactor) + offset. Scale factor could be selectable from e.g. 16, 64, 256, 1024. One would then have eight memory areas, each of which could hold 128K worth of 16-byte-aligned objects, 512K worth of 64-byte-aligned objects, 2048K worth of 256-byte aligned objects, or 8192K worth of 1024-byte aligned objects--all while continuing to use two-byte object references. – supercat Mar 08 '14 at 19:02
14

Going back to a really basic idea, we have 32 bits for our memory addresses. That works out to 2^32 unique combinations of addresses. By convention, each address points to 1 byte of data. Therefore, we can access up to a total 2^32 bytes of data.

In a 32 bit OS, each register stores 32 bits or 4 bytes. 32 bits (1 word) of information are processed per clock cycle. If you want to access a particular 1 byte, conceptually, we can "extract" the individual bytes (e.g. byte 0, byte 1, byte 2, byte 3 etc.) by doing bitwise logical operations.

E.g. to get "dddddddd", take "aaaaaaaabbbbbbbbccccccccdddddddd" and logical AND with "00000000000000000000000011111111".

Kevin Lee
  • 2,087
  • 22
  • 29
  • If memory is byte-addressable, then you should be able to address each byte without having to perform logical operations on the word, no? – chipit24 Oct 25 '15 at 20:04
  • Method 1: Given a memory address, we would know which word to retrieve (probably put the word into a 32 bit register first). In the next cycle, we can extract the correct byte from that word via logic operations. Method 2: Design the circuit hardware to make each memory address directly connect to each byte in memory. Both ways make memory effectively byte-addressable. There are multiple ways of implementing this with their own pros and cons. I was aiming for a more conceptual understanding in the answer. – Kevin Lee Nov 07 '15 at 06:04
5

basically 32bit architecture can address 4GB as you expected. There are some techniques which allows processor to address more data like AWE or PAE.

rkosegi
  • 12,129
  • 5
  • 46
  • 75
4

Yes, on a 32bit machine the maximum amount of memory usable is around 4GB. Actually, depending on the OS it might be less due to parts of the address space being reserved: On Windows you can only use 3.5GB for example.

On 64bit you can indeed address 2^64 bytes of memory. Not that you'll ever have those - but then again, a long time ago the same thing was said about ever needing more than 640kb of memory...

ThiefMaster
  • 285,213
  • 77
  • 557
  • 610
2

No your concepts are not right. And to set it right you need the answer to the question that you incorrectly answered:

What is meant by 32bit or 64 bit machine?

The answer to the question is "something significant in the CPU is 32bit or 64 bit". So the question is what is that something significant? Lot of people say the width of data bus that determine whether the machine is 32bit or 64 bit. But none of the latest 32 bit processors have 32 bit or 64 bit wide data buses. most 32 bit systems will have 36 bit at least to support more RAM. Most 64 bit processors have no more than 48bit wide data bus because that is hell lot of memory already.

So according to me a 32 bit or 64 bit machine is determined by the size of its general purpose registers used in computation or "the natural word size" used by the computer.

Note that a 32 bit OS is a different thing. You can have a 32 bit OS running on 64 bit computer. Additionally, you can have 32 bit application running on 64 bit OS. If you do not understand the difference, post another question.

So the maximum amount of RAM a processor can address is 2^(width of data bus in bits), given that the proper addressing mode is switched on in the processor.

Further note, there is nothing stopping someone to introduce a multiplex between data Bus and memory banks, that will select a bank and then address the RAM (in two steps). This way you can address even more RAM. But that is impractical, and highly inefficient.

Saurabh
  • 1,069
  • 7
  • 17
  • So according to me a 32 bit or 64 bit machine is determined by the size of its general purpose registers used in computation or "the natural word size" used by the computer. -- no its the address size. You cannot really go by register size. In 16 bit mode you can access 32 bit registers . For example in real mode it is XOR EAX, EBX is perfectly legal. – Mathai Jun 12 '18 at 16:10
-5

Basically, the term "x-bit machine" does not depend on your machine. That is why we do not need to change our processors or other hardware in order to migrate from a 32bit system to a 64bit one (or vice versa).

32bit and 64bit stands for the addressing capability of the OS running on your machine.

However, it still does not mean that a x-bit operating system is capable to address 2^x GB memory. Because the 'B' in "GB" means "byte" and not "bit". 1 byte equals 8 bits.

Actually a 32bit system can not even address 2^32/8 = 2^29 GB memory space while there should some memory be reserved to the OS.

It is something just below 3 GB.

antonio
  • 722
  • 11
  • 22