10

I'm sure we've all heard the terms 64bit and 32bit thrown around, but what do they actually mean?

I'm pretty sure they have to do with the size of a memory address. On a 64bit machine, a reference to an object is 64 bits. But I want to dig a little deeper....

  1. One often hears the phrase "64bit machine." What part of the computer is actually geared toward the number of bits? Processor? Operating System?

  2. What is the advantage of having larger memory addresses?

I could add more questions, but I think brief is better.

Thanks guys :D

Gordon Gustafson
  • 40,133
  • 25
  • 115
  • 157
  • 1
    same as http://stackoverflow.com/questions/132930/32-vs-64-bits-whats-the-big-deal – Jochen Ritzel Aug 15 '09 at 16:13
  • Even though, you've stated about the memory in your question to "dig a little deeper" everyone still answers "it's the memory" anyway... – chakrit Aug 15 '09 at 16:18

7 Answers7

18

64 bit refers to the width of registers, memory addressing space, etc. One benefit is the ability to address more than 4GB of memory.

Wikipedia has an article on 64-bit computing with more details.

Edit: The advantages to more memory are that the operating system and programs have more virtual addressing space--16 exabytes (17.2 billion GB)--and, more importantly, that more physical memory can be added to a system and addressed, causing less swapping of virtual memory to and from disk.

The advantage to wider registers and data buses are that it is easier and faster to move the same amount of data around. An operation that required two or more registers can now be done with one.

So, performance is typically increased when software is recompiled for 64 bits.

A disadvantage is that wider data can mean more space taken by the same data. For instance storing the number 300 requires nine bits. If it's stored in a 32 bit integer, 23 bits are wasted. In 64 bit, that wastage becomes 55 bits. So, without retooling, a simple recompile to 64 bit can yield faster, but slightly more bloated software.

Edit: Also there are 64-bit technology pages here:

Cœur
  • 37,241
  • 25
  • 195
  • 267
b w
  • 4,553
  • 4
  • 31
  • 36
6

The difference is exactly 32 bit ;-)

You need 64 bit hardware (processor) to run a 64 bit OS. You need a 64 bit OS to run 64 bit software. This are the dependencies.

  • In a 32 bit system you are limited to addressing 4 GiByte (2^32) memory, in a 64 bit there is a theoretical limit of 2^64 byte.
  • 64 Bit software needs slightly more memory, mainly for pointers are 8 Bytes instead of 4
  • on x86_64, 64 Bit executables need more memory, as there is an additional opcode for many instructions, and thus may run slower
  • on x86_64, 64 Bit software can use more registers and has the potential to run faster
Gunther Piez
  • 29,760
  • 6
  • 71
  • 103
  • 1
    you mean "...in a 64 bit there is..." in the first bullet point. – Thomas Aug 15 '09 at 17:20
  • Your answer is of course correct, but just a small comment. Intel has Physical Address Extension (PAE) that has additional address lines that allows 36 bit addresses, which through a re-arrangement of page table hierarchies gives you 64 GB of virtual memory space. This is why you can address more than 4 GB of RAM on most 32-bit Intel processors (after Pentium Pro). – alps123 Aug 18 '09 at 22:18
  • When you say "64-bit systems can process data more quickly", I don't get that. From what I understand, if you are in a 32-bit system, the processor will still load memory pages (into cache) with the full width of its data bus. So in essence, it should load 2x more data per operation. And since opcodes and data is smaller, 2x more fit in the same space. Considering that memory I/O is what can slow down an application, wouldn't 32-bit systems be a little faster? – Jeach May 17 '18 at 13:02
  • @Jeach. I did not say that. Did you mean to comment on another answer? – Gunther Piez May 23 '18 at 09:54
  • @hirschhornsalz: Yes, I pasted my comment on two answers... sorry! – Jeach May 24 '18 at 16:48
3
  • 64bit systems can directly address significantly more memory
  • 64bit systems can process data in chunks twice as large as 32bit, which helps some operations go more quickly

