Re: Problems understanding Hardware/Software interface

Posted by cdrh on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Problems-understanding-Hardware-Software-interface-tp4032625p4032811.html

I’ve formatted this response by addressing paragraph by paragraph. I want to apologize ahead of time for the amount of questions that I have. I’m completely new to the whole computer science world.

Starting with paragraphs 1-2.
Putting it in a mathematical formula, you are saying the CPU = ALU + PC + (2)Registers. These (2)Registers are connected via data connections and control connections?  So essentially, the CPU is another chip on it’s own that has its own inputs and outputs? But it encapsulates the ALU, PC, and Memory(Registers) and their functionality?

I digress here. I know I haven’t finished the course and it’s entirety, and I don’t mean to criticize or come off in some kind of arrogant way(because god knows how people interpret tone through reading and processing text). But why haven’t we built the the CPU yet? Is there a reason why you guys decided to talk about machine language first? Also, what about the control unit?

Paragraph 3-6
You said  “The CPU "receives" an instruction on it's instruction input”. Ok now addressing the “receives an instruction”. Who/what is writing that instruction so the CPU can read it? Is it the ROM? If so, does that mean that when the ROM was created it was pre-loaded with the instructions? How does the CPU know what to do with these instructions (this question in particular probably has to do with the construction of the implementation of the CPU)?  I’m guessing this might be where the control unit comes into play? I’ve read about the Fetch-Decode-Execute cycle. Is this what you are talking about?

Paragraph 7
I’m sorry but I don’t know what you mean by “inM CPU input and addressM, writeM and outM outputs. What does the ‘M’ stand for? Are you referring to the state of the selected register?

Paragraph 10-11
So here you say “This means that the ROM will PRODUCE the data stored in ROM[0] and it will send it to the instruction input of the CPU.” I don’t get what you mean by PRODUCE. This goes back to my question from above “does that mean that when the ROM was created it was pre-loaded with the instructions?” If it is “produced”, how is it produced? Lastly, you say that it’s producing “DATA stored in ROM[0] and it will send to the INSTRUCTION INPUT of the CPU.” So this DATA, the instruction or a value? I’m confused because in Paragraph 11, you then say “it will treat it as value”. Is that because the leftmost bit is 0 as you stated in your example in Paragraph 3?

Paragraph 14
Also, in step 2, you said “The other ALU input is always the CONTESTS of D.” Did you mean “contents”?

Paragraph 20
Definitely a light bulb moment for me. I think I’m starting to get the picture. Thank you so much. You have no idea how confusing this was all to me.

Paragraph 23-25
Ok this is where it gets confusing again for me. So at this point, we have the ROM that is ‘x’ size which has the instructions. We have a keyboard, mouse, and monitor connected. So are you saying we’ve fired up the computer and now we have to write the Assembler? You say, “we’ll have to MANUALLY convert it to binary”. How do we go about doing this “manual” process? Then you say we have other computers that does the translation for us, so is there another computer within our current computer that feeds the translated binary results to the “target machine”/our current computer?

Lastly, does machine language = instructions? Are they the same thing?

As for 2s complement part, thank you so much. I finally have a better understanding of it now.  

Thank you so much for this amazing response. I truly, truly appreciate it from the bottom of my heart.