Login  Register

Re: Comparison Failure for And or Or gates

Posted by WBahn on Jan 28, 2021; 2:29pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Comparison-Failure-for-And-or-Or-gates-tp4035543p4035544.html

In your And gate code, you have:

Nand (a=a, b=nota, out=x);

What does the truth table for that look like?

Since 'nota' is always the opposite of 'a', one of them will be HI and the other will be LO, right?

The definition of the Nand gate says that the output is LO if and only if both of the inputs are HI, which can never happen in this case, so the output of this, namely x, will always be HI.

The end result is that you have implemented a very complicated buffer whose output is whatever the 'b' input happens to be.

Keep in mind what "Nand" stands for -- Not And.

What do we know about a double negative, namely Not Not?