Create a gist now

Instantly share code, notes, and snippets.

@deltam /NandOnly.hdl
Last active Aug 29, 2015

// 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