Re: Setting A in C-instruction

Posted by WBahn on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Setting-A-in-C-instruction-tp4036936p4036945.html

There's always a prior instruction. The program counter ALWAYS has a value. That value is ALWAYS applied to the address lines of the ROM. The ROM ALWAYS presents what is in memory at that address to the instruction input of the CPU.

When you execute a A-type instruction, at the 'tick' that starts the clock cycle, ALL of the registers (A, D, PC, and RAM[A]) are loaded with the values at their inputs due to the prior instruction according to the state of their load signals from the prior instruction.

At the 'tock' part of the clock cycle, all of the combinatorial logic has been evaluated based on the current instruction and the new contents of the registers, but no registers change yet. These signals then just sit there for the remainder of the current clock cycle and the registers are updated with the 'tick' that starts the next clock cycle.