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

Physics — Logic: half subtractor

Difference = A XOR B, borrow = (NOT A) AND B.

Template previewDigital logic (gates / K-map / truth table)
Half subtractorABG1G2G3DBoutEvaluated: 2 inputs, 2 outputs, 4 rows.D = A ⊕ BBout = ¬A · B

Make it your own.

title "Half subtractor"
type gates
input A at (0,0)
input B at (0,2)
gate XOR G1 at (3,0.5)
gate NOT G2 at (3,3)
gate AND G3 at (6,2.5)
output D at (6,0.5)
output Bout at (9,2.5)
wire A G1
wire B G1
wire A G2
wire G2 G3
wire B G3
wire G1 D
wire G3 Bout