I am having an adding problem in my ALU. Both of my inputs to the add16 are -1 (outNX and outNY) but after the adder is complete the output is 0 (xPlusy). If I'm not mistaken it should be -2. Where am I making a mistake?
Yes, you are correct. The adder output should be -2 (1111 1111 1111 1110) so that 'no' will invert that to be 1.
All the signals I can see are consistent with xPlusY = 0 (outF, outNo, out and ng) so I don't think it's a display or computation problem in the simulator.
Since the first test is computing 0+0 = 0 and the second is comnputing -1 + -1 = 0, I'm thinking that there may be something wrong with your Add16.
Check that you have a functional Add16.hdl in the directory with your ALU. One quick test would be to rename Add16.hdl to something like Add16.hdl.save so that the ALU will be forced to use the built-in Add16.
If you can't find anything, feel free to email me your ALU and Add16.
Thank you for the reply. I started testing my Add16 and it failed the comparison test. I had previously ran that code in the simulator and it passed. I decided to close the program and then reopen it. Once I had finished doing that all of my code worked correctly.