32位机器可以访问多少内存?

发布于 2024-12-27 11:21:18 字数 260 浏览 0 评论 0原文

32位或64位机器是什么意思?

这是处理器架构……32 位机器可以与 64 位机器相同的方式同时读取和写入 32 位数据……。

32位机器可以访问的最大内存是多少?

它是 2^32=4Gb (4Gigabit = 0.5 GigaByte)

这意味着 4Gb 内存?

如果我对 64 位机器考虑同样的方式,那么我可以拥有 16ExbiBytes 的内存..这可能吗?

我的观念对吗?

What is meant by 32bit or 64 bit machine?

It’s the processor architecture…a 32 bit machine can read and write 32bit data at a time same way with 64 bit machine….

whats the maximum memory that a 32 bit machine can access?

It is 2^32=4Gb (4Gigabit = 0.5 GigaByte)

That means 4Gb ram?

If I consider the same way for a 64 bit machine then I can have a ram of 16ExbiBytes ..is that possible?

Are my concepts right?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

是的,32 位架构仅限于寻址最大 4 GB 的内存。根据操作系统的不同,由于保留了地址空间,这个数字还可以进一步减少。

在某些 32 位架构上,可以通过使用 PAE(物理地址扩展),但必须处理器支持。 PAE 使处理器能够访问超过 4 GB 的内存,但它不会改变单个进程可用的虚拟地址空间量 - 每个进程仍被限制为最大 4 GB 的地址空间。

是的,理论上 64 位架构可以寻址 1680 万 TB 的内存,即 2^64 字节。但我不认为当前流行的实现完全支持这一点;例如,当前的 AMD64 硬件只能寻址最多 1 TB 的内存(实现 40 位物理地址),尽管虚拟地址空间为 256 TiB,而未来的 CPU 可以支持最多 52 位物理地址(4096 TiB),而无需ISA 对页表格式的任何更改(为什么x86-64 虚拟地址比物理地址短 4 位(48 位与 52 位长)?)。

此外,您的操作系统还会对支持的可寻址内存量进行限制。许多版本的 Windows(特别是设计用于家庭或其他非服务器用途的版本)都受到任意限制。

2023 更新:x86-64 CPU 现在支持 57 位虚拟地址空间(具有额外级别的页表、PML5,因此操作系统在不需要时可能不会启用它,以避免在 TLB 未命中时使页行走速度变慢。)操作系统空间来映射所有物理地址空间,因为 CPU 继续在其内存控制器中支持更大的 DIMM,并在其缓存标签和 TLB 中支持更多位的物理地址空间,以及内部传输高速缓存行物理地址的总线。

Yes, a 32-bit architecture is limited to addressing a maximum of 4 gigabytes of memory. Depending on the operating system, this number can be cut down even further due to reserved address space.

This limitation can be removed on certain 32-bit architectures via the use of PAE (Physical Address Extension), but it must be supported by the processor. PAE enables the processor to access more than 4 GB of memory, but it does not change the amount of virtual address space available to a single process—each process would still be limited to a maximum of 4 GB of address space.

And yes, theoretically a 64-bit architecture can address 16.8 million terabytes of memory, or 2^64 bytes. But I don't believe the current popular implementations fully support this; for example, current AMD64 hardware can only address up to 1 terabyte of memory (implementing 40-bit physical addresses), although virtual address-space is 256 TiB, and future CPUs can support up to 52-bit physical addresses (4096 TiB) without any ISA changes to the page-table format (Why in x86-64 the virtual address are 4 bits shorter than physical (48 bits vs. 52 long)?).

Additionally, your operating system will also place limitations on the amount of supported, addressable memory. Many versions of Windows (particularly versions designed for home or other non-server use) are arbitrarily limited.

2023 update: x86-64 CPUs now support 57-bit virtual address-space (with an extra level of page-tables, PML5, so OSes may not enable it when not needed to avoid making page walks slower on TLB miss.) This gives the OS room to map all that physical address-space as CPUs have continued to support bigger DIMMs in their memory controllers, and more bits of physical address-space to go with it in their cache tags and TLBs, and internal buses that transmit physical addresses of cache line.

绻影浮沉 2025-01-03 11:21:18

32 位或 64 位机器通常指的是外部可见(“架构”)通用整数寄存器的大小。

但这与硬件的构建方式关系不大。例如,让我们考虑一下(早已过时的)Intel Pentium Pro。它通常被认为是“32 位”处理器,尽管它支持高达 36 位物理地址,具有 64 位宽数据总线,并且所有支持的操作数类型的内部计算都是在一组寄存器中执行的(因此为 80 位宽,以支持最大的浮点类型)。

