How many bits would you need to address a 4M X 8 memory if

2. the memory is word-addressable with a word size of 16 bits?
3. the memory is word-addressable with a word size of 32 bits?

For #1, I have understood the solution as 4M = 22 x 220 = 222 = 22 bits.

For #2 and #3, the answers provided in our lecture was:

• 4M X 8 bit memory requires 21 bit addresses if it is word-addressable and word size is 16 bits.
• 4M X 8 bit memory requires 20 bit addresses if it is word-addressable and word size is 32 bits.

Question:
How did it arrive to 21 and 20 bit addresses for 16-bit and 32-bit word sizes respectively?

EDIT:

Homework:
How many bits would you need to address a 2M X 32 memory if

2. the memory is word-addressable with a word size of 32 bits?

Solutions:

1. 2M = 2 x 220 = 21 x 220 = 221 = 21 bits
2. 21 - [log 2 (32/32)] = 21 - [log 2 (1)] = 21 - 0 = 21 bits

Are my solutions correct?

• A lot of this might also depend on the addressing scheme you want to use. If you want full linear addressing, then the calculations are easy, however some architectures uses a segment (page) + offset type addressing scheme specifically to minimise the address size.
Nov 23, 2013 at 11:22
• For the above given lecture example, what may be the mathematical solutions for #2 and #3? Do I simply subtract 1 or 2 from the byte-addressable bits (22 bits)? Nov 23, 2013 at 11:29
• No, you subtract log2(word_width/8) from the byte-addressible bits. Nov 23, 2013 at 11:32
• Just to confirm, is it /8 because it is 4M X 8? Nov 23, 2013 at 11:48
• Yes. (Unwritten in the question is how you reorganise a X8 memory to get 16 or 32 bits out of it, but that's another story.) Nov 23, 2013 at 12:13

Yes, your solutions for the homework are correct. Note that for the 4Mx32 you only use 8 bits per 32 bit word. If you want to use all bits you'd need a 32-to-8 multiplexer/demultiplexer.

#2 and #3 of the lecture are a bit confusing. If the memory is word-addressable with 16-bit words, it's no longer a 4Mx8 memory but a 2Mx16 memory. To address 2M words you need 21 bits. Similar for #3.

• I have been thinking something might have been wrong with the lecture example. Dec 2, 2013 at 0:00

Solutions to Homework:

1. 2M x 32
= 21 x 220 x (25 / 23)
= 21 x 220 x 22
= 223