A computer adds two numbers one bit at a time, the way you add digits by hand, carrying when a column overflows. Each column is a full adder built from logic gates: the sum bit is an exclusive or, and the carry comes from AND and OR.