I'm currently learning about how a CPU works on the hardware level and something that keeps coming up is memory organization. From what I've learned (and please, do correct me on anything that is not right), you can have a memory organized in the following two ways:
Byte organized memory: Each address on the address bus points to a memory location where a byte (8 bit) is stored.
Word organized memory: Each address on the address bus points to a memory location where a word (multiple of 8 bit) is stored.
In other words, a byte organized memory can access any memory location that is a byte boundary while a word organized memory can only access memory locations that are a word boundary.
Now here is where I have some trouble. I am studying for a midterm comming up and I am looking at past assignments and the following question comes up:
Given a set of memory modules with 20 bit address and 8 bit data interface. We need to build a byte organized main memory of 4 MB for a 16-bit data architecture CPU.
Now I know that we need to build a main memory using the memory modules given. To start off, we need to find the capacity of each memory module, whicch is given by
2^m * n, where m is the address bus in bits and n is the data bus in bits. This gives a capacity of 2^20*8 = 1MBytes for each memory module.
Now we need to figure out how many memory modules are needed. This is fairly easy and is found as follows: 4MB / 1MB = 4 modules.
Now the part where I don't seem to understand, the memory is supposed to be byte organized, but the data bus out of the main memory is 16 bits. How can I design a byte organized memory if each access yields a word? Doesn't byte organized mean that given an address, it would be possible to access that specific byte in the memory? How is that possible when the memory modules must be designed in a way that yields a 16 bit data bus? Here is the solution for the question. Please explain to me in details why the main memory was designed this way, and how it is possible to access each bytes individually.