Does a 64 bit runtime run faster than a 32 bit? - operating-system

Does a 64 bit run-time run faster than a 32 bit? Was our childhood a lie?
Backstory:
A runtime I really like has been updated to 64 bit. As a programmer, the only thing I could think of was that meant that you could create larger numbers and access more memory.
But growing up the newest consoles went from 8 bit, to 16 bit, then 32 bit and you won't guess what's next, 64 bit. So everyone knew 16 bit was better in every way, including speed, than 8 bit.
So when my favorite runtime says it's upgraded to 64 bit does it mean it's faster than the 32 bit? It's upgraded for Mac OS X and will be upgraded to 64 bit for Windows as well.
Also, it looks like Firefox just went 64 bit.

The processor word size (32 or 64) is somewhat independent of the the speed. Generally 64-bit processors are newer than those supporting only 32-bits, so they are inherently faster. However, manipulating more data, larger addresses is inherently slower than manipulating smaller data (shorter addresses).
Let's say that you have a library that does image processing (e.g., read/write JPEG files) in which you need to do 64-bit scaled integers (at 32-bits, you get serious rounding errors in JPEG). The 64-bit processor can add a 64-bit scale integer in one instruction. A 32-bit processor would take 3 or more instructions to do the same (inherently slower).
64 bits means access to more memory (if you use a CAD program you know what that means); not more speed. But, because 64-bit processors tend to be newer and faster, you generally get more speed; but not because of 64-bits.

Here is an answer from a low level developer, x64 can be very optimized because it has 8 additional 128 bit Multimedia XMM Registers, All 32 Bit registers are extended to 64 Bit, and an additional 8 General Purpose registers R8-R15. This all can be used to minimize memory access, computations, and copying large buffers which are the main slowdown for a CPU, programs in x64 already know there is SSE & SSE2 So they can benefit from these extensions without checking for them or creating double the functions. (there is also 256Bit AVX/512Bit AVX512).
The main thing about why they are called 64 bit is because these processors provide a 64 Bit Flat Address space when you can use 48 Bit Paging (256 TB) or (if supported) 57 Bit Paging (2^57 Bytes).

Related

64 bit Vs 32 bit Executables

Almost all the executables in market comes in 32 bit and 64 bit versions.
It's a known fact that 32 bit executables would be compatible with 64 bit OS. But not the vice versa.
If this the case, then why do developers have to come with two different executables [32 bit and 64 bit versions] and why not distribute the 32 bit executable alone as the solution [saving the development time of another 64 bit executable].
Also like to know if the 64 bit executable does exist for the support of any performance basis.
Dave is exactly right. 64bit allows you to address more memory than 32 bit versions. The same transition happened when moving from 16bit to 32 bit back in the 90's too. Here's a good blog post which explains more than you ever wanted to know...
http://www.techsupportalert.com/content/32-bit-and-64-bit-explained.htm

how does a wider data bus helps a CPU when internal register size is smaller?

What advantage did we have in using a wider external data bus, say 64 bit in first Pentium produced in 1993, when the size of the internal data bus or registers was 32 bit only?
General purpose registers may be only be 32 bits, but there are wider registers, e.g. floating point, MMX, SSE, which may be 64 bits or more.
Note also that whole cache lines are read/written from/to memory.
From Chapter 23 of 'The x86 PC Assembly language, Design and Interface' by Muhammad Ali Mazidi:
In the pentium, the external data buses are 64 bit, which will bring twice as much code and data into the CPU as the 486. However, just like the 386 and 486, Pentium registers are 32 bit. Bringing in twice as much as information can work only if there are two execution units inside the processor, and this is exactly what Intel has done.

Size of microprocessor

