project01: Comments/cleanup

This commit is contained in:
2025-09-03 22:10:34 -04:00
parent dd31b8f1dc
commit 934f1ad2f5
11 changed files with 54 additions and 33 deletions

View File

@@ -11,9 +11,13 @@ CHIP Xor {
OUT out;
PARTS:
Not(in=a, out=tmp1);
Not(in=b, out=tmp2);
And(a=a, b=tmp2, out=tmp3);
And(a=tmp1, b=b, out=tmp4);
Or(a=tmp3, b=tmp4, out=out);
// invert both inputs
Not(in=a, out=notA);
Not(in=b, out=notB);
// a and not b path
And(a=a, b=notB, out=aPath);
// not a and b path
And(a=notA, b=b, out=bPath);
// combine both paths
Or(a=aPath, b=bPath, out=out);
}