How to add binary numbers

Author: Bobbie Johnson
Date Of Creation: 8 April 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 is similar to the decimal system we are used to, except that instead of ten it uses base 2 and only two digits, 1 and 0. The binary system is at the heart of computers. Binary codes use 1 and 0 to enable or disable certain processes. Like decimal numbers, binary numbers can be added, and while it's no big deal, adding them can seem daunting at first. Before proceeding with the addition of binary numbers, it is necessary to properly understand the concept of a numeric digit.

Steps

Part 1 of 3: Binary System

  1. 1 Draw a table of bit values ​​with two rows and four columns. Binary uses base 2, so instead of ones, tens, hundreds, and thousands in decimal (base 10), binary values ​​are ones, two, four, and eight. The ones will be located in the rightmost column of the table, and eights - in the far left.
    • You can continue the table of bit values ​​further. Each subsequent digit is the next power of 2. For example:
      20=units rank{ displaystyle 2 ^ {0} = { text {units place}}}
      21=twos rank{ displaystyle 2 ^ {1} = { text {twos place}}}
      22=rank of fours{ displaystyle 2 ^ {2} = { text {place of fours}}}
      23=rank of eights{ displaystyle 2 ^ {3} = { text {eights place}}}
      24=rank sixteen{ displaystyle 2 ^ {4} = { text {sixteen place}}}
      25=rank thirty two{ displaystyle 2 ^ {5} = { text {thirty-two place}}}
  2. 2 Write down any binary number in the bottom line of the table. In the binary system, only 1{ displaystyle 1} and 0{ displaystyle 0}.
    • For example, you can write 1 for eights, 1 for fours, 0 for twos, and 1 for ones, resulting in the following binary number: 1101.
  3. 3 Consider the units category. If this position is 0, the bit value is 0. If it is 1, the value is 1.
    • For example, binary 1101 has 1 in the ones place, so the bit value is 1. So binary 1 is equivalent to decimal 1.
  4. 4 Consider the twos category. If the bit is 0, the bit value is 0. If the bit is 1, the bit value is 2.
    • For example, binary 1101 has 0 in the twos place, so the bit value is 0. So binary 01 is equivalent to decimal 1, because the twos place is 0, and the ones place is 1: 0 + 1 = 1.
  5. 5 Consider the category of fours. If the bit is 0, the bit value is 0. If the bit of fours is 1, the bit value is 4.
    • For example, binary 1101 has 1 in the fours place, so the bit value is 4. Thus, the binary number 101 is equivalent to decimal 5 because it has 1 in the fours place, 0 in the twos and 1 in the ones place: 4 + 0 + 1 = 5.
  6. 6 Consider the eights rank. If the bit is 0, the bit value is 0. If the bit of eights is 1, the bit value is 8.
    • For example, binary 1101 has 1 in the eights place, so the bit value is 8. Thus, binary 1101 is equivalent to decimal 13 because it has 1 in the eights place, 1 in the fours place, 0 in the twos place and 1 in the ones place. : 8 + 4 + 0 + 1 = 13.

Part 2 of 3: Adding Binary Numbers Using Bit Values

  1. 1 Write down the numbers in a column and add the corresponding numbers. Since two numbers are added, the sum of the individual digits can be 0, 1, or 2. If the sum is 0, write at the bottom of the corresponding column 0. If the sum is 1, write down 1. If the sum is 2, write at the bottom of the column 0 and transfer 1 to the adjacent column. column of twos.
    • For example, when adding binary numbers 0111 and 1110 in the column of ones, 1 and 0 add up to 1, so you should write 1 at the bottom of this column.
  2. 2 Add the numbers in a column of twos. When added, it can be 0, 1, 2, or 3 (if you moved 1 from the column of ones). If the sum is 0, write 0 under the line in the twos place. If the total is 1, write down at the bottom of column 1. If the total is 2, write 0 under the line and transfer 1 to the column of fours. If the sum is 3, write 1 at the bottom and transfer 1 to the column of fours (3 twos = 6 = 1 two and 1 four).
    • For example, when adding the binary numbers 0111 and 1110, two ones in a column of twos give 2 (two twos, that is, one four), so write 0 under the bar and transfer 1 to a column of fours.
  3. 3 Add the numbers in a column of fours. When you add it up, you can get 0, 1, 2, or 3 (if you carried 1 from the column of twos). If the sum is 0, write 0 under the bar in the fours place. If the total is 1, write at the bottom of column 1. If the total is 2, write 0 under the line and transfer 1 to the column of eights. If the total is 3, write 1 at the bottom and transfer 1 to the column of eights (3 fours = 12 = 1 four and 1 eight).
    • For example, when adding binary numbers 0111 and 1110, add three ones (taking into account the twos carried over from the column). As a result, we have 3 fours, that is, 12, so write 1 in the column of fours and transfer 1 to the column of eights.
  4. 4 Continue adding the numbers in each column of digits until you get the final result. For convenience, you can remember that 0 = 0, 1 = 1, 2 = 10, and 3 = 11.
    • For example, when adding binary numbers 0111 and 1110 in a column of eights, add two units (taking into account the fours transferred from the column). As a result, we get 2, write 0 in the column of eights and transfer 1 to the sixteen place. Since there are no numbers in column sixteen, we write under the line 1. Thus, 0111 + 1110 = 10101.

Part 3 of 3: Carrying Binary Addition

  1. 1 Write down the numbers in a column. Circle the pairs of ones (digits 1) in the ones place. Remember that the ones place is at the right edge.
    • For example, if you add 1010 + 1111 + 1011 + 1110, you should circle one pair of numbers 1.
  2. 2 Consider the units rank. For each pair of 1's, move 1 to the adjacent left column that corresponds to the 2's place. If there is only one number 1 in the one-digit column, or there is one extra unit left after the transfer of pairs, write under the line 1. If all the units were included in pairs or were not there at all, write 0 at the bottom of the column.
    • For example, since you have circled one pair of numbers 1, you should move 1 to the column of 2s, and write 0 under the line in the 1s place.
  3. 3 Circle pairs of numbers 1 in the column of twos. Do not forget about the numbers that you transferred from the column of units.
    • For example, when adding binary numbers 1010 + 1111 + 1011 + 1110, you should circle 2 pairs of numbers 1, and one unit remains.
  4. 4 Consider the twos discharge. For each pair of 1's, move the 1 to the adjacent left column that corresponds to the digit of fours. If there is only one number 1 in the column of twos, or there is one extra unit left after the transfer of pairs, write under the line 1. If all the units were included in pairs or were not there at all, write at the bottom of the column 0.
    • For example, since you have circled 2 pairs of numbers 1, and then there is one more number 1, you should move 1 twice to the column of fours and write 1 under the column of twos.
  5. 5 Circle pairs of numbers 1 in the column of fours. Do not forget about the numbers that you transferred from the column of twos.
    • For example, when adding the binary numbers 1010 + 1111 + 1011 + 1110, you should circle 2 pairs of 1s because you transferred two ones from the column of twos.
  6. 6 Consider the rank of fours. For each pair of 1s, transfer 1 to the column of eights. Do not forget to write 1 under the line in the event that there is an extra digit 1, and 0 if all units are included in pairs.
    • For example, since you have circled 2 pairs of numbers 1 and there is not a single extra unit left, you should transfer 2 units to the column of eights, and write 0 under the column of fours.
  7. 7 Continue tracing pairs of ones for each digit bar. At the same time, do not forget for each circled pair to transfer 1 to the next column and write under the line 1 if there is an extra unit left, and 0 if all units are included in pairs.
    • For example, when adding the binary numbers 1010 + 1111 + 1011 + 1110, you should circle 3 pairs of ones in the column of eights, because you previously transferred two ones from the column of fours. Thus, under the column of eights it will be 0, and three units will go into the column of sixteen. In the column of rank sixteen, one pair of units will turn out, and one unit will be without a pair, so you should write under the line 1, move 1 to the column of thirty-two and write there 1 below the line. So, 1010 + 1111 + 1011 + 1110 = 110010.
  8. 8 Check the answer you received. There are many online binary addition calculators.

Similar articles

  • How to convert from binary to decimal
  • How to convert from decimal to binary
  • How to read binary numbers
  • How to subtract binary numbers
  • How to add integers from 1 to N
  • How to add and subtract square roots
  • How to subtract correctly
  • How to add fractions with different denominators
  • How to find the sum of consecutive odd numbers
  • How to quickly add five consecutive numbers