Update 'zadania/zadanie_4'

This commit is contained in:
Damian Kamiński 2022-02-22 18:30:13 +01:00
parent 32e24d9b1e
commit ead44fce7c

View File

@ -0,0 +1,41 @@
CHIP Or {
IN a, b;
OUT out;
PARTS:
Not(in=a, out=notAOut);
Not(in=b, out=notBOut);
Nand(a=notAOut, b=notBOut, out=out);
}
CHIP Xor {
IN a, b;
OUT out;
PARTS:
Not(in=b, out=NotB);
Not(in=a, out=NotA);
Nand(a=a, b=NotB, out=Nand1);
Nand(a=NotA, b=b, out=Nand2);
Nand(a=Nand1, b=Nand2, out=out);
}
CHIP Mux {
IN a, b, sel;
OUT out;
PARTS:
Not(in=sel, out=notSel);
And(a=a, b=notSel, out=And1);
And(a=b, b=notSel, out=And2);
Or(a=And1, b=And2, out=out);
}