mirror of
https://github.com/usatiuk/nand2tetris.git
synced 2025-10-28 16:17:48 +01:00
19 lines
363 B
Plaintext
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);
|
|
} |