/** * Exclusive-or gate: * out = not (a == b) */ CHIP Xor { IN a, b; OUT out; PARTS: Nand(a=a,b=b,out=w1); Nand(a=a,b=w1,out=w2); Nand(a=w1,b=b,out=w3); Nand(a=w2,b=w3,out=out); }