Implement basic logic gates: Not, And, Or, Xor, Mux, DMux

This commit is contained in:
2025-08-27 19:07:20 +02:00
parent beb668806a
commit ad5f774ae0
6 changed files with 32 additions and 13 deletions

View File

@@ -11,5 +11,10 @@ CHIP Xor {
OUT out;
PARTS:
//// Replace this comment with your code.
}
// Xor(a,b) = Or(And(a, Not(b)), And(Not(a), b))
Not(in=a, out=notA);
Not(in=b, out=notB);
And(a=a, b=notB, out=aAndNotB);
And(a=notA, b=b, out=notAAndB);
Or(a=aAndNotB, b=notAAndB, out=out);
}