Skip to content

Instantly share code, notes, and snippets.

@deltam
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deltam/640dd4965246c99f6bd2 to your computer and use it in GitHub Desktop.
Save deltam/640dd4965246c99f6bd2 to your computer and use it in GitHub Desktop.
// 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