Physics — Logic: half adder
Sum from XOR and carry from AND of two bits.
Make it your own.
title "Half adder"
type gates
input A at (0,0)
input B at (0,2)
gate XOR G1 at (3,0.5)
gate AND G2 at (3,2)
output Sum at (6,0.5)
output Carry at (6,2)
wire A G1
wire B G1
wire A G2
wire B G2
wire G1 Sum
wire G2 Carry