The CPU chapter was brutal.
Unfortunately, is unclear how to build it. Watched the video many times, read the chapter several times, I spent about 10 hours.
I'm using the 2nd edition of the book, along with the coursera videos, the language is unclear and focus in odd things, like instruction colours.
A few tips:
- Look at the presentations on
https://www.nand2tetris.org/course, they have extra material and the edition 1 of the book seems to be more clear in some aspects. This explains everything that was not in the book and videos.
- The ALU diagram specifies which value is X and Y ">[]" top is X, bottom is Y. CPU architecture diagram might give you the impression of the opposite.
- ALU generates C instructions
- Every part before being feed, the instruction should be tested if it's type A or C and act accordingly.
- When the A register holds an address, it was 1 bit less (15 - op code) so the output should skip that one
- when writeM is true, addressM and outM should be populated from two different sources, and with different length.