Login  Register

Problem with zr and ng

Posted by cygnus on Mar 07, 2011; 8:12pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Problem-with-zr-and-ng-tp2647722.html

Hi,

I've been trying to implement ALU and is stuck upon zr and ng.

Here's the code I used. ores is equivalent to f(x,y) and 16 bit wide.

    Not(in=ores[15], out=ngc);
    Not(in=ngc, out=ng);
   
    Or8Way(in=ores[0..7], out=fh);
    Or8Way(in=ores[8..15], out=sh);
    Or(a=fh, b=sh, out=orOut);
    Not(in=orOut, out=zr);

Hardware Simulator doesnt load the code.