Search code examples
memoryarchitecturecellbitmemory-address

How many bits are needed


I've stumbled across a problem:

How many bits are needed to address a 10kB data memory if one cell is 1 byte in size?

so when I try to solve this question the only thing I can solve is what's the amount of cells but not how many bits are needed to address a 10kB data memory.

Because what I have come up with is that the answer must be 81920/8=10240 cell amount but I'm pretty sure it's wrong because it answers the last part of the question and not how many bits.


Solution

  • Think of a cell as a minimal entity that can be uniquely accessed / addressed. You have 10240 such cells, so the address width must be able to represent up to that value. E.g. 8 bit wide address (noun) can address (verb) 256 unique entities, 10 bit wide address can address 1024 unique entities, etc.

    Back in the days of 32-bit PCs, each process can have at most 4GB virtual memory exactly because the virtual address width was 32 bits, and the “minimal entity” addressable was a byte. So 2^32 bytes is the maximum addressable memory size for those PCs.