32位CPU:可以使用多少内存? [英] 32bit cpu: how much memory can it use?

查看:225
本文介绍了32位CPU:可以使用多少内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我知道这个问题已经问了很多遍了,但是我真的不知道32位处理器在理论上还是实践上都无法解决多少内存. 很快,我来自土木工程专业,因此我仍在学习计算机科学.度量单位对我来说也很重要,这实际上是我的问题:

现在我知道您可以通过执行2 ^ 32(或64)来计算cpu可以使用多少内存,在这种情况下,您将获得4.294.967.296位. 现在我知道(或我想我知道)内存以字节为单位,因此为了找出cpu可以使用多少内存,我将4.294.967.296/8除以得到536.870.912字节. 那么您将536.870.912/1024除以524.288千字节. 然后除以524.288/1024,则得到512兆字节. 然后除以512/1024,则得到0.5 GB,这不是很好.

现在我注意到,如果一开始不除以8,您将得到4吉比特;所以我的问题是:RAM是按位还是字节来衡量的. 如果是再见,那么cpu地址位和ram容量之间是什么关系?

嘿,我设法了解了度量单位的工作方式.基本上,您有4.294.967.296个地址(从0x00000000到0xffffffff),每个地址代表4个字节的数据.然后除以1024,得到4.194.304 KB,4.096 MB和4 GB.很抱歉,花了这么长时间,感谢大家的反馈.

解决方案

内存由许多可读写的项组成,这些项称为 words .
每个项目都有一个唯一的编号,称为地址.

CPU具有固定数量的位/引脚来表示地址.
一位可以表示地址0和1.
两位最多表示00、01、10、11.
三位代表...好吧.

每个位都有两个值,每个位独立于其他位,因此,每次加一点时,将值的数量加倍(只需取所有旧值并在它们前面放一个0,然后用为1,则您获得的值是旧值的两倍.
因此 n 位是2 n 个可能的值,2 n 个可能的 words .

如果CPU最多具有这些位数来表示一个地址(罪魁祸首:寄存器的大小不必与地址的位数匹配.32位CPU可以具有36位地址用于例如)它最多可以访问那么多的内存字.

一个内存字可以是任何非零大小.从字面上看,任何大小. 包括1位或14位或8位.
标记上最分散的架构x86使用1字节的字(因此,对于32位地址,它可以访问2 32 = 4GiB),但这绝不是一般规则.

now i know this question has been asked quite a few times now but i'm not really wondering how much memory a 32bit processor can address neither theoretically nor practically. just a quick heads up, i come from a civil engineering background so i'm still learning in terms of computer science; and also units of measure are a big deal for me which is actually my question:

now i know you can calculate how much memory a cpu can use by doing 2^32 (or 64) and in this case you get 4.294.967.296 bits. now i know (or i think i know) memory is measured in bytes, so in order to find out how many bytes of memory a cpu can use i divide 4.294.967.296/8 and you get 536.870.912 bytes. then you divide 536.870.912/1024 and you get 524.288 kilobytes. then you divide 524.288/1024 and you get 512 megabytes. then you divide 512/1024 and you get 0,5 gigabytes which is... not great.

now i noticed that if you don't divide by 8 at the beginning you get 4 gigabits; so my question is: is ram measured in bits or bytes. and if it's byes then what is the relationship between cpu address bits and ram capacity?

EDIT: hey, i managed to understand how the units of measure work. basically you have 4.294.967.296 addresses from 0x00000000 to 0xffffffff and each address represents 4 bytes of data. then you divide by 1024 and get 4.194.304 kbytes, 4.096 mbytes and 4 gbytes. sorry it took this long, thanks to all for the feedback.

解决方案

A memory is made by a number of read-writable items, called words.
Each items is given an unique number, called address.

The CPU has a fixed number of bits/pins to represent an address.
One bit can present the addresses 0 and 1.
Two bits represents at most 00, 01, 10, 11.
Three bits represents... well you got it.

Each bit has two values, each bit is independent of the others, so each time you add a bit you double the number of values (just take all the old values and put a 0 in front of them, do it again with a 1 and you get as twice as the old values).
So n bits are 2n possible values, 2n possible words.

If the CPU has at most these number of bits to present an address (culprit: the size of a register doesn't have to match the number of bits of an address. 32-bit CPU can have 36-bit addresses for example) it can access at most that much words of memory.

A word of memory can be any non zero size. Literally, any size. Including 1-bit or 14-bit or 8-bit.
The most diffused architecture on the marked, the x86, use words of 1 byte (so with 32-bit addresses it can access 232 = 4GiB) but this is in no way a general rule.

这篇关于32位CPU:可以使用多少内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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