And

Nand(a=a,b=b,out=o1);
Nand(a=o1,b=o1,out=out);

And16

And(a=a[0],b=b[0],out=out[0]);
// ...
And(a=a[15],b=b[15],out=out[15]);

DMux

Not(in=sel,out=notsel);
And(a=in,b=notsel,out=a);
And(a=in,b=sel,out=b);

DMux4Way

Not(in=sel[0],out=notsel0);
Not(in=sel[1],out=notsel1);

And(a=notsel0,b=notsel1,out=s1);
And(a=notsel0,b=sel[1],out=s3);
And(a=sel[0],b=notsel1,out=s2);
And(a=sel[0],b=sel[1],out=s4);

And(a=s1,b=in,out=a);
And(a=s2,b=in,out=b);
And(a=s3,b=in,out=c);
And(a=s4,b=in,out=d);

Mux

Not(in=sel,out=notsel);
And(a=a,b=notsel,out=o1);
And(a=b,b=sel,out=o2);
Or(a=o1,b=o2,out=out);

Not

Nand(a=in,b=in,out=out);

Not16

Nand(a=in[0],b=in[0],out=out[0]);
// ...
Nand(a=in[15],b=in[15],out=out[15]);

Or

Nand(a=a,b=a,out=o1);
Nand(a=b,b=b,out=o2);
Nand(a=o1,b=o2,out=out);

Or16

Or(a=a[0],b=b[0],out=out[0]);
// ...
Or(a=a[15],b=b[15],out=out[15]);

Or16Way

Or8Way(in=in[0..7],out=or1);
Or8Way(in=in[8..15],out=or2);
Or(a=or1,b=or2,out=out);

Xor

Not(in=a,out=nota);
Not(in=b,out=notb);
And(a=a,b=notb,out=o1);
And(a=b,b=nota,out=o2);
Or(a=o1,b=o2,out=out);