计算机中的一个内存位置存储了多少数据? [英] One memory location in a computer stores how much data?

查看:827
本文介绍了计算机中的一个内存位置存储了多少数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设32位操作系统。


  1. 计算机中的一个内存位置存储了多少数据?

  1. One memory location in a computer stores how much data?

计算机中存储器的基本单位是什么?

Whats the basic unit of memory storage in a computer?

例如存储一个整数,所需的内存地址是多少?
如果基本单位是BYTE,则整数需要4个字节。
因此,如果我需要存储一个字节,那么如果开始放入内存位置
0001的第一个字节,那么我的整数将在0003内存位置结束吗?

For Example to a store a integer what will be the memory addresses required? If basic unit is BYTE the integer requires 4 bytes. So if I need to store a byte then if start putting in the 1st byte in memory location 0001 then will my integer end at 0003 memory location?

如果错了,请纠正我?

我需要有关CPU内存存储和管理的更多信息......你能指点一些资源吗?

I need more information about CPU memory storage and management... Can you please point me some resources?

推荐答案

最常见的是,现代系统就是你所谓的字节可访问
这意味着:

Most commonly, modern systems are what you call "byte-accessible" This means:


  1. 一个内存位置存储1个字节(8位)。

  2. 内存的基本存储单元为1个字节。

  3. 如果您需要存储4个字节,并将第一个字节置于0001,则最后一个字节将位于0004.这是0001,0002,0003和0004中的每个字节的一个字节。

请注意,当系统具有不同的CPU WORD大小时(32位系统有32位或4字节的字),内存通常由字节寻址。算术中使用的CPU寄存器是4个字节,但用于数据存储的存储器寄存器以字节为单位进行寻址。

Keep in mind while systems have different CPU WORD sizes (32-bit system has a 32-bit or 4-byte word), memory is usually addressed by byte. The CPU's registers used in arithmetic are 4 bytes, but the "memory" programmers use for data storage is addressed in bytes.

在x86系统上,许多存储器访问指令要求内存中的值对齐到可被世界大小整除的地址。例如0x ??? 0,0x ??? 4,0x ??? 8,0x ??? C。因此,在大多数系统上都不会发生在0001存储int。通常可以在任何地址找到非数字数据类型。

On x86 systems, many memory-accessing instructions require values in memory to be "aligned" to addresses evenly divisible by the world size. e.g. 0x???0, 0x???4, 0x???8, 0x???C. So, storing an int at 0001 won't happen on most systems. Non-numeric data types can usually be found at any address.

参见维基百科:对齐 Word(计算) 内存地址

这篇关于计算机中的一个内存位置存储了多少数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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