32 位 vs 64 位...或者,“处理信息”到底是什么?意思是
我无法理解 32 位处理器和 64 位处理器之间的区别。我知道 32 位处理器一次可以访问 32 位,而 64 位处理器一次可以访问 64 位。但一次访问一定数量的位到底意味着什么?
I am having trouble understanding the difference between a 32 bit processor and 64 bit processor. I know that a 32 bit processor can access 32 bits at a time while a 64 bit processor can access 64 bits at a time. But what exactly does it mean to access a certain number of bits at one time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我想真正的答案是它很复杂。除了专门的学习之外,隐喻是唯一能给你一个基本想法的东西。沃利克走在正确的道路上。
有一些因素驱动处理器。一是它每秒可以执行多少次操作(以赫兹为单位)。虽然架构无法给出简单的答案,但 1Ghz 单核处理器每秒执行 1,000,000,000 次操作。大致。虽然可以获得更具体的答案,但它并不能澄清这种情况。
处理器还包括其他东西,例如内存控制器(在 i7 中)、ALU 和 FPU 以及其他专用电路,这使得这个问题变得很难回答。
不过,出于您的意图和目的,每个处理器都有寄存器。寄存器就像处理器的暂存空间(比内存更快),可以在处理器工作时存储少量数据。这些由 L1 和 L2(有时是 L3)缓存支持,速度也快得离谱。基本上,64 位指的是暂存空间的大小(通过代理,将寄存器连接到缓存的管道,因为数据会同时加载和加载)。
更大的暂存空间意味着可以完成更多工作,而无需从缓存或内存中读取新信息。然而,仅仅因为它可以做到并不意味着它总是会做到。程序通常必须使用 64 位支持进行编译才能利用加速优势,即使这样,您通常也不会看到差异,除非您操作的数据大于 32 位可以存储的数据。但这对于系统程序员来说更是一个问题。
处理器还需要密切关注内存中的内容(例如,正在使用的内容和未使用的内容)。它使用特殊的寄存器来完成此操作。 32 位处理器通常无法寻址超过 4GB 的 RAM 的原因与该寄存器的大小有关。虽然 PAE 等处理器扩展允许 32 位处理器上的 32 位操作系统寻址多达 64 GB 的 RAM,但大多数操作系统通常不支持它。
总而言之,64 位处理器可以通过正确的编程一次性对更大的数据块执行操作,并寻址更多的内存。除此之外,没有太大区别。
编辑:为了避免人们产生错误的想法,我所说的“运算”并不是专门指运算(加法、乘法等)。不好的是,我专注于回答问题,而不是全面介绍微处理器架构。
I guess the real answer is it's complicated. Metaphor is the only thing besides dedicated study that'll give you a basic idea. Wallyk is on the right track.
A few things drive a processor. One is how many operations it can do per second (measured in Hertz). While architecture prevents a simple answer, a 1Ghz single-core processor performs 1,000,000,000 operations per second. Roughly. While it's possible to get a more concrete answer, it wouldn't clarify this case.
A processor is also other stuff, like a memory controller (in i7), ALU and FPU, and other specialized circuitry, which is what makes even that a hard question to answer.
For your intents and purposes though, every processor has registers. Registers are like scratch space (faster than memory) for a processor to store small amounts of data while it works on it. These are backed up by L1 and L2 (sometimes L3) caches, that are also ridiculously fast. Basically, 64-bit refers to the size of the scratch space (and by proxy, the pipe that connects the register to the cache, as data is loaded in and out all at once).
Bigger scratch space means more can be done without reading in new information from cache or memory. However, just because it can be done doesn't mean it always will. A program generally has to be compiled with 64-bit support to take advantage of the speed-up, and even then you usually won't see a difference unless you're manipulating data larger than 32 bits can store. That's more a question for a systems programmer though.
A processor also needs to keep tabs on what's in memory (as in, what's in use and what's not.) It does this using a special register. The reason why a 32-bit processor can't normally address more than 4GB of RAM has to do with the size of this register. While processor extensions such as PAE allow 32-bit operating systems on 32-bit processors to address as much as 64 Gigabytes of RAM, most OS's don't generally support it.
TL;DR, 64-bit processors give the possibility with correct programming to perform operations on larger chunks of data at once, and address more memory. Other then that, there's not a huge difference.
EDIT: Lest people get the wrong idea, by "operations" I'm not specifically referring to THE operations (addition, multiplication, etc.). My bad, I was focusing on answering the question rather than giving a full introduction to microprocessor architecture.
基本上,这意味着能够对这种大小的数字进行操作(例如将它们相加)。不过 32 位和 64 位架构之间的差异还不止于此。
Basically it means being able to do operations on numbers of such size (adding them for example). Though there is more differences between 32bit and 64bit architectures than this.
我注意到你标记了内存,所以我将采用这个答案:
在 32 位处理器中,处理器只能使用 32 位来寻址内存。这意味着有 2^32 个唯一组合,因此,处理器只能寻址 2^32 字节。 (4Gb)
在 64 位处理器中,处理器可以(理论上)使用 64 位来寻址内存,或者 2^64 字节的可寻址内存。我相信这相当于 16 Exo 字节,这是一个巨大的数字,几乎可以计算机器中的分子数量。但实际上,由于当前的硬件限制,目前生产线上的大多数 CPU 只允许您寻址 42 位物理内存和 48 位虚拟内存。
I notice you tagged memory, so I'm going with that answer:
In a 32bit processor, the processor can only use 32 bits to address memory. This means there is 2^32 unique combinations, therefore, the processor can only address 2^32 bytes. (4Gb)
In a 64bit processor, the processor can (in theory) use 64 bits to address memory, or 2^64 bytes of addressable memory. I believe that amounts to 16 Exo Bytes, which is a huge amount that is almost to the point of counting the amount of molecules in your machine. In practice though, most CPUs on the line today only let you address 42 bits of physical memory and 48 bits of virtual memory due to current day hardware constraints.
这不是一个非常精确的表达,但我认为它是指内存地址的长度。例如,32 位意味着程序可用 4 GiB(232 字节)。
想玩一玩,请查看 31 位的 IBM s390 架构。)
(如果 ,它并不总是 CPU 一次可以读取或操作的最大数据量。例如,64 位 AMD/Intel 处理器具有一系列片上缓存,可以从主内存中提取大块数据。它们还有 128 位 SSE 寄存器。
It's not a very precise expression, but I take it to mean the length of memory addresses. For example, 32 bit means 4 GiB (232 bytes) is available to programs.
(For a lark, check out the IBM s390 architecture which is 31 bit.)
Also, it's not always the maximum amount of data that the CPU can read or operate on at a time. For example, the 64-bit AMD/Intel processors have a series of on-chip caches that can pull data from main memory in large chunks. They also have 128-bit SSE registers.
64 位维基百科条目对该主题进行了一些很好的阐述
The Wikipedia entry for 64-bit shines some nice light on the topic
这是处理能力的衡量标准。就像一辆可以搭载 4 名乘客或 12 名乘客的车辆,其能量大致相同。
例如,32 位可容纳 4 个字节,即 4 个普通字符,而 64 位则可容纳 8 个字节(对于浪漫语言而言)即 8 个字符。这些可以同时针对相应的架构数据宽度进行多种操作。
另一种看待它的方式是架构可以直接使用多大的整数。对于每个宽度,相应的范围是
8 位:0 到 255 / -128 到 127
16 位:0 至 65,535 / -32768 至 32767
32 位:0 至 4,294,967,295 / -2,147,483,648 至 2,147,483,647
64 位:0 至 18,446,744,073,709,551,615 / -9,223,372,036,854,775,808 至 9,223,372,036,854,775,807
It's a measure of processing power. Rather like a vehicle which can carry 4 passengers, or 12, for approximately the same amount of energy.
For example, 32 bits holds 4 bytes, or 4 ordinary characters, and 64 bits is 8 bytes and—for romance languages—eight characters. Those can be manipulated at once for many kinds of operations for the corresponding architectural data width.
Yet another way of looking at it is how big an integer can an architecture directly work with. For each of these widths, the corresponding range is
8 bits: 0 to 255 / -128 to 127
16 bits: 0 to 65,535 / -32768 to 32767
32 bits: 0 to 4,294,967,295 / -2,147,483,648 to 2,147,483,647
64 bits: 0 to 18,446,744,073,709,551,615 / -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807