Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 n bits then there are 2^n memory locations. But then to calculate the actual memory size of the machine, you would need to multiply the number of addresses by the size of the memory cell. Is that correct?

To put it another way,

Step 1: calculate the length of the address in bits (n bits) Step 2: calculate the number of memory locations 2^n(bits) Step 3: take the number of memory locations and multiply it by the Byte size of the memory cells.

If each cell was 2 bytes for example, would I multiply 2^n bits (for address length) by the 2 Bytes per memory cell.

So total memory would be 2^n bits (address size) * x bytes (cell size)?

like image 541
JenTen10 Avatar asked Nov 08 '17 18:11

JenTen10


People also ask

How do you calculate memory size from address range?

The formula is the highest address-lowest address + 1. For your first problem range1: FD00 0000 to FDFF FFFF, the answer is 00FF FFFF+1=0100 0000H=1 X 16^6= 1 X (2^4)^6=2^24=2^4 x 2^20. For in binary system 2^10= 1024=1K and 2^20=1K x 1 K = 1M then 2^4 x 2^20=16 M.

How do you calculate the number of bytes in a memory?

Bytes - A byte is simply 8 bits of memory or storage. This is the smallest amount of memory that standard computer processors can manipulate in a single operation. If you determine the number of bits of memory that are required, and divide by 8, you will get the number of bytes of memory that are required.

How the size of the address space is determined with the help of address length?

Explanation: Physical Address Space = 2P Bytes. Word Length is 2W bytes, which means each word is of size 2W bytes. Cache memory size = 2N Bytes and Tag Size = 2X Bytes.


1 Answers

"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".

like image 123
samuelnj Avatar answered Oct 12 '22 10:10

samuelnj