Re: Can I connect input pin to output?
Posted by
WBahn on
Sep 28, 2022; 6:18am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Can-I-connect-input-pin-to-output-tp4036899p4036904.html
evglep wrote
Here is my current implementation:
CHIP Dec1 {
IN N;
OUT q1, q0;
PARTS:
Not(in=N, out=q0);
Or(a=N, out=q1);
}
Don't leave inputs floating. The Or gate has a 'b' input and the simulator doesn't know what to do with it. Don't assume that it is going to do what you would like it to do. Tell it what you want it to do by tying that input to the signal 'false' (no quotes).
Or(a=N, b=false, out=q1);