Calculating memory size based on address bit-length and memory cell contents

前端 未结 1 1134
死守一世寂寞
死守一世寂寞 2021-01-19 05:01

I am trying to calculate the maximum memory size knowing the bit length of an address and the size of the memory cell.

It is my understanding that if the address is

相关标签:
1条回答
  • 2021-01-19 06:02

    "actual memory size of the machine"

    I will assume here that you mean the physical address space of the machine in question, ignoring virtual addressing, etc. Most modern machines are byte-addressable (8-bit) meaning that each address refers to 1 byte. In this case, assuming that you have an n-bit processor with a matching n-bit address bus (there are cases where these aren't the same, e.g. Pentium processors) the number of memory locations possible is 2^n bytes.

    If you have more specialized hardware, (embedded microcontrollers, etc) that are word addressable (16-bit, 32-bit), then you are correct that you would multiply 2^n * (word-size in bits) / (8) = # of bytes.

    That being said, when you take into consideration virtual addressing and physical bus sizes that might not be the same as the processor's address lines, you would have to take a look at that specific machine for the "theoretical limit".

    0 讨论(0)
提交回复
热议问题