24 lines
480 B
Plaintext
24 lines
480 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/custom/Xnor.hdl
|
|
|
|
/**
|
|
* Or gate:
|
|
* out = (a == b)
|
|
* 0 otherwise
|
|
*/
|
|
|
|
CHIP Xnor {
|
|
IN a, b;
|
|
OUT out;
|
|
|
|
PARTS:
|
|
// Put your code here:
|
|
Nand(a=a, b=b, out=outw);
|
|
Nand(a=a, b=outw, out=outx);
|
|
Nand(a=b, b=outw, out=outy);
|
|
Nand(a=outx, b=outy, out=outz);
|
|
Nand(a=outz, b=outz, out=out);
|
|
}
|