Boy in sailor suit with blackboard with math
Prerequisites[edit]
Introduction[edit]
One of the most fundamental operations performed by computers, aside from the logical operations that we've already discussed, is the arithmetic operation of addition.
HalfAdder[edit]
Let's consider what's required to add two, singlebit binary integers. We'll need one bit to represent the sum of the integers, and another to handle the carry. Representing this in the form of a truth table yields:
Inputs

Outputs

$a$

$b$

$C_{out}$

$S$

0 
0 
0 
0

0 
1 
0 
1

1 
0 
0 
1

1 
1 
1 
0

This is formally termed a halfadder, a logic circuit capable of adding two bits.

Observe, Ponder, and Journal Section 1 
 What truth table do you recognize that produces the output of the Carry column?
 What truth table do you recognize that produces the output of the Sum column?

FullAdder[edit]
In order to add two singlebit binary integers PLUS a carry, we need an adder capable of adding three singlebit binary numbers. Again, we'll need one bit to represent the sum of the integers, and another to handle the carry. Representing this in the form of a truth table yields:
Inputs

Outputs

$c_{in}$

$a$

$b$

$C_{out}$

$S$

0 
0 
0 
0 
0

0 
0 
1 
0 
1

0 
1 
0 
0 
1

0 
1 
1 
1 
0

1 
0 
0 
0 
1

1 
0 
1 
1 
0

1 
1 
0 
1 
0

1 
1 
1 
1 
1

This is formally termed a fulladder, a logic circuit capable of adding three bits.

Observe, Ponder, and Journal Section 2 
 What do you notice about the relationship between the firsthalf (top four rows) of the fulladder as compared to all of the rows of the halfadder?
 Why is this true?

Ripple Carry Adder[edit]
Fourbit Ripple Carry Adder
We've learned that a halfadder can add two bits and fulladder can add three bits. How can we add a multibit number such as a 16bit word? By cascading four adders such that the carry output of the prior adder feeds the carry input of the subsequent adder we can add two fourbit numbers. This concept can be easily extended to an arbitrary number of bits.

Observe, Ponder, and Journal Section 3 
 Why does the least significant bit position use a halfadder rather than a fulladder?
 Assume that proper inputs are applied for all bits in numbers A and B. Will the correct output from S be available instantaneously? If not, why not?
 Assume that we have a standard (nonscientific calculator) capable of adding two 16bit words. Two numbers, A and B, are added together. After the addition, it is noted that $C_{15}$ is high. What can we infer? What is this state commonly called?

Key Concepts[edit]

Key Concepts 
 A halfadder is a logic circuit capable of adding two bits and output a carry bit and a sum bit.
 A fulladder is a logic circuit capable of adding three bits and output a carry bit and a sum bit.
 A ripplecarryadder is a logic circuit constructed of adders, cascaded in such a manner that the carry output of each adder feeds the carry input of the subsequent adder. Using this method we are able to add an arbitrary number of bits.

Exercises[edit]

Exercises 
 J1017 Create a journal and answer all questions in this experience. Be sure to:
 edit your journal using emacs within your ~/Journals directory
 properly name your journal as J1017.txt
 include all sections of the journal, properly formatted
 push your changes to GitHub
 properly tag your journal as J1017.Final
 push your tag to GitHub
 Construct your work using Falstad's Editor
 Begin each exercises with a Blank Circuit
 Label each circuit diagram (using Text) with:
 Your name
 The date
 The name of the logic gate (e.g. "NOT")
 Each output (e.g. "sum", "carry out")
 Save each circuit using the
Save As... option from the File submenu and then click on the link presented
 Each file contains your work for the exercise. Create a new subdirectory, J1017, in your Journals directory. Upload each file to the J1017 directory via SFTP. Be sure to push the files to your GitHub repository.
 You may use any of the following logic gates in your implementation: AND, OR, NOT, XOR, NAND, and NOR
 Construct a halfadder
 Construct a fulladder
 M101731 Complete Merlin Mission Manager Mission M101731

References[edit]
 Adder (Wikipedia)
 Schocken, Simon and Nisan, Noam. The Elements of Computing Systems. MIT Press, 2005.