Login  Register

ALU, negationx, y, add16 off by one?

Posted by rogerdodger91 on Dec 06, 2011; 4:48pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/ALU-negationx-y-add16-off-by-one-tp3564869.html

So when im adding positive x, to positive y. And I negate either one and set f to 1. Is it right that the result is a number that is one less compared to the result i would have gotten if I used a negative sign instead of the negation bit?

I originally fixed this by incrementing the noty, and notx outputs then ran them through a multiplexor with the negation bits and the original noty and notx for the adder16 gate. However the script said this was wrong. When i took out my fix, it works?

Here is a mathematical example.

1500 + -(500) = 1000. <hard coding the negative.
1500 + 500, ny = 1 = 999.

Is this not right? And if so why not?