Click to See Complete Forum and Search --> : Advantages of 64-bit vs 32-bit?
evac-q8r
04-28-2003, 11:26 PM
So anyways, what are the advantages of having a 64-bit machine vs. a 32-bit machine other than the fact that I can store larger integers into my int variables when programming some code. Probably a thoughtless question. :confused:
EVAC
nextbillgates
04-28-2003, 11:38 PM
A 64-bit processor can directly address more than 4GB of RAM.
pythagras
04-28-2003, 11:50 PM
I assume the 64 bits refer to the working registers of the cpu?
If so, then you can do lots of stuff, like address more RAM. You can have a register (a place where bits are held) that says "I want this address out of RAM(or other addressable spaces)" or something. You could also add two 64 bit numbers in one step instead of having to load two 32 bit numbers, worry about carrys, etc. This probably decreases the time to do floating point operations, since you can deal with more of the floating point number at the same time. I'm sure there's more, assuming my above premise is correct.
bwkaz
04-29-2003, 10:00 AM
Originally posted by nextbillgates
A 64-bit processor can directly address more than 4GB of RAM. The Pentium Pro and above (P2, P3, P4, K6 maybe, Athlon, Duron, etc.) can address up to 64GB of RAM. They have a 36-bit address bus, along with a flag that enables a different paging mechanism that allows larger physical addresses.
The Opteron/Athlon 64 chips have a 40-bit address bus, if I'm not mistaken (and if I am, someone correct me, please ;)). So they can address 2^40 bytes of memory, which is right around a terabyte.
The biggest advantage is the larger register size (and in the Athlon's case, the extra 8 general-purpose registers that get enabled in 64-bit mode, plus the extra 8 SSE/SSE2 registers that also get enabled). The more data you can fit inside the CPU, the faster you can access that data -- memory is thousands of times faster than disk, but registers are at least hundreds of times faster than memory. Caches help a bit, but not always enough. If you can fit the entire working set of a program into the (new larger) registers, your program runs LOTS faster.
evac-q8r
04-29-2003, 11:24 AM
OK, I don't know much about the processors, but I didn't know that memory exists inside the registers. What is ironic if I understand your explanation is that the register can hold data and it can hold 40GB of Memory. That is larger than the RAM, much larger. It doesn't make any sense to have RAM then? I'll do some more reading on it.
EVAC
you're a little off ... typically, when refering a processor as some number of bits a person is referring to the number of bits each CPU register can hold *and* the number of bits on the CPU address lines.
Say for instance you have CPU with 32 bit address lines ... this means the CPU can read/write memory locations from address 0 to address 2^32 - 1 (or 2^32 total addresses). Essentially, on such a machine you could have up to 2^32 bytes of RAM (or 4GB) addressable by the CPU. So, 4GB is the maximum amount of RAM that could be put into such a system. That doesn't mean you actually have 4GB of memory it just means that the CPU can communicate with at most 4GB of memory.
You misinterpreted what everyone has said ... a CPU doesn't have 40GB worth of registers. Typically, a CPU will only have a handful of registers, like around 20, many of which are reserved strictly for the operating system kernel.
Registers serve as a high speed work area for programs ... when doing operations on data, variables are moved into registers and written back into memory when a new calculation must be performed. Faster memory (ie registers and caches) are very expensive per byte so most conventional CPUs have far less of it than RAM aka main memory.
I don't know if this helps but heres a little diagram of memory in computers. The top is the most costly per byte but fastest and the bottom is least costly per byte and slowest.
CPU registers (Size: bytes)
Cache Memory (Size: kilobytes)
Main Memory (Size: megabytes)
Persistent Storage (ie disks) (Size: gigabytes/terabytes)
evac-q8r
04-29-2003, 12:11 PM
OK thats a good explanation. It is starting to make some more sense now. I probably misinterpreting again, so the CPU registers are what makes it possible to address and thus immediately find the location of the data which exists on the RAM. The amount of RAM available/accessible is dependent on the a 32-bit or 64-bit architecture.
Say for instance we are writing a C program and we have a bunch of pointers or addresses. Is it safe for me to say that these addresses are stored within the CPU registers or is this an entirely different concept in itself.
Thanks for the assistance guys.
EVAC
Morphine Drip
04-29-2003, 12:27 PM
MOST of your addresses/pointers are stored in main memory. when the cpu registers needs them it will pull them in and discard/save the ones it already has.
There are only so many registers and, given that, there are only a few that are used for holding 'addresses'
arkaine23
04-29-2003, 12:47 PM
More addressable ram is the big thing, if you can find the motherboards that have the slots for it. Larger registers also speed things up. On the new AMD 64 bit CPU's, you also have the memory controller integrated into the CPU which decreases latency a lot (that's why the Hammers do better at games even if they're at 1.4Ghz and comparing to a 3.06Ghz P4). The new Hammers also have the Athlon architechture's strong FPU, which gives them an even bigger edge over any other 64 bit CPU, like the Itanium or UltraSparc. They have a 12 stage pipeline which should allow them to scale better than they're weaker 32 bit cousins once AMD learns to perfect the fabrication process and use of SOI.
bwkaz
04-29-2003, 02:41 PM
Originally posted by evac-q8r
OK, I don't know much about the processors, but I didn't know that memory exists inside the registers. What is ironic if I understand your explanation is that the register can hold data and it can hold 40GB of Memory. That is larger than the RAM, much larger. It doesn't make any sense to have RAM then? I'll do some more reading on it. Well, the registers are memory. Just a very small bit of it (on the IA32, there are 8 registers of 32 bits each, for 256 bits of memory total, while on the Athlon 64/Opteron, there are 16 registers of 64 bits each, for a total of 1024 bits of memory).
The possible values that each of these registers can take is dependent on its size, too -- a 32-bit register can take any value between 0 and about 4 billion (the exact upper max is 2^32 - 1), while a 64-bit register can take on any value between 0 and 2^64-1 (about 16 pentillion or so, I think).
The memory bus width is 40 bits. This means that the set of bus lines can take on any value between 0 and 2^40-1 (1 terabyte). The value of all bus lines is what's used to compute the address in RAM (or wherever; some pieces of the address space are mapped to PCI devices, for example, and some is the AGP device), so processors with a 40-bit bus can address a terabyte of physical "memory".
Processors can only hold, at one time, the amount of data that fits in their registers. Very few architectures can do math on memory locations, as well (IA32 is the biggest exception to that rule), so that has to be taken into account. On most architectures, incrementing a memory location is a 3-step process: load into a register, increment the register, and store back to memory.
The working set of a program will almost never completely fit into the registers of any machine, BTW... but if it did, the program would run extremely fast. ;)
The amount of RAM available depends on the address bus width of the processor, though, not the 32-bit or 64-bit "ness" of it.
As for the C pointers, they will almost assuredly be stored in memory, but whichever one you're dereferencing at the time will most likely be in a register also (yes, there will be 2 copies of the address).
I don't know if this helped much, though... clear as mud? ;)
Parcival
04-29-2003, 05:37 PM
If you're really interested in those registers I suggest to get started on Assembler. I think Assembler is a pain in the butt, but it teaches you well on how to address the registers and what kind of data can be loaded into them. :)
As you seem to know C you may also like to hear that you can even write Assembler code directly into your C code, you just have to tag your Assmbler coding with the "asm" command so your compiler understands it.
evac-q8r
04-29-2003, 05:49 PM
Yeah, I hear where you are coming from. As a matter of fact I just recently downloaded a paper which demonstrates exactly what you are talking about. Probably won't get around to reading it any time soon. That would be pretty cool to program at that level. There is just too much stuff out there...peace. Thats a really slick image you have there. It looks like you're some computer hero coming to save the day. :p
EVAC
Parcival
04-30-2003, 02:34 AM
Thanks for the compliment. :) As a matter of fact, the picture shows a medic from Starcraft Broodwars, my all-time fav game.
However, I don't really feel like a computer hero. I may be able to write assembler, but as a Linux newby I messing with such simple new problems like installing manually downloaded rpms. :) I guess you can't call yourself a computer hero until you mastered Linux. :)