至少就英特尔处理器而言,尽管更大的物理寻址已经存在很长时间了,但在 32 位处理器上任何一个进程的地址空间内直接可见的最大内存量也限制为 4 GB(32 位寻址)。 36 位物理寻址允许寻址高达 64 GB 的 RAM,但在任何给定时间只能直接看到其中的 4 GB。

对 64 位计算机的更改主要涉及更改用户可见的内容(或汇编语言级别的代码)。同样,您所看到的很少与真实的相同。例如,大多数 64 位代码将指针/地​​址视为 64 位,但实际处理器不支持那么大的地址。当前的 CPU 支持 48 位虚拟地址,并且(至少据我所知)最多支持 40 位物理寻址。另一方面,它们的设计是为了将来,当更大的内存变得实用时,它们可以将物理寻址扩展到 48 位,而完全不会影响软件。即使他们增加了 48 位虚拟寻址,在典型情况下也只会影响操作系统内核的一小部分(正常代码不受影响,因为它已经假定地址是 64 位)。

所以,不:64 位机器真正支持高达 64 位的物理寻址,但是大多数典型的 64 位软件应该与未来的处理器保持兼容确实支持直接寻址那么多RAM。

What's typically meant by 32-bit or 64-bit machine is the size of the externally visible ("architected") general-purpose integer registers.

This has very little to do with how the hardware is built though. For example, let's consider the (long obsolete) Intel Pentium Pro. It's normally considered a "32-bit" processor, even though it supports up to 36-bit physical addresses, has a 64-bit wide data bus, and internally computations on all supported operand types are carried out in a single set of registers (which are therefore 80 bits wide, to support the largest floating point type).

At least in the case of Intel processors, even though larger physical addressing has been available for a long time, the largest amount of memory directly visible within the address space of any one process on a 32-bit processor is also limited to 4 gigabytes (32-bit addressing). The 36-bit physical addressing allows addressing up to 64 gigabytes of RAM, but only 4 gigabytes of that can be directly visible at any given time.

