Computer engineering · also Electrical engineeringLevel 2 · Builder
Binary arithmetic and adders
Binary numbers are added column by column, just like decimal, except that 1 plus 1 makes 10: write 0 and carry 1. A half adder does this for one column with two gates, an XOR for the sum and an AND for the carry. A full adder also accepts a carry in from the column to its right. Chaining full adders gives a ripple-carry adder, where each carry must settle before the next column is certain. A register has a fixed number of bits, so a result too big for it overflows. Two's complement stores negative numbers so that the same adder circuit handles subtraction as well.
Why it mattersEvery position update in a robot's controller, from wheel encoder counts to distance travelled, passes through an adder inside its processor.