Difference between revisions of "Alternative Base Addition"
Line 214: | Line 214: | ||
| 6 | | 6 | ||
| 0 | | 0 | ||
|} | |||
|} | |||
== Addition (Binary System) == | |||
Let's jump right in to an example: | |||
=== <math>0011\;\;1010_{2} + 0001\;\;0111_{2}</math> === | |||
{| | |||
|style="width: 70%;" | To add <math>0011\;\;1010_{2} + 0001\;\;0111_{2}</math> we: | |||
* Align the digits vertically | |||
* Add the right-most column, containing 0 and 1, yielding 1. Because this is less than the quantity that can be represented by a single digit, we have no carry. | |||
* We move to the left, position 1, where we have no carry, a 1 and a 1, yielding 10. Because this is greater than the quantity that can be represented by a single digit, we carry. | |||
* We move to the left, position 2, where we have a carry, a 0 and a 1, yielding 10. Because this is greater than the quantity that can be represented by a single digit, we carry. | |||
* We move to the left, position 3, where we have a carry, a 1 and a 0, yielding 10. Because this is greater than the quantity that can be represented by a single digit, we carry. | |||
* We move to the left, position 4, where we have a carry, a 1 and a 1, yielding 11. Because this is greater than the quantity that can be represented by a single digit, we carry. | |||
* We move to the left, position 5, where we have a carry, a 1 and a 0, yielding 10. Because this is greater than the quantity that can be represented by a single digit, we carry. | |||
* We move to the left, position 6, where we have a carry, a 0 and a 0, yielding 1. Because this is less than the quantity that can be represented by a single digit, we have no carry. | |||
* We move to the left to the final column, where we have no carry, a 0 and a 0, yielding 0. Because this is less than the quantity that can be represented by a single digit, we have no carry. | |||
* Done | |||
|style="width: 30%;" | | |||
{| class = "wikitable" | |||
| ''position'' | |||
| 7 | |||
| 6 | |||
| 5 | |||
| 4 | |||
| 3 | |||
| 2 | |||
| 1 | |||
| 0 | |||
|- | |||
| ''carry'' | |||
| 0 | |||
| 1 | |||
| 1 | |||
| 1 | |||
| 1 | |||
| 1 | |||
| 0 | |||
| ''0'' | |||
|- | |||
| ''addend'' | |||
| 0 | |||
| 0 | |||
| 1 | |||
| 1 | |||
| 1 | |||
| 0 | |||
| 1 | |||
| 0 | |||
|- | |||
| ''addend'' | |||
| 0 | |||
| 0 | |||
| 0 | |||
| 1 | |||
| 0 | |||
| 1 | |||
| 1 | |||
| 1 | |||
|- | |||
| ''sum'' | |||
| 0 | |||
| 1 | |||
| 0 | |||
| 1 | |||
| 0 | |||
| 0 | |||
| 0 | |||
| 1 | |||
|} | |} | ||
|} | |} |
Revision as of 11:59, 19 July 2019
Prerequisites[edit]
Addition (Decimal System)[edit]
Addition is a basic (and critical) operation. Important properties of addition include:
- Addition is commutative, meaning that the order of the operands does not matter
- Addition is associative, meaning that when we're adding more than two operands, the order that we perform the addition does not matter
- The identity element for addition, also termed the additive identity, is zero
- The operator for addition is the plus () sign
- The operands for addition are called addends
Let's review how we perform addition in the number system with which we are most familiar, the decimal system.
There are a few simple rules when adding non-negative, whole numbers:
- Align the addends vertically, flush right. (This step ensures that the position multiplier is the same for both addends in each column.)
- If any addend has fewer digits than the addend with the maximum digits, we may place a zero in columns to the left of the existing addend. (Leading zeroes don't impact the value.)
- Starting from the right-most column, add the two digits of the addend and the carry. Note that this means that we are adding three operands in each column. If the sum exceeds the quantity that can be represented with a single digit, carry a one to the column to the left.
- Repeat the process with the column to the left until reaching the final column.
Let's look at a few examples:
[edit]
To add we:
|
|
[edit]
To add we:
|
|
[edit]
To add we:
|
|
Addition (Octal System)[edit]
There's no need for any additional rules for the octal system. In fact, for all systems, the rules are exactly the same! But let's review the octal number line before proceeding to an example:
How would we add ?
Be sure that you fully understand the above diagram before proceeding.
[edit]
To add we:
|
|
Addition (Hexadecimal System)[edit]
Let's review the hexadecimal number line before proceeding to an example. How would we add ?
Remember that in number systems with bases greater than 10, by convention, we use letters in place of digits.
Digit | Value |
---|---|
A | 10 |
B | 11 |
C | 12 |
D | 13 |
E | 14 |
F | 15 |
[edit]
To add we:
|
|
Addition (Binary System)[edit]
Let's jump right in to an example:
[edit]
To add we:
|
|
Key Concepts[edit]
Exercises[edit]
References[edit]
- Addition (Wikipedia)