Login  Register

Figuring out zr

Posted by mbm29414 on Jan 25, 2011; 3:21am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Figuring-out-zr-tp2326310.html

I'm working through making the ALU.

To be honest, I got through the first few steps and then "cheated" by looking on Google Code.

I am working through it to make sure I really get it, and I think I do until the last bit, determining the value of zr.

I get how the six input bits affect a and b to create out.

I get that:

If out[15] = 0 --> ng=0 else ng=1.

What I can't figure out is how the determination is made that "out" is either equal to zero or not based exclusively on messing with out[15]. Obviously, if out[15] = 1, the number can't be zero, since that 1 indicates a non-zero negative number.

Can anyone explain the logic, please?