DEV Community

Svetlana
Svetlana

Posted on

Binary Number System

When early humans needed to count and keep track of objects, including animals and natural objects, they found that using ten fingers of their hands was the simplest way to count them.

To represent quantitative values, we use number systems. In everyday life, we are dealing with the decimal number system, which consists of ten digits. Consequently, the base of the decimal system is 10.

                0 1 2 3 4 5 6 7 8 9 
Enter fullscreen mode Exit fullscreen mode

In the binary number system, there are only two digits. Consequently, the base of the binary system is 2.

                       0 1 
Enter fullscreen mode Exit fullscreen mode

The rules and principles for all number systems are the same. In every system, we do operations like addition, division, multiplication, or subtraction.

In the decimal number system, when we have four numbers to add, we break down them into parts, calculate operations separately, and add them together. The same concept is proper and applicable to binary systems.
A binary system has only two digits ,0 and 1. Here are rules that will help to add numbers in the binary system.

0 + 0= 1
0 + 1= 1
1 + 0= 1
1 + 1= 10

Let’s take the example of 111 + 110

  • 111 110 _____

Step 1. We add 1 to 0 starting from the right side. 1 + 0 = 1
Step 2. Add second column which is 1 + 1 = 10
Step 3. In order to add the last column 1 + 1 we had to carry 1
from the second column result and put 0 under the second column.

      1
  +   111
      110
    _____
       01
Enter fullscreen mode Exit fullscreen mode

Step 4. Using the same method that we used in step 3 we add the last column’s numbers.

    11
 +   111
     110
    _____
    1101
Enter fullscreen mode Exit fullscreen mode

So, the result of the addition operation is 1101.

Top comments (1)

Collapse
 
julieta_hakobyan_2c099b3e profile image
Julieta Hakobyan

Great explanation👍.. Thank you