Logic Lab
Adders
Half and full adders chained into a binary parallel (ripple-carry) adder, with the gates inside each cell.
4-bit ripple-carry adder
168421carry
0
0
0
0
ABsum0
0
0
0
0
0 + 0 = 0
Built from full-adder cells
Inside a full-adder cell, from logic gates
Two half adders (an XOR and an AND each) and an OR gate. The carry-in of this cell is the carry-out of the cell before it, so it cannot be set by hand here.
Each column is a full adder: sum = A ⊕ B ⊕ carry-in, and carry-out = A·B + carry-in·(A ⊕ B). The carry ripples from right to left, so wider adders have to wait longer for it.