I have read that the microprocessor consists of several components, each having same/different "sizes". But what really confuses me is what determines the stated size of a microprocessor as 16-bit, 32-bit or 64-bit...
Is it:
the the ALU's capacity?
the size of the data bus?
the size of the address bus?
the "least common denominator" of the above?
or some other factor that I hitherto don't know about?
Generally the bit-size of a processor is the size of its general purpose registers. this often corresponds to the size of the memory bus and possibly the address bus, but doesn't necessarily.
For example, Intel sold a version of the 386 chip called the 386SX (http://en.wikipedia.org/wiki/Intel_80386#The_i386SX_variant) that internally was a 386 with 32-bit registers, but only has a 16 bit data bus. I think that most people would consider the chip to still be a 32-bit processor instead of a 16 bit processor.
I think I'll have a go. Traditionally I think that "size" meant the width (number of bits) in the register set. On "my" first computer the DEC PDP-8/E the single register available - the accumulator - was 12 bits wide and it was a 12-bit computer, on the PDP-11 the registers were 16 bits wide and it was a 16-bit computer. IBM 370 and VAX had 32-bit registers and were 32-bit computers.
Starting with the 80386 things became difficult. Depending on operating mode it could present itself to be a real mode 8086, a protected mode (PM) 80286 or a PM 80386. With the 64-bit processors using AMD64 or x86-64 you have all of the above and also 64-bit PM. So what are they? It should depend on the basic operating mode of the OS that's running on it. Windows NT 2000, Windows XP-32, Vista-32 7-32 make the processor 32-bit. OS with "64" in them make the processor 64 bit.
As to buses and stuff. There are two physical buses on x86-processors address+data and two logical buses memory+i/o. Special pins on the processor determine if the operation is memory or i/o, read or write and so on. On the 8086/8088 the data and address buses shared the same pins A0-A15 with D0-D15/A0-A7 with D0-D7 with bits A16-A19/A8-A19 being strictly address. On the 80286 they were separate, not sure about the 80186/80188. On the 80286 there were 24 address and 16 data lines. On the 80386 and 80486 there were 32 each for address and data. The 80386SX had the same external configuration as the 80286.
After this buses get complicated. The processors run so fast internally that they are more or less constantly waiting for their caches which in turn are more or less constantly waiting on external RAM. To satisfy the caches' insatiable hunger for data external memory began delivering it in 64 bit wide chunks starting with the Pentium and Pentium MMX that are both 32 bit processors with 32 address lines but with 64 data lines.
With later processors the number of address lines were increased to 36 allowing a total addressable external memory of 64 GB. The processors remained 32-bit internally.
On multi-core processors the hunger for data is even more pronounced so they may have several sets of address and data buses to faciltiate data being crammed into the processor. Desktop processors may have two or three and server processors three to four. I'm not sure but I believe some have switched to 128 bit wide data buses.
For modern 64-bit processors it is not feasible to also have 64 address lines since that would allow memory up to 16 billion Gigabytes which is not possible today. Some motherboards allow 128 GB which means that the processor needs at least 37 address lines.
As you can see address and data buses are no longer really usable to determine processor size. They actually haven't for the last 25 (80386 modes) years.
In C the int type is supposed to be equivalent to the register width. On AMD64 it isn't because there just isn't that great a need for 64 bit ints: 32 bit ints do just nicely in most cases. The width of a pointer in C on AMD64 is 64 bits though.
Generally this refers to the amount of the memory (2^n) bytes that is addressable by the CPU. Usually it's the same as data bus, but the hardware may do multiple accesss to retrieve that amount so is not 100% guaranteed. Sometimes it also corresponds to CPU register size, however it too can be different.

what is difference between 32 bit vs 64 bit OSs and processors (Intel architecture and WIndows)

The only difference I know is that size of the registers for 64-bit and 32-bit processors are 64 and 32 bits, respectively. Also the addresses are 64 bits in 64 bit processors. Are there any other differences between these two?
x86_64 has more registers than x86, so more work can be done on the CPU rather than constantly fetching bits from RAM. Also, x86_64 guarantees that the CPU supports at least SSE2, so the compiler knows it can optimize for that.
Those are the key differences, but those differences have many effects - for instance, since addresses are larger, the amount of memory you can effectively access is greater - 32-bit OSes are traditionally limited to around 4GB of memory.
In 32-bit machine the maximum size of RAM will be 4GB
2^32=4294967296 bits which equals to 4GB
but in case of 64-bit machine this will be-
2^64=18446744073709551616 bits which equals to 17179869184 GB
Physical Address Extension (PAE) is a feature to allow x86 processors to access a physical address space larger than 4 GB. This can go up to 64 GB. To use PAE, the OS must support this feature. All major OSes allow the use of PAE, including Windows.
Hence, memory access can't really be held as grounds for distinction between 32-bit & 64-bit OSes.
On the other hand, almost all the processors coming now into the market are 64-bit capable, so it really depends on your OS, how much memory access it allows.
The main difference between 32-bit processors and 64-bit processors is
the speed they operate. 64-bit processors can come in dual core, quad
core, and six core versions for home computing (with eight core
versions coming soon).
Multiple cores allow for increase processing
power and faster computer operation. Software programs that require
many calculations to function operate faster on the multi-core 64-bit
processors, for the most part.
It is important to note that 64-bit
computers can still use 32-bit based software programs, even when the
Windows operating system is a 64-bit version.
Another big difference
between 32-bit processors and 64-bit processors is the maximum amount
of memory (RAM) that is supported. 32-bit computers support a maximum
of 3-4GB of memory, whereas a 64-bit computer can support memory
amounts over 4 GB. This is important for software programs that are
used for graphical design, engineering design or video editing, where
many calculations are performed to render images, drawings, and video
footage. One thing to note is that 3D graphic programs and games do
not benefit much, if at all, from switching to a 64-bit computer,
unless the program is a 64-bit program.
A 32-bit processor is adequate
for any program written for a 32-bit processor. In the case of
computer games, you'll get a lot more performance by upgrading the
video card instead of getting a 64-bit processor.
In the end, 64-bit
processors are becoming more and more commonplace in home computers.
Most manufacturers build computers with 64-bit processors due to
cheaper prices and because more users are now using 64-bit operating
systems and programs. Computer parts retailers are offering fewer and
fewer 32-bit processors and soon may not offer any at all.
Extract from : Here.

What is the exact meaning of 'N' bit processor ? , clarification for freescale arch

While reading one Freescale processor manual I stuck somewhere, which specifies that it is a 32-bit processor.
May I know the exact meaning and logic behind that?
Update:
Does it specify its ALU width or its address width or its register width specifically or all of them together is N-bit each.
Update:
Hope you have heard of Freescale processors. I just came across their site which describes one of their latest Starcore-based processor known as SC3850 as a 16-bit processor. As far as I know, it has 32 bit program counters, including ALU, and 40-bit register width and 2x64 bit address bus width. Also the SC3850 can handle SIMD(2) instructions which are of 32 bit or 64 bit.
For more details please go through this link
One of the major reasons you would care about the register width of the processor is performance. Generally doubling the number of bits doubles the rate at which a processor can move data around, and compute. This is why we're not all using 8 bit processors.
The other major reason is address space. A 16 bit program counter limits you to 64k of address space, and a 32 bit counter limits you to 4 gigabytes. The new 64 bit processors make it possible, if all the address lines are present, to support 17,179,869,184 gigabytes of memory.
Firstly i dont have a definitive answer but i would guess that 8 being a power of 2, is an important factor. Being a power of 2 also means that certain optimisations may be performed by dividing the 8 bits into groups which also means lookup tables can be used for certain operations. 8 bits in the past was also the perfect size when dealing wiht plain old ascii characters. I can imagine that using 5 bit bytes and encoding a string of ascii characters across memory would be a pain.
Please check out the Wikipedia entry on 32-bit processors, from the entry:
In computer architecture, 32-bit
integers, memory addresses, or other
data units are those that are at most
32 bits (4 octets) wide. Also, 32-bit
CPU and ALU architectures are those
that are based on registers, address
buses, or data buses of that size.
32-bit is also a term given to a
generation of computers in which
32-bit processors were the norm.
Read and understand the article - then the answer for N will be obvious.