I'm having trouble conceptualizing the ALU, so I'm going through the alu worksheet (
http://nand2tetris-questions-and-answers-forum.32033.n3.nabble.com/file/n95834/alu_worksheet.pdf).
So, for the case (where f(x, y) = 1, x = 1010, and y = 0001) I've filled it out like so:
f(x, y) = 1 | x = 1010 | y = 001
zx = 1 | x = 0000 |
nx = 1 | x = 1111 |
zy = 1 | | y = 0000
ny = 1 | | y = 1111
x + y = 1111 + 1111 = 1110
So, now I have to negate the result.
I understand the example where we negate 4 and then the little exercise where we convert 6 to -6, but I'm experiencing a bit of brain lock here.
The decimal form of 1110 is 14. To negate this, do I just subtract 16 (2^4) - 14 to get 2 (0010)?
Thanks in advance.