Digital Logic: Adders

Binary Arithmetic is a basic operation that makes digital computations possible. It is one of the primary operations of the Arithmetic Logical Unit that is in every CPU.

Adding Review

Adding two numbers is so basic that most of us can do it by age 5. But that was a long time ago so here’s a quick refresher. Number systems have bases digits and numerals. The base of the number system is how many numbers a single digit can represent. A base 10 number system is the one that is most commonly used in the world, and the one that you were first exposed to. It runs through the numerals 0-9. Once you get past 9 then an additional digit place is used to represent a value greater than the maximum value of a single digit.

7 + 7 = ?

The answer to this simple problem is the value that is 5 greater than the maximum value that can be represented by the numerals 0-9, therefore we get a number with a 1 in the tens place to represent one more than is possible to represent in the ones place, and an additional 4 values higher than that. Therefore the answer is 14.

Hexadecimal

There is another system that is commonly used called Hexadecimal. In Hexadecimal numbers, each digit can have one of 16 values, therefore a number in decimal format can be represented with fewer numerals if we use hexadecimal format.

Dec 64 = ?

Each numeral in hex format can have one of the following values. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F]. Therefore the hex representation of the number 64 is 40. This can be confusing because it’s not immediately clear that 40 is a hexadecimal value, therefore it’s always a good idea to specify the numbering system that you are using. Because each hex digit can represent 16 values, the second digit place (what would be the ten’s place) represents multiples of 16. The decimal number of 64 is exactly 4 multiples of 16, the hex representation if 40.

Binary

Computers represent number in binary digits. This is a base 2 numbering system that can easily be implemented in electronic circuits. Because each of the binary digits can only represent two values, the binary numbers require more digits than their decimal counterparts.

Dec 11 = Bin 1011

Another way to think about binary numbers is a list of polynomial coefficients.

Gate Design

The structure of binary numbers allow us to use logic gates to represent operations. The first circuit we are going to look at is the half adder. The half adder takes two binary numerals, adds them together, and if the result is greater than the value that one binary digit can represent it tells us that we need to carry a value to the next place.

Half Adder Gate diagram
ABSumCarry
0000
0110
1010
1101
Half Adder Truth table

The full adder is an extension of the half adder circuit. The full adder takes in two binary digits to be added, as well as a value that might be carried over from an addition in a less-significant digit placement and outputs a single binary value as well as any carry values that need to be propagated further.

Full Adder
ABC_inSumC_out
00000
00110
01010
01101
10010
10101
11001
11111
Full Adder truth table

Circuit Design

The above gate diagrams were for single-bit adders. We can turn a single-bit adder into a multiple bit adder by chaining the carry out from one adder into the carry in for the adder that represents the next highest bit value.

2-bit Adder

Conclusion

Binary arithmetic is more than a computational tool; it is the foundation of modern digital technology. From simple additions in everyday devices to complex computations in advanced computing systems, binary operations facilitate rapid and efficient processing. Understanding the various number systems and how digital circuits handle arithmetic operations not only demystifies how devices operate but also highlights the elegance and efficiency of binary systems. As technology evolves, the principles of binary arithmetic continue to enable innovations across various fields, showcasing the enduring importance of this fundamental concept.