Physics — XOR from NAND Gates
The classic four-NAND exclusive-OR.
Make it your own.
title "XOR from NAND gates"
type gates
input A at (0,0)
input B at (0,4)
gate NAND G1 at (3,2)
gate NAND G2 at (6,0)
gate NAND G3 at (6,4)
gate NAND G4 at (9,2)
output Y at (12,2)
wire A G1
wire B G1
wire A G2
wire G1 G2
wire G1 G3
wire B G3
wire G2 G4
wire G3 G4
wire G4 Y