Difference between revisions of "Alternative Base Addition"
Jeff-strong (talk | contribs) m (Editorial review and minor corrections) |
|||
Line 21: | Line 21: | ||
There are a few simple rules when adding non-negative, whole numbers: | There are a few simple rules when adding non-negative, whole numbers: | ||
# Align the addends vertically, flush right. | # 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. | # 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 affect the value.) | ||
# Starting from the right-most column, add the two digits of the addend ''and the carry''. | # 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. | # Repeat the process with the column to the left until reaching the final column. | ||
Line 58: | Line 58: | ||
|style="width: 70%;" | To add <math>3_{10} + 8_{10}</math> we: | |style="width: 70%;" | To add <math>3_{10} + 8_{10}</math> we: | ||
* Align the digits vertically | * Align the digits vertically | ||
* Add the right-most column, containing a 3 and an 8, yielding 11. | * Add the right-most column, containing a 3 and an 8, yielding 11. Because this is greater than the quantity that can be represented by a single digit, we carry. | ||
* We move to the left, where the next column contains only a lone value, the carry. | * We move to the left, where the next column contains only a lone value, the carry. We sum this with the addend digits in the same column, yielding 1. | ||
* Done | * Done | ||
|style="width: 30%;" | | |style="width: 30%;" | | ||
Line 86: | Line 86: | ||
* Align the digits vertically | * Align the digits vertically | ||
* Add the right-most column, containing 4 and 7, yielding 11. Because this is greater than the quantity that can be represented by a single digit, we carry. | * Add the right-most column, containing 4 and 7, yielding 11. Because this is greater than the quantity that can be represented by a single digit, we carry. | ||
* We move to the left, where the next column contains the carry and a 9, yielding 10. | * We move to the left, where the next column contains the carry and a 9, yielding 10. Because this is greater than the quantity that can be represented by a single digit, we carry. | ||
* We move to the left, where the next column contains the carry, a 1, and a 3, yielding 5. | * We move to the left, where the next column contains the carry, a 1, and a 3, yielding 5. Because this is less than the quantity that can be represented by a single digit, we have no carry. | ||
* Done | * Done | ||
|style="width: 30%;" | | |style="width: 30%;" | | ||
Line 118: | Line 118: | ||
== Addition (Octal System) == | == Addition (Octal System) == | ||
There's no need for any additional rules for the octal system. | 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: | ||
[[File:Octal Number Line.png|link=|Octal Number Line]] | [[File:Octal Number Line.png|link=|Octal Number Line]] | ||
Line 134: | Line 134: | ||
* Align the digits vertically | * Align the digits vertically | ||
* Add the right-most column, containing 4 and 7, yielding 13. Because this is greater than the quantity that can be represented by a single digit, we carry. | * Add the right-most column, containing 4 and 7, yielding 13. Because this is greater than the quantity that can be represented by a single digit, we carry. | ||
* We move to the left, where the next column contains the carry and a 6, yielding 7. | * We move to the left, where the next column contains the carry and a 6, yielding 7. Because this is less than the quantity that can be represented by a single digit, we have no carry. | ||
* We move to the left, where the next column contains a 1, and a 3, yielding 4. | * We move to the left, where the next column contains a 1, and a 3, yielding 4. Because this is less than the quantity that can be represented by a single digit, we have no carry. | ||
* Done | * Done | ||
|style="width: 30%;" | | |style="width: 30%;" | | ||
Line 166: | Line 166: | ||
== Addition (Hexadecimal System) == | == Addition (Hexadecimal System) == | ||
Let's review the hexadecimal number line before proceeding to an example. | Let's review the hexadecimal number line before proceeding to an example. How would we add <math>9_{16} + 7_{16}</math>? | ||
[[File:Hexadecimal Number Line 9 + 7.png|link=|Hexadecimal Number Line 9 + 7]] | [[File:Hexadecimal Number Line 9 + 7.png|link=|Hexadecimal Number Line 9 + 7]] | ||
Line 199: | Line 199: | ||
* Align the digits vertically | * Align the digits vertically | ||
* Add the right-most column, containing 9 and 7, yielding 10. Because this is greater than the quantity that can be represented by a single digit, we carry. | * Add the right-most column, containing 9 and 7, yielding 10. Because this is greater than the quantity that can be represented by a single digit, we carry. | ||
* We move to the left, where the next column contains the carry and an A and B, yielding 16. | * We move to the left, where the next column contains the carry and an A and B, yielding 16. Because this is greater than the quantity that can be represented by a single digit, we carry. | ||
* We move to the left, where the next column contains the carry, a 7, and a 6, yielding 14 (represented by "E"). | * We move to the left, where the next column contains the carry, a 7, and a 6, yielding 14 (represented by "E"). Because this is less than the quantity that can be represented by a single digit, we have no carry. | ||
* Done | * Done | ||
|style="width: 30%;" | | |style="width: 30%;" | | ||
Line 237: | Line 237: | ||
* Align the digits vertically | * 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. | * 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. | * 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. | * 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. | * 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. | * 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. | * 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. | * 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. | * 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 | * Done | ||
|style="width: 30%;" | | |style="width: 30%;" | | ||
Line 314: | Line 314: | ||
** Align the addends vertically, flush right | ** Align the addends vertically, flush right | ||
** 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 | ** 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 | ||
** Starting from the right-most column, add the two digits of the addend and the carry. | ** Starting from the right-most column, add the two digits of the addend and the carry. 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 | ** Repeat the process with the column to the left until reaching the final column | ||
}} | }} |
Latest revision as of 16:24, 7 September 2022
Curriculum[edit]
Coder Merlin™ Computer Science Curriculum Data | |
Unit: Numbers Experience Name: Alternative Base Addition (W1012) Next Experience: () Knowledge and skills:
Topic areas: Positional notation Classroom time (average): 60 minutes Study time (average): 180 minutes Successful completion requires knowledge: understand positional notation; understand how numbers specified in positional notation are added Successful completion requires skills: ability to use positional notation to represent numbers in the binary, octal, decimal, and hexadecimal systems; ability to convert between representations of numbers in the binary, octal, decimal, and hexadecimal systems; ability to count by one using numbers in the binary, octal, decimal, and hexadecimal systems; ability to add together numbers in the binary, octal, decimal, and hexadecimal systems |
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 affect 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:
|
|
- Describe the general process for executing addition, regardless of base.
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:
|
|
- What special factors need to be considered when executing addition with octal numbers?
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:
|
|
- What special factors need to be considered when executing addition with hexadecimal numbers?
Addition (Binary System)[edit]
Let's jump right in to an example:
[edit]
To add we:
|
|
- What special factors need to be considered when executing addition with binary numbers?
Key Concepts[edit]
- Addition is a basic (and critical) operation
- Addition is commutative
- Addition is associative
- The identity element for addition, also termed the additive identity, is zero
- The operator for addition is the "+" sign
- The operands for addition are called addends
- When adding non-negative, whole numbers:
- Align the addends vertically, flush right
- 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
- Starting from the right-most column, add the two digits of the addend and the carry. 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
Exercises[edit]
- J1012 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 J1012.txt
- include all sections of the journal, properly formatted
- push your changes to GitHub
- properly tag your journal as J1012.Final
- push your tag to GitHub
- M1012-10 Complete Merlin Mission Manager Mission M1012-10.
References[edit]
- Addition (Wikipedia)
Experience Metadata
Experience ID | W1012 |
---|---|
Next experience ID | |
Unit | Numbers |
Knowledge and skills | §10.311 §10.312 §10.313 |
Topic areas | Positional notation |
Classroom time | 60 minutes |
Study time | 3 hours180 minutes <br /> |
Acquired knowledge | understand positional notation understand how numbers specified in positional notation are added |
Acquired skill | ability to use positional notation to represent numbers in the binary, octal, decimal, and hexadecimal systems ability to convert between representations of numbers in the binary, octal, decimal, and hexadecimal systems ability to count by one using numbers in the binary, octal, decimal, and hexadecimal systems ability to add together numbers in the binary, octal, decimal, and hexadecimal systems |
Additional categories |