Lecture 5

Example: Build a device to add two numbers together - An adder:
This device will add together A and B to give S. C4 is the carry from the top bit and indicates that the result is larger than 15. C0 is the carry input; by connecting C4 from one device to C0 from another an 8 bit adder can be made.

In order to add two bits together use the following truth table

s is the sum and c is the carry.

s=a XOR b, c=a AND b

In order to add three bits together use the following truth table:

s=(a XOR b) XOR c, c=(a AND b) OR (a AND c) OR (b AND c).

Logic Diagram: