Initial Commit with everything done

This commit is contained in:
2021-04-13 00:07:23 +03:00
commit 20cf599d89
33 changed files with 1019 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/01/Mux.hdl
/**
* Multiplexor:
* out = a if sel == 0
* b otherwise
*/
CHIP Mux {
IN a, b, sel;
OUT out;
PARTS:
Not(in=a,out=negA);
Not(in=b,out=negB);
Not(in=sel,out=negSel);
And(a=a,b=b,out=out1);
And(a=a,b=negSel,out=out2);
And(a=b,b=sel,out=out3);
Or(a=out1,b=out2,out=xOut);
Or(a=xOut,b=out3,out=out);
}