Re: ALU shows consistently the letter M when A register is selected

Posted by cadet1620 on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/ALU-shows-consistently-the-letter-M-when-A-register-is-selected-tp3455715p3456508.html

The ALU actually doesn't know where its data is coming from or where the data is going.  That is a function of the design of the CPU.  If I were writing the Hardware Simulator, I would have labeled the ALU inputs x and y (inside the logic symbol) and used x and y in the function description, as this is the way the ALU is described and developed in chapter 2.  In the case of D=A the function would be 'y'.

Showing a computation in the ALU during A-instructions is correct.  The ALU is computing something during A-instructions.  The result of this computation is ignored; it is not stored anywhere.  If instruction bits 6-11 are tied directly to the ALU, it will be computing a random function during A-instructions depending on the value being loaded.  If the control signals for the ALU are all forced to 0 during A-instructions, the ALU will always be computing x & y for A-instructions.

--Mark