Difference between revisions of "Binary Adders"
Line 8: | Line 8: | ||
* [[W1016 Logic Composition]] | * [[W1016 Logic Composition]] | ||
== Introduction == | == Introduction == | ||
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. Let's consider what's required to add two, single-bit binary integers. We'll need one bit to represent the '''sum''' | 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. | ||
== Half-Adder == | |||
Let's consider what's required to add ''two'', single-bit 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: | |||
{| class="wikitable" style="text-align: center;" | {| class="wikitable" style="text-align: center;" | ||
Line 14: | Line 17: | ||
!colspan="2"| Outputs | !colspan="2"| Outputs | ||
|- | |- | ||
! <math> | ! <math>a</math> | ||
! <math> | ! <math>b</math> | ||
! <math>C</math> | ! <math>C</math> | ||
! <math>S</math> | ! <math>S</math> | ||
Line 34: | Line 37: | ||
# What truth table do you recognize that produces the output of the '''S'''um column? | # What truth table do you recognize that produces the output of the '''S'''um column? | ||
}} | }} | ||
== Full-Adder == | |||
In order to add two single-bit binary integers PLUS a carry, we need an adder capable of adding ''three'' single-bit 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: | |||
{| class="wikitable" style="text-align: center;" | |||
!colspan="3"| Inputs | |||
!colspan="2"| Outputs | |||
|- | |||
! <math>a</math> | |||
! <math>b</math> | |||
! <math>c</math> | |||
! <math>C</math> | |||
! <math>S</math> | |||
|- | |||
| 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 '''full-adder''', a logic circuit capable of adding three bits. | |||
== Topic Headers == | == Topic Headers == |
Revision as of 15:33, 29 July 2019
Prerequisites[edit]
- W1011 Number Systems
- W1012 Alternative Base Addition
- W1013 Boolean Algebra
- W1014 Logic Gates
- W1015 Bitwise Operations
- W1016 Logic Composition
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.
Half-Adder[edit]
Let's consider what's required to add two, single-bit 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 | ||
---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 0 | 1 |
1 | 0 | 0 | 1 |
1 | 1 | 1 | 0 |
This is formally termed a half-adder, a logic circuit capable of adding two bits.
- 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?
Full-Adder[edit]
In order to add two single-bit binary integers PLUS a carry, we need an adder capable of adding three single-bit 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 | |||
---|---|---|---|---|
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 full-adder, a logic circuit capable of adding three bits.