指针的大小相对于RAM,建筑 [英] pointers size with respect to RAM, architecture

查看:133
本文介绍了指针的大小相对于RAM,建筑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么决定一个指针的大小很多问题。
基本上作为一个经验法则,你可以说这是处理器架构,

there were many questions what determines size of a pointer. basically as a rule of thumb you can say this is processor architecture,

86 - > 4个字节的指针

x86 -> 4 bytes pointer

64 - > 8字节指针

x64 -> 8 bytes pointer

我所看到的也是这里有些人说这是系统总线,是负责的,但其他拒绝。比方说,建筑告诉我什么是指针的大小。

I have seen also that some people here say it is system bus that is responsible for it, but other denied. Let's say architecture tells me what is the size of a pointer.

要解决的4GB内存需要4,294,967,296映射和4字节大小的指针可寻址内存4,294,967,296位置。

To address 4GB of RAM you need 4,294,967,296 mappings and pointer of size 4 bytes can address 4,294,967,296 memory locations.

要解决8GB的内存需要8589934592映射和指针大小为4个字节不能解决所有可能的值。
所以这就是为什么我不能超过4GB的内存更x86架构?

To address 8GB of RAM you need 8,589,934,592 mappings and pointer of size 4 bytes cannot address all possible values. so this is why I cannot have more than 4GB RAM on x86 architecture?

推荐答案

中的内存大小不是由架构(32位或64位)的限制。建筑不仅决定多少内存可以同时,由操作系统和其上运行的程序来解决的。在32位机,即用32位宽的内存总线的计算机,操作系统和程序可以看到只有4 GB的内存。但是,这并不意味着,只有4 GB的RAM。如果制造商提供了它,你可以有16 GB或4 x 4 GB的RAM。在这种情况下,将有2个隐藏的地址线和也有会很难$ C $光盘逻辑,以决定那些2线的水平,从而选择任何可用的4 GB的RAM的 - 00 01 10 11 。这些隐藏的地址位不使用软件层,所以对于这些层,也只能使用一个4字节的指针。这些隐藏的地址线数决定通过多少,你可以扩展你的RAM。

Amount of RAM is not limited by the architecture (32 or 64 bit). Architecture only decides how much memory can be addressed at a time, by the OS and the programs running on it. On a 32-bit machine, that is, a machine with 32-bit wide memory bus, the OS and the programs can "see" only 4 GB of memory. But that doesn't mean there is only 4 GB of RAM. If the manufacturer has provided for it, you can have 16 GB or 4x4 GB of RAM. In that case, there will be 2 more "hidden" address lines and also there'd be hardcoded logic to decide the levels of those 2 lines, thus selecting any of the available 4 GB RAMs - 00 01 10 11 . These "hidden" address bits are not used by the software layers, so for these layers, they can only use a 4-byte pointer. The number of these "hidden" address lines decides by how much you can extend your RAM.

这仅仅是一个例子。这取决于供应商,他们决定如何提供额外的RAM。

This is just one example. It depends on the vendor, how they decide to provide for the extra RAM.

这篇关于指针的大小相对于RAM,建筑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