32 位和 64 位处理器有什么区别?
我一直在尝试阅读有关 32 位和 64 位处理器的信息(http://en. wikipedia.org/wiki/32-bit_processing)。我的理解是,32 位处理器(如 x86)的寄存器是 32 位宽。我不确定这是什么意思。那么它有特殊的“内存空间”,可以存储最多2^32的整数值?
我不想听起来很愚蠢,但我对处理器一无所知。我假设 64 位通常比 32 位更好。虽然我的电脑现在(一年了,Win 7,Intel Atom)有32位处理器。
I have been trying to read up on 32-bit and 64-bit processors (http://en.wikipedia.org/wiki/32-bit_processing). My understanding is that a 32-bit processor (like x86) has registers 32-bits wide. I'm not sure what that means. So it has special "memory spaces" that can store integer values up to 2^32?
I don't want to sound stupid, but I have no idea about processors. I'm assuming 64-bits is, in general, better than 32-bits. Although my computer now (one year old, Win 7, Intel Atom) has a 32-bit processor.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
所有计算都在寄存器中进行。当您在代码中添加(或减去,或其他)变量时,它们会从内存加载到寄存器中(如果它们尚不存在,但是虽然您可以声明无限数量的变量,但寄存器的数量是有限的)。因此,拥有更大的寄存器可以让您同时执行“更大”的计算。对于常规程序来说,这种大小差异在实践中并不是那么重要(因为至少我很少操作大于 2^32 的值),但这就是它的工作原理。
此外,某些寄存器用作内存空间的指针,因此限制了您可以引用的最大内存量。 32 位处理器只能引用 2^32 字节(大约为 4 GB 的数据)。 64 位处理器可以更明显地管理很多事情。
还有其他后果,但我想到的是这两个。
All calculations take place in the registers. When you're adding (or subtracting, or whatever) variables together in your code, they get loaded from memory into the registers (if they're not already there, but while you can declare an infinite number of variables, the number of registers is limited). So, having larger registers allows you to perform "larger" calculations in the same time. Not that this size-difference matters so much in practice when it comes to regular programs (since at least I rarely manipulate values larger than 2^32), but that is how it works.
Also, certain registers are used as pointers into your memory space and hence limits the maximum amount of memory that you can reference. A 32-bit processor can only reference 2^32 bytes (which is about 4 GB of data). A 64-bit processor can manage a whole lot more obviously.
There are other consequences as well, but these are the two that comes to mind.
首先 32 位和 64 位称为体系结构。
这些架构意味着微处理器将在一个指令周期内处理多少数据,即获取-解码-执行。
根据处理器设计,一秒钟内可能有数千到数十亿个指令周期。
32位意味着微处理器可以在一个指令周期内执行4字节数据,而64位意味着微处理器可以在一个指令周期内执行8字节数据。
由于微处理器需要与计算机的其他部分通信以获取和发送数据,即内存、数据总线和视频控制器等,因此理论上它们也必须支持64位数据传输。然而,出于兼容性和成本等实际原因,其他部分可能仍以 32 位与微处理器通信。这种情况发生在最初的 IBM PC 中,其微处理器 8088 能够执行 16 位执行,但出于成本和与现有部件的兼容性的原因,它以 8 位与计算机的其他部分通信。
想象一下,在32位计算机上,您需要将“a”写为“A”,即大写字母,因此该操作只需要2个字节,而计算机将读取4个字节的数据,从而产生开销。在 64 位计算机中,此开销增加到 6 个字节。因此,64 位计算机不一定总是很快。
请记住,只有支持 64 位执行的微处理器才可以在 64 位 Windows 上运行。
First 32-bit and 64-bit are called architectures.
These architectures means that how much data a microprocessor will process within one instruction cycle i.e. fetch-decode-execute
In one second there might be thousands to billions of instruction cycles depending upon a processor design.
32-bit means that a microprocessor can execute 4 bytes of data in one instruction cycle while 64-bit means that a microprocessor can execute 8 bytes of data in one instruction cycle.
Since microprocessor needs to talk to other parts of computer to get and send data i.e. memory, data bus and video controller etc. so they must also support 64-bit data transfer theoretically. However, for practical reasons such as compatibility and cost, the other parts might still talk to microprocessor in 32 bits. This happened in original IBM PC where its microprocessor 8088 was capable of 16-bit execution while it talked to other parts of computer in 8 bits for the reason of cost and compatibility with existing parts.
Imagine that on a 32 bit computer you need to write 'a' as 'A' i.e. in CAPSLOCK, so the operation only requires 2 bytes while computer will read 4 bytes of data resulting in overhead. This overhead increases in 64 bit computer to 6 bytes. So, 64 bit computers not necessarily be fast all the times.
Remember 64 bit windows could be run on a microprocessor only if it supports 64-bit execution.
处理器通过将其地址提供给MAR(内存地址寄存器)来调用内存(即RAM)中的数据。然后选择器电子器件在存储体中找到该地址并检索数据并将其放入 MDR(存储数据寄存器)中。该数据被记录在处理器中的寄存器之一中以供进一步处理。这就是为什么数据总线的大小决定了处理器中寄存器的大小。现在,如果我的处理器有 32 位寄存器,它一次只能调用 4 字节大小的数据。如果数据大小超过 32 位,则需要两个周期的读取才能将数据放入其中。与 64 位机器相比,这会降低 32 位机器的速度,而 64 位机器只能在一个取指周期内完成操作。因此,显然对于较小的数据,如果我的处理器的时钟速度相同,则没有什么区别。
同样,对于 64 位处理器和 64 位操作系统,我的指令将始终为 64 位大小......这不必要地占用更多内存空间。
Processor calls data from Memory i.e. RAM by giving its address to MAR (Memory Address Register). Selector electronics then finds that address in the memory bank and retrieves the data and puts it in MDR (Memory Data Register) This data is recorded in one of the Registers in the Processor for further processing. Thats why size of Data Bus determines the size of Registers in Processor. Now, if my processor has 32 bit register, it can call data of 4 bytes size only, at a time. And if the data size exceeds 32 bits, then it would required two cycles of fetching to have the data in it. This slows down the speed of 32 bit Machine compared to 64 bit, which would complete the operation in ONE fetch cycle only. So, obviosly for the smaller data, it makes no difference if my processors are clocked at the same speed.
Again, with 64 bit processor and 64 bit OS, my instructions will be of 64 bit size always... which unnecessarily uses up more memory space.
这个答案可能晚了9年,但我觉得上面的答案并没有充分回答这个问题。
任何标准机构都没有明确定义或规范 32 位和 64 位的定义。它们只是直观的概念。 32位或64位CPU一般是指CPU指令集架构(ISA)的本机字大小。那么什么是 ISA,什么是字长?
ISA 和字长
ISA 是CPU 使用的机器指令/汇编助记符。它们是软件的最低级别,直接告诉硬件要做什么。示例:
字大小的旧定义是 CPU 在一个指令周期内可以计算的位数。在现代上下文中,字大小是寄存器的默认大小或基本指令所作用的寄存器的大小(我知道我在这个定义中保留了很多含糊之处,但这是跨多个架构的直观概念,并不完全匹配与彼此)。示例:
具有 PAE 的 Pentium Pro CPU 的位数示例
首先,通用指令中的各种字大小:
二、硬件架构中的总线和内存访问大小:
所以从以上所有大小来看,大多数人直观地称其为32位CPU(尽管对于ALU字大小和地址位大小没有明确的共识) 。
这里值得注意的一点是,在过去(70 年代和 80 年代),有些 CPU 架构的 ALU 字大小与其内存访问大小非常不同。另请注意,我们甚至还没有处理非通用指令中的怪癖。
关于 Intel x86_64 的说明
与普遍看法相反,x86_64 并不是真正意义上的 64 位架构。它是一个 32 位架构,支持可以执行 64 位操作的扩展指令。它还支持 64 位逻辑地址大小。 Intel 自己将此 ISA 称为 IA32e(IA32 扩展,IA32 是他们的 32 位 ISA)。
参考资料
ARM 指令示例
英特尔寻址模式
This answer is probably 9 years too late, but I feel that the above answers don't adequately answer the question.
The definition of 32-bit and 64-bit are not well defined or regulated by any standards body. They are merely intuitive concepts. The 32-bit or 64-bit CPU generally refers to the native word size of the CPU's instruction set architecture (ISA). So what is an ISA and what is a word size?
ISA and word size
ISA is the machine instructions / assembly mnemonics used by the CPU. They are the lowest level of a software which directly tell what the hardware to do. Example:
The old definition of word size would be the number of bits the CPU can compute in one instruction cycle. In modern context the word size is the default size of the registers or size of the registers the basic instruction acts upon (I know I kept a lot of ambiguity in this definition, but it's an intuitive concept across multiple architectures which don't completely match with each other). Example:
Example bit-ness of a Pentium Pro CPU with PAE
First, various word sizes in general purpose instrucion:
Second, bus and memory access sizes in hardware architecture:
So from all the above sizes, most people intuitively called this a 32-bit CPU (despite no clear consensus on ALU word size and address bit size).
Interesting point to note here is that in olden days (70s and 80s) there were CPU architectures whose ALU word size was very different from it's memory access size. Also note that we haven't even dealt with the quirks in non-general purpose instructions.
Note on Intel x86_64
Contrary to popular belief, x86_64 is not a 64-bit architecture in the truest sense of the word. It is a 32 bit architecture which supports extension instructions which can do 64 bit operations. It also supports a 64-bit logical address size. Intel themselves call this ISA IA32e (IA32 extended, with IA32 being their 32-bit ISA).
References
ARM instruction examples
Intel addressing modes
32 位处理器可以使用 32 位地址对存储体进行寻址。因此,您可以拥有 2^32 个存储单元,因此可寻址内存量有限(~ 4GB)。即使您向机器添加另一个内存条,也无法对其进行寻址。因此,64 位机器最多可以寻址 2^64 个存储单元。
32bit processors can address a memory bank with 32 bit address with. So you can have 2^32 memory cells and therefore a limited amount of addressable memory (~ 4GB). Even when you add another memory bank to your machine it can not be addressed. 64bit machines therefore can address up to 2^64 memory cells.
来自此处 :
From here:
32位和64位基本上都是寄存器大小,寄存器是最快的内存类型并且最接近CPU。与 32 位寄存器相比,64 位处理器可以存储更多用于寻址和传输的数据,但基于处理器速度的测量还存在其他因素,例如核心数量、高速缓存、架构等。
参考: 32位处理器和64位处理器的区别
32-bit and 64-bit are basically the registers size, register the fastest type of memory and is closest to the CPU. A 64-bit processor can store more data for addressing and transmission than a 32-bit register but there are other factors also on the basis of the speed of the processor is measured such as the number of cores, cache memory, architecture etc.
Reference: Difference between 32-bit processor and 64-bit processor
一个字节有 8 位,因此如果它是 32 位,那么您将以每秒 cpu 时钟频率处理 4 个字节的数据。因此,如果 64 位 cpu 和 32 位 cpu 的时钟速度相同,则 64 位 cpu 会更快
there are 8 bits in a byte so if its 32 bit you are processing 4 bytes of data at whatever ghz or mhz your cpu is clocked at per second. so if there is a 64 bit cpu and 32 bit cpu clocked at the same speed the 64 bit cpu would be faster
32 位处理器每秒处理 32 位数据(基于处理器的 Ghz),64 位处理器每秒处理 64 位数据(基于 PC 的速度)。 34 位处理器也可与 4GB RAM 配合使用。
32 bit processors are processing 32 bits of data based on Ghz of Processor in per second and 64 bit processors are processing 64bit of data per second on what speed your PC has. as well the 34 bit processors works with 4GB of RAM .