// 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: // Put your code here: Nand(a=a, b=a, out=w1); Nand(a=b, b=b, out=w2); Nand(a=a, b=w2, out=w3); Nand(a=b, b=w1, out=w4); Nand(a=w3, b=w4, out=out); }