For some programs, like office automation suites, 32bit vs 64bit makes little observable difference.

But for other applications, such as databases, graphics/video processing, or hosting virtual machines, being able to reach more physical memory at once and being able to process more information with each instruction can make a huge difference in performance.

Note that today, many 32bit chips have 64bit extension functions, as many FPU (math) or SSMD (vector) operations are done in 64bit mode already.

See 32-bit Vs. 64-bit Systems: What's The Difference? for more.

lavinio
  • 23,931
  • 5
  • 55
  • 71
  • 32-bit machines have hardware which can access well over 4GB of memory; any particular process will be limited to accessing less than 4GB "directly", but the decision not to support more than 4GB in 32-bit windows is as much a marketing decision as a technical one. – supercat Mar 09 '14 at 19:23
  • When you say "64-bit systems can process data more quickly", I don't get that. From what I understand, if you are in a 32-bit system, the processor will still load memory pages (into cache) with the full width of its data bus. So in essence, it should load 2x more data per operation. And since opcodes and data is smaller, 2x more fit in the same space. Considering that memory I/O is what can slow down an application, wouldn't 32-bit systems be a little faster? – Jeach May 17 '18 at 13:02
2
  1. CPU registers and memory addressing.

  2. The system can reference (see) much more memory.

cherouvim
  • 31,725
  • 15
  • 104
  • 153
2

Let's go back to the basics.

99% of computer these days are based on what is referred to as the Von Neumann architecture. Essentially, the computer is in a constant cycle of:

  1. Fetching a command from RAM
  2. Executing the command on the CPU

alt text
(source: wikimedia.org)

When referring to 32/64-bit system (or any other bit size), essentially you are talking about the architecture and implementation of the computer:

  • size of memory space (RAM)
  • size of CPU registers
  • bus size (i.e. between CPU, RAM, I/O, etc...)

If you have a 64-bit system, you have an address space of 2^64. This is why 32-bit system cannot have more than 4GB of RAM. How can you address a memory space which is larger than 2^32?

Regarding the performance differences, there is no clear cut answer (just as there is no clear answer if CISC or RISC architecture is better). It vastly depends on the applications you are using.

To sum: a 64-bit architecture is simply a different way to build a computer. It does not mean it is better, or worse, or does things differently (on a low level, every computer is doing fetch-execute). It's simply a different way of implementing a computer.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Yuval Adam
  • 161,610
  • 92
  • 305
  • 395
2

I think the best answer would be a comparison in x86 bit x64 assembler

When your x32 bit program registers a variable,for example an integer(5),the code is equivalent to this:

push 5

To Understand things better,'push X' is a shortcut to:

sub esp,4 //substracts esp with 4(4*8=32 bits.That's the size of a pointer in x32 executables) in order to make space for our variable
mov [esp],X //moves variable in @esp

Those registeres are 32 bit(4 bytes long),which is the size of a pointer in any 32 bit programming language.

In 64 bit code,however the size is twice bigger and so are registers.Our register ESP exists in x64 executables,but its not widely used as it is in x32 executables.

Instead all of the registeres get a "R" in front of their name(EAX becomes RAX,ESP becomes RSP,EDX becomes RDX and so on).

So our code in x64 executable won't be any different,except the shortcut for 'push X' will be

sub esp,8
mov [rsp],X

RSP has double the size of ESP - 64 bits,8 bytes.

The bottom line is that x64 bit executables use more memory than x32 bit executables.

Ivan Prodanov
  • 34,634
  • 78
  • 176
  • 248
-3

Exactly the 64bit or 32bit references just to the width of the main bus.

Oliver Friedrich
  • 9,018
  • 9
  • 42
  • 48
  • 3
    No. Nonsense. There are numerous cases where this is not true. The 68008 or the 8088, which had a 8 bit bus and where 32 or 16 bit arches, or the good old pentium/II/III, or Athlon/XP which have all a 64 bit main bus while being a 32 bit architecture. – Gunther Piez Aug 15 '09 at 16:35