General: Understanding of CPU/Memory communication
Posted by dsguy on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/General-Understanding-of-CPU-Memory-communication-tp4037477.html
Hi, I recently finished part 1 of the course and I must say I've been loving it, learned a ton and really looking forward to continuing the journey with part 2.
However, there is still one thing that I cannot wrap my head around. I've been doing quite some research and whenever I thought I understood the concept, then another source popped up with explanations seemingly contradicting what I had thought I understood before.
I am pretty sure I am just not really understanding a core piece of terminology or whatever, so hopefully someone here can clear things up for me.
High level, I am confused about how the CPU and Memory exchange pieces of information of varying width, how the former operates on them and how the latter stores them:
* Computers usually come in architectures of X-bit (usually 32 or 64); at the beginning of this course, when building out all the chips, I was under the impression that a X-bit computer must be build from X-bit parts - is this assumption correct or does it only refer to bus width? E.g. can I have 2X-bit registers in X-bit computer?
* I am using a 64-bit laptop, yet when I hexdump e.g. a file that contains the string "hello", I can see that each letter is stored in one byte - each with its own memory address. This is what I don't understand! Does that mean at some place between the ALU and the Memory there is a "thing" that fans out a single 64-bit instruction into (in this case) 5 instructions? How would that work?
* Memory chips - if I understood correctly - can be much wider than regular computer architectures, like 128, 256 bit wide. If I have a chip with a 256 bit register, is every register simply partitioned into 32 byte parts, each with their own address (through some means)?
* How does a 64-bit CPU operate on multiple bytes retrieved from Memory? Say, the "hello" string stored in Memory is retrieved and displayed on a screen, is this done in a single operation, can the magical "thing" I don't understand take 5 smaller instructions and glue them together to one 64-bit instruction or is it maybe simply done in multiple clock cycles (which seems unlikely for me since it sounds like quite a waste).
* If my assumptions from above are correct, where does Hack fit in here? Within Hack, everything is 16-bit and going back and forth is very logical to me. Is this for simplicity reasons?
At some point during my research I understood that storing information such as a single character in 16, 32 or 64-bit memory locations is of course a total waste of space and storing individual bytes makes much more sense. I just feel like I don't really understand how varying widths of information and physical chips can easily communicate with each other.
Thanks (and sorry for the long post :D)