Login  Register

ALU Compare Not Comparing

Posted by PolarBear on Jun 03, 2013; 5:45am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/ALU-Compare-Not-Comparing-tp4026910.html

I built my ALU, but when I go to run it when the X values are all 0 and the Y values are all 1, it runs fine until the output should be something like 0000000000000001 or 1111111111111110 then it errors out on me.
Also when the X=0000000000010001 Y=0000000000000011 it seems to error out on each one.
I've been racking my brain trying to figure it out. I'm betting it is something easy that I'm just not seeing.

Maybe if someone can explain how the ALU can end up with an out of 0000000000000001 when X=0000000000000000 Y=1111111111111111

Many thanks!

---------------------------------------------------------------------------------

My output

|        x         |        y         |zx |nx |zy |ny | f |no |       out        |zr |ng |
| 0000000000000000 | 1111111111111111 | 1 | 1 | 1 | 1 | 1 | 1 | 0000000000000000 | 1 | 0 |

Correct output

|        x         |        y         |zx |nx |zy |ny | f |no |       out        |zr |ng |
| 0000000000000000 | 1111111111111111 | 1 | 1 | 1 | 1 | 1 | 1 | 0000000000000001 | 0 | 0 |