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,8 +11,12 @@ CHIP Mux {
OUT out;
PARTS:
Not(in=sel, out=tmp1);
And(a=a, b=tmp1, out=tmp2);
And(a=b, b=sel, out=tmp3);
Or(a=tmp2, b=tmp3, out=out);
// invert selector
Not(in=sel, out=notSel);
// when sel=0: aPath gets a
And(a=a, b=notSel, out=aPath);
// when sel=1: bPath gets b
And(a=b, b=sel, out=bPath);
// combine both paths
Or(a=aPath, b=bPath, out=out);
}