Last active
August 29, 2015 14:19
-
-
Save deltam/640dd4965246c99f6bd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// nand2tetris 「コンピュータシステムの理論と実装」 | |
// 01のNandだけで論理素子を作る | |
CHIP And { | |
IN a, b; | |
OUT out; | |
PARTS: | |
// Put your code here: | |
Nand (a=a, b=b, out=c0); | |
Nand (a=c0,b=c0, out=out); | |
} | |
CHIP Not { | |
IN in; | |
OUT out; | |
PARTS: | |
// Put your code here: | |
Nand (a=in, b=in, out=out); | |
} | |
CHIP Or { | |
IN a, b; | |
OUT out; | |
PARTS: | |
// Put your code here: | |
Nand (a=a, b=a, out=nota); | |
Nand (a=b, b=b, out=notb); | |
Nand (a=nota, b=notb, out=out); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment