Re: ALU Implementation
Posted by WBahn on Jul 24, 2021; 1:35pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/ALU-Implementation-tp4036186p4036187.html
You are definitely off the beaten path.
The ALU is actually amazingly simple, far simpler than it appears at first.
You have two basic operations -- adding two 16-bit values (the A in ALU) and anding two 16-bit values (the L in ALU). The f input simply chooses between the two.
So set up the core of your ALU to do just that. Take two inputs and choose which of the two operations is used for the output.
The other control inputs merely control what happens to the inputs before they are sent to this core portion or what happens to the output of the core portion before it is sent to the chip output.