Physics — Logic: full adder
One-bit full adder built from two XOR, two AND and one OR gate.
Make it your own.
title "Full adder"
type gates
input A at (0,0)
input B at (0,2)
input Cin at (0,4)
gate XOR G1 at (3,0.5)
gate XOR G2 at (6,1.5)
gate AND G3 at (3,3)
gate AND G4 at (6,3.5)
gate OR G5 at (9,3.2)
output S at (9,1.5)
output Cout at (12,3.2)
wire A G1
wire B G1
wire G1 G2
wire Cin G2
wire G2 S
wire G1 G4
wire Cin G4
wire A G3
wire B G3
wire G4 G5
wire G3 G5
wire G5 Cout