Memory Access using 32 bit address in a word-addressable system

。_饼干妹妹 提交于 2021-02-05 11:18:05

问题


I'm just checking to make sure I have a proper understanding of how memory access works.

Say I have a word-addressable memory system with 64-bit words.
How much memory could be accessed using a 32-bit address size?

A 64 bit word is 8 bytes, so we're dealing with an 8 byte word.
An 8 byte word can hold up to 2^8 (256).

Given that we have a 32 bit address, we have 2^32, but since each word is taking up 256 of those, (2^32)/256 = 1677216 bytes.

To put that into metric terms, we have 2^24 = (2^4) * (2^20) = 16 Mb.

Is this the proper way of doing this?


回答1:


A 32 bit address provides 4,294,967,296 possible addresses. If the smallest addressable element is a 64 bit == 8 byte word (versus a byte), then the total amount of addressable space would be 4,294,967,296 x 8 = 34,359,738,368 bytes= 34GB.

As for the capacity of an 8 byte word, it's 8 bytes, not 2^8 = 256 bytes.

Note some old computers did have a basic addressing system that only addressed words. Byte accessing required a byte index or offset from a word based address. I don't think any current computers use such a scheme.




回答2:


You are taking 32 bit address which means 2^32 bits can be addressed but if you want how many bytes can be address then just divide it like 2^32/8=2^29 because 1 byte have 8 bit and if you want how many words can be addressed then 2^29/8 because 1 word contains 8 bytes so 2^26 words can be addressed.

And since one word is 8 byte so we can address (2^26)*8 bytes. Hope it might help!



来源:https://stackoverflow.com/questions/42119751/memory-access-using-32-bit-address-in-a-word-addressable-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!