Adding binary numbers together

Author: Roger Morrison
Date Of Creation: 1 September 2021
Update Date: 1 July 2024
Anonim
How To Add and Subtract Binary Numbers
Video: How To Add and Subtract Binary Numbers

Content

The binary number system works in the same way as the decimal number system with base 10 that we are used to, except that this is a system with base 2 that consists of only two digits, 1 and 0. The binary number system is the basis on which computers function. Essentially, binary code uses 1 and 0 to turn on or off certain processes. Binary numbers can be added together just like decimal numbers, and while the process may seem familiar, adapting to the binary system can be confusing. It is therefore useful to have a full understanding of how the place value system works in the binary number system before attempting to add binary numbers together.

To step

Part 1 of 3: Understanding the binary system

  1. Draw a place value chart with two rows and four columns. Label each column with the value of a city. The binary system is a base 2 number system, so instead of the units, tens, hundreds, and thousands of the decimal (base 10) system, you are dealing with units, pairs, fours, and eights. The units can be found on the far right of your table, and those of the eights in the far left column.
        • You can continue with your place value table. Each place value is determined by a power of 2. For example:
          20=first{ displaystyle 2 ^ {0} = { text {first}}}Write any binary number in the bottom row of the table. In the binary system, only the numbers 1{ displaystyle 1}Interpret the units. If the units have 0, then the value is 0. If there is 1, then the value is 1.
          • As an example, take the binary number 1101, where there is a 1 in the place of the units, so its value is 1. So the binary number 1 is equal to the decimal number 1.
        • Interpret the position of the pairs. If there is a 0 in the twos place, the value is 0. If there is 1 in the twos place, the value is 2.
          • If the binary number is 1101, there is a 0 in the pair's place, so the value is 0. So the binary number 01 equals the decimal number 1, because there are two zeros and a one: 0 + 1 = 1.
        • Interpret the place of the foursomes. If there is a 0 in the fours place, the value is 0. If there is a 1 in the fours place, the value is 4.
          • For example: If the binary number is 1101, then there is a 1 in the fours place, so the value is 4. So the binary number 101 is equal to the decimal number 5, because there is 1 four, 0 twos, and 1 one : 4 + 0 + 1 = 5.
        • Interpret the place of the eights. If there is a 0 in the eight place, the value is 0. If there is a 1 in the eight place, the value is 8.
          • For example: If the binary number is 1101, there is a 1 in the place of the eight digits, so the value is 8. So the binary number 1101 is then equal to the decimal number 13, because there are 1 eight, 1 four, 0 twos and 1 one: 8 + 4 + 0 + 1 = 13.

      Part 2 of 3: Adding binary numbers using the place value

      1. Set up the problem vertically and add the units together. Since you are only adding two digits, the possible sum becomes either 0, 1, or 2. If the sum is 0, then write a 0 as the answer for the units. If the sum is 1, write a 1 in that place. If the sum is 2, then write a 0 in response to the units place and bring a 1 to the pairs column.
        • For example, if we add 0111 and 1110, add 1 and 0 in the units column, so you put a 1 as the answer in that column.
      2. Add the numbers at the place of the pairs. The possible sum is either 0, 1, 2 or 3 (if you've memorized the units). If the sum is 0, then write a 0 in the answer at the pairs place. If the sum is 1, write a 1 in the answer in the pairs place. If the sum is 2, write a 0 in the answer for the pairs and remember a 1 for the foursomes. If the sum is 3, then write a 1 in the pairs place and a 1 in the fours place (3 pairs = 6 = 1 two and 1 four).
        • For example: If you want to add 0111 and 1110 together, for the twos column you add 1 two, plus 1 two = 2 twos = 4; so put a 0 in the from column of the twos, and remember a 1 for the column of fours.
      3. Add the numbers of the foursomes together. The possible sum is either 0, 1, 2 or 3 (if you have memorized the pairs). If the sum is 0, then write a 0 in the answer for the foursome. If the sum is 1, then write a 1 in the answer for the foursome. If the sum is 2, then write a 0 in the answer for the fours, and remember a 1 for the 8s. If the sum is 3, write a 1 for the foursomes and remember a 1 for the column with the eights (3 * 4 = 12 = 1 foursome and 1 eights).
        • For example, if you want to add 0111 and 1110, you would add 4 + 4 + 4 = 12 for the fours column, so put a 1 in the fours place in the answer and remember a 1 for the column with eight.
      4. Keep adding up each digit in its place value until you find the final answer. For the sake of simplicity, you can remember that 0 = 0, 1 = 1, 2 = 10 and 3 = 11.
        • For example: If you add 0111 to 1110, you add the values ​​for the column of eight (here 1 + 1, with a place value of 8 each), because you have memorized 1 of the column of fours. If the total is 2, put a 0 in the eights column and remember 1 for the sixteenths column. Since there are no other digits in the sixteen column, 1 is the last digit of the final answer. So 0111 + 1110 = 10101.

      Part 3 of 3: Adding multiple binary numbers by pairs of 1

      1. Write the numbers one below the other. Circle pairs of 1 (numbers) in the units column. Remember that the units for binary numbers are on the far right.
        • For example: When adding as 1010 + 1111 + 1011 + 1110, you circle 1 pair with ones.
      2. Interpret the column. For each pair of ones, memorize a 1 for the pairs column. If there is only one 1, or if there is a 1 left after circling pairs of ones, write a 1 in place of the units in the answer. If no 1 remains, put a 0 in place of the units in the answer.
        • For example: Since you circled one pair with ones, remember a 1 for the pairs column and put a 0 in the units column of the answer.
      3. Circle pairs of ones in the pairs column. Don't forget to add the numbers you memorized from the units column.
        • For example: If you are working out 1010 + 1111 + 1011 + 1110, you must circle 2 pairs of 1, leaving 1.
      4. Interpret the pairs column. For each pair of ones, memorize a 1 for the fours column and put a 0 in the answer for the pairs column. If there is only one 1, or if there is a 1 left after circling pairs of ones, put a 1 in the pairs column. If no 1 remains, put a 0 in the units column of the answer.
        • For example: Since you circled 2 pairs of ones and left one 1, memorize a 1 twice for the fours column and place a 1 in the pairs column of the answer.
      5. Circle the pairs of ones in the foursome column. Don't forget to include any numbers you memorized from the pairs column.
        • For example: If you are working out 1010 + 1111 + 1011 + 1110, you circle 2 pairs of ones, since you memorized a 1 twice from the pairs column.
      6. Interpret the fours column. Memorize a 1 for the 8s column for each pair of ones. Don't forget to put a 1 in the fours place if there is a 1 left, or a 0 in that place if no 1 remains.
        • For example: Since you circled 2 pairs of 1s (without any left), memorize a 1 twice for the 8s column, and put a 0 in the answer in the fours column.
      7. Continue to circle pairs of ones for each place value. Remember to remember a 1 for the next column for each circled pair, put a 1 in the answer if there is a 1 remaining, and a 0 in the answer if only zeros remain in the column.
        • For example: If you are working out 1010 + 1111 + 1011 + 1110, circle 3 pairs with one in the eights column, since you memorized 1 twice from the fours column. So you put a 0 in the place of the eight in your answer and you remember three ones for the column with sixteen. In the sixteen column, you have one pair of 1s with one remaining 1, so you place a 1 in the sixteen place of your answer, and a 1 in the thirty-two column of your answer. So 1010 + 1111 + 1011 + 1110 = 110010.
      8. Check your answer. There are a number of binary calculators online that you can use to calculate the sum of binary numbers.