# I am a little bit confused about how to calculate the memory capacity

I am a little bit confused about how to calculate the memory capacity.

word=data lines size
byte=8 bit


Most of the people use this formula to calculate the capacity of the memory: C=(2^n*word)/8 octet

Is this formula correct when speaking about byte-addressable? Because if we have byte-addressable memory, I think the capacity will be 2^n octet.

If this is correct why people use the formula in all cases? If not can you please explain why to me?

Thanks you.

• It can depend on context, there is no absolute rule. Often, when the data bus size is larger than 8 bits, lower address bits don't exist, for example A[31:2] for a CPU with a 32bits data bus. – TEMLIB Dec 26 '16 at 17:03
• Thanks you, but do you know why in most sources they use this formula to calculate the capacity? – Mohamed Amine Ouali Dec 26 '16 at 21:24
• The sources are probably copying from each other, without caring about the meaning of the formula. You can tell that this is the case because they bother to give you a formula at all. – Yuval Filmus Dec 27 '16 at 8:38

This formula assumes that memory is word-addressable rather than byte-addressable. The number of words that can be addressed is $2^n$. If you want to convert this from words to bytes, you can use the formula (in which word stands for the word size in bits). If you want to convert it to kilobytes, for example, you need to multiply by the word size in bits, and divide by $8192$. And so on. Come up with your own formulas!