The change to 64-bit machines mostly involved changing what was made visible to the user (or to code at the assembly language level). Again, what you see is rarely identical to what's real. For example, most 64-bit code sees pointers/addresses as being 64 bits, but actual processors don't support that large of addresses. Current CPUs support 48-bit virtual addresses, and (at least as far as I've noticed) a maximum of 40 bits of physical addressing. On the other hand, they're designed so in the future, when larger memory becomes practical, they can extend the physical addressing out to 48 bits without affecting software at all. Even when they increase the 48-bit virtual addressing, in a typical case it'll only affect a small amount of the operating system kernel (normal code is unaffected, because it already assumed addresses are 64 bits).

So, no: a 64-bit machine does not really support up to 64 bits of physical addressing, but most typical 64-bit software should remain compatible with a future processor that did support directly addressing that much RAM.

酒几许 2025-01-03 11:21:18

回到一个真正基本的想法,我们的内存地址有 32 位。这相当于 2^32 个唯一的地址组合。按照约定,每个地址指向 1 个字节的数据。因此,我们最多可以访问2^32字节的数据。

在 32 位操作系统中,每个寄存器存储 32 位或 4 个字节。每个时钟周期处理 32 位(1 个字)信息。如果要访问特定的 1 个字节,从概念上讲,我们可以通过按位逻辑运算“提取”各个字节(例如字节 0、字节 1、字节 2、字节 3 等)。

例如,要获得“dddddddd”,请采取
“啊啊啊啊啊bbbbbbbbccccccccdddddddd”
和逻辑与
“00000000000000000000000011111111”。

Going back to a really basic idea, we have 32 bits for our memory addresses. That works out to 2^32 unique combinations of addresses. By convention, each address points to 1 byte of data. Therefore, we can access up to a total 2^32 bytes of data.

In a 32 bit OS, each register stores 32 bits or 4 bytes. 32 bits (1 word) of information are processed per clock cycle. If you want to access a particular 1 byte, conceptually, we can "extract" the individual bytes (e.g. byte 0, byte 1, byte 2, byte 3 etc.) by doing bitwise logical operations.

E.g. to get "dddddddd", take
"aaaaaaaabbbbbbbbccccccccdddddddd"
and logical AND with
"00000000000000000000000011111111".

漫漫岁月 2025-01-03 11:21:18

基本上32位架构可以寻址4GB,正如你所期望的那样。
有一些技术允许处理器处理更多数据,例如 AWEPAE

basically 32bit architecture can address 4GB as you expected.
There are some techniques which allows processor to address more data like AWE or PAE.

娇妻 2025-01-03 11:21:18

是的,在 32 位计算机上,最大可用内存量约为 4GB。实际上,根据操作系统的不同,由于保留了部分地址空间,它可能会更少:例如,在 Windows 上,您只能使用 3.5GB。

在 64 位上,您确实可以寻址 2^64 字节的内存。并不是说你永远都会拥有这些 - 但话又说回来,很久以前也有人说过同样的事情需要超过 640kb 的内存......

Yes, on a 32bit machine the maximum amount of memory usable is around 4GB. Actually, depending on the OS it might be less due to parts of the address space being reserved: On Windows you can only use 3.5GB for example.

On 64bit you can indeed address 2^64 bytes of memory. Not that you'll ever have those - but then again, a long time ago the same thing was said about ever needing more than 640kb of memory...

稀香 2025-01-03 11:21:18

不,你的概念不正确。为了正确设置,您需要回答您错误回答的问题:

32 位或 64 位机器是什么意思?

<块引用>
<块引用>

问题的答案是“CPU 中重要的是 32 位还是 64 位”。那么问题是,什么是重要的事情?很多人说数据总线的宽度决定了机器是32位还是64位。但最新的 32 位处理器都没有 32 位或 64 位宽的数据总线。大多数 32 位系统至少有 36 位以支持更多 RAM。大多数 64 位处理器的数据总线不超过 48 位宽,因为这已经是大量内存了。


因此,根据我的说法,32 位或 64 位机器是由计算中使用的通用寄存器的大小或计算机使用的“自然字大小”决定的。

请注意,32 位操作系统是另一回事。您可以在 64 位计算机上运行 32 位操作系统。此外,您可以在 64 位操作系统上运行 32 位应用程序。如果您不明白其中的区别,请发布另一个问题。

因此,假设在处理器中打开了正确的寻址模式,处理器可以寻址的最大 RAM 量是 2^(数据总线的宽度,以位为单位)。

进一步注意,没有什么可以阻止有人在数据总线和存储体之间引入多路复用,这将选择一个存储体,然后对 RAM 进行寻址(分两步)。这样您就可以寻址更多 RAM。但这是不切实际的,而且效率极低。

No your concepts are not right. And to set it right you need the answer to the question that you incorrectly answered:

What is meant by 32bit or 64 bit machine?

The answer to the question is "something significant in the CPU is 32bit or 64 bit". So the question is what is that something significant? Lot of people say the width of data bus that determine whether the machine is 32bit or 64 bit. But none of the latest 32 bit processors have 32 bit or 64 bit wide data buses. most 32 bit systems will have 36 bit at least to support more RAM. Most 64 bit processors have no more than 48bit wide data bus because that is hell lot of memory already.

So according to me a 32 bit or 64 bit machine is determined by the size of its general purpose registers used in computation or "the natural word size" used by the computer.

Note that a 32 bit OS is a different thing. You can have a 32 bit OS running on 64 bit computer. Additionally, you can have 32 bit application running on 64 bit OS. If you do not understand the difference, post another question.

So the maximum amount of RAM a processor can address is 2^(width of data bus in bits), given that the proper addressing mode is switched on in the processor.

Further note, there is nothing stopping someone to introduce a multiplex between data Bus and memory banks, that will select a bank and then address the RAM (in two steps). This way you can address even more RAM. But that is impractical, and highly inefficient.

时光暖心i 2025-01-03 11:21:18

基本上,术语“x 位机器”并不取决于您的机器。这就是为什么我们不需要更改处理器或其他硬件即可从 32 位系统迁移到 64 位系统(反之亦然)。

32 位和 64 位代表计算机上运行的操作系统的寻址能力。

然而,这仍然并不意味着 x 位操作系统能够寻址 2^x GB 内存。因为“GB”中的“B”表示“字节”而不是“位”。 1 字节等于 8 位。

实际上32位系统甚至无法寻址2^32/8 = 2^29 GB内存空间,而应该为操作系统保留一些内存。

它的大小略低于 3 GB。

Basically, the term "x-bit machine" does not depend on your machine. That is why we do not need to change our processors or other hardware in order to migrate from a 32bit system to a 64bit one (or vice versa).

32bit and 64bit stands for the addressing capability of the OS running on your machine.

However, it still does not mean that a x-bit operating system is capable to address 2^x GB memory. Because the 'B' in "GB" means "byte" and not "bit". 1 byte equals 8 bits.

Actually a 32bit system can not even address 2^32/8 = 2^29 GB memory space while there should some memory be reserved to the OS.

It is something just below 3 GB.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文