Skip to content
Digital logic (gates / K-map / truth table) templates

Physics — Logic: half adder

Sum from XOR and carry from AND of two bits.

Template previewDigital logic (gates / K-map / truth table)
Half adderABG1G2SumCarryEvaluated: 2 inputs, 2 outputs, 4 rows.Sum = A ⊕ BCarry = A · B

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