nand2tetris/projects/custom/Xnor.hdl

24 lines
480 B
Plaintext
Raw Permalink Normal View History

2021-12-05 04:03:35 +00:00
// 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);
}