views:

431

answers:

2

Hi I am preparing my exam for computer system. I don't quite understand how to calculate the number of address bits needed for the memory.

For example,
Suppose that a 1G x 32-bit main memory is built using 256M x 4-bit RAM chips and this memory is word-addressable.

What is the number of address bits needed for a memory module?

What is the number of address bits needed for the full memory?

And what about If the memory is byte addressable, what would be the solutions?

Many thanks

+1  A: 

Nowadays, the word byte is invariably used to mean 8 bits (it didn't always use to be so, which is why the word octet, specifically defined to mean exactly 8 bits, is still used in documents when precision is required, e.g. when specifying communication protocols).

So, you compute how many bits you have to address, divide by 8, and that's how many bytes you have to address. The number of bits you need in each address is obviously the ceiling of the logarithm in base 2 of the number of distinct bytes you need to address -- I sure hope that part doesn't come as a surprise;-).

The term word is still pretty ambiguous: depending on the context it can mean 16 bits, or 32 bits, or even more. Anyway, once you know how many bits that means, the process is exactly the same as for bytes, just substitute 32 (or whatever) in lieu of 8 in the previous paragraph.

Of course this applies just as well to a single module as to the whole memory -- in each case, compute the number of bits, divide to get the number of bytes or words, log2, then take the ceiling of that (obviously the last step's not needed if the log2 is integer;-).

Alex Martelli
+1  A: 

What is the number of address bits needed for a memory module?

Knowing these will help:

2^8  = 256
2^10 = 1024 = 1 KB
2^20 = 1 MB
2^30 = 1 GB
2^32 = 4,294,967,296 = 4 GB

You'll need at least 28 bits to address within a 256MB memory module (the exponents add when you multiply them).

What is the number of address bits needed for the full memory?

Since 1 GB = 2^30, you'll need 30 bits to address that 1 GB of memory.

The most memory you can address with 32 bits is 4 GB.

And what about If the memory is byte addressable, what would be the solutions?

Not sure what you're asking here.

duffymo