Files
nand2tetris/projects/01/Xor.hdl
2021-04-21 17:01:42 +03:00

19 lines
363 B
Plaintext

// 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:
Nand(a=a, b=b, out=aisb);
Or(a=a, b=b, out=aorb);
And(a=aisb, b=aorb, out=out);
}