Init nand2tetris
This commit is contained in:
21
projects/02/Xor.hdl
Normal file
21
projects/02/Xor.hdl
Normal file
@@ -0,0 +1,21 @@
|
||||
// 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/Xor.hdl
|
||||
|
||||
/**
|
||||
* Exclusive-or gate:
|
||||
* out = not (a == b)
|
||||
*/
|
||||
|
||||
CHIP Xor {
|
||||
IN a, b;
|
||||
OUT out;
|
||||
|
||||
PARTS:
|
||||
Not(in=a, out=nota);
|
||||
Not(in=b, out=notb);
|
||||
Nand(a=nota, b=b, out=nandout1);
|
||||
Nand(a=a, b=notb, out=nandout2);
|
||||
Nand(a=nandout1, b=nandout2, out=out);
|
||||
}
|
||||
Reference in New Issue
Block a user