Setting A in C-instruction
Posted by eatmorepies on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Setting-A-in-C-instruction-tp4036936.html
I've correctly implemented the chips mentioned in Chapter 5. I'm still unsure if I understand the CPU chip correctly, so I am hoping to get some confirmation.
Suppose we wanted to set the A register of our Hack computer to the value of D. Based on the CPU specification and a C-instruction `A=D`:
1. Since at the beginning of the instruction execution we do not have D from the ALU, our CPU would first try to set our A register to some superflous value (not from `instruction`, because the relevant bit is set to instead obtain the value from the ALU output).
2. After the second Mux, the ALU outputs the D value to the first Mux.
3. We've reached the end of our `.hdl` file, so now we are in `tock`. Our ALU output is stabilized, so we again use the relevant control bit to set the a register to the ALU output.
Am I understanding this operation correctly? Is there anything I'm missing?