How many bits would you need to address a 4M X 8 memory if
- the memory is byte-addressable?
- the memory is word-addressable with a word size of 16 bits?
- 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
- the memory is byte-addressable?
- the memory is word-addressable with a word size of 32 bits?
Solutions:
- 2M = 2 x 220 = 21 x 220 = 221 = 21 bits
- 21 - [log 2 (32/32)] = 21 - [log 2 (1)] = 21 - 0 = 21 bits
Are my solutions correct?