0
\$\begingroup\$

If you are using a CPU to address one 2MB memory module, then since 1MB = 220 and 2·220 = 221 = 2MB, you need 21 address lines.

If you use a 2MB 16-bit memory module instead, you can remove address line 0. Why is that?

\$\endgroup\$
4
\$\begingroup\$

With 16-bit wide memory a read of address xxx0 gives you two bytes: the byte at address xxx0 and the byte at address xxx1. So the addresses ending in "1" are superfluous; you only read address xxx0, never xxx1. Now, since the last address bit will always be zero, we can drop it, ending up with an address 1 bit shorter.

\$\endgroup\$
3
\$\begingroup\$

One way to think about this is that the memory module consists of a set of blocks, and that the address identifies a specific block in memory.

So, for memory with an 8 bit block, an address would define 1 byte, and in the 2MB memory case you would need the 21 address lines for 2^21 addressable blocks. An address of '4' points to the 4th byte in memory.

If instead you have a 16 bit block, an address would define 2 bytes, and there would be only 2^20 addressable blocks. An address of 4 points to bytes 7 and 8 in memory.

That said, I would suspect that any decrease in address lines is more then made up for by the doubling of data lines.

\$\endgroup\$
  • \$\begingroup\$ Would it point to bytes 8 and 9? If you were to remove the address line corresponding to the MSB, then wouldn't that cut the number of addresses in half? \$\endgroup\$ – 200ok404notfound Mar 23 '11 at 8:19
  • \$\begingroup\$ You could do two transfers for each address instead of one and not need any additional data lines. But then of course it's slower \$\endgroup\$ – AngryEE Mar 23 '11 at 14:08
  • \$\begingroup\$ @200ok It depends on how you choose to count, starting at index 1 you'd get 1-2,3-4,..,7-8; index 0 would give 6-7. And, yes, removing a bit from address line cuts the number of addresses in half. \$\endgroup\$ – CoderTao Mar 23 '11 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.