The rules of adding is as follows (in English, sort of):
This is easy for a person to understand, but it does not help us understand how a (binary) processor performs the operations. Let us define a function C(x,y) that returns the carry (1 or 0) to the next digit, given that we are adding x and y (both are either 0 or 1). We also define a function R(x,y) that returns the result (1 or 0) of adding x and y.
Using this notation, we can then define:
Can we implement this in “logic” gates? The most commonly known logic gates are “and” (conjunction) and “or” (disjunction). We already know these constructs as logical operators in C/C++ and other high level programming languages.