DEV Community

Arina Hovhannisyan
Arina Hovhannisyan

Posted on

What is the Binary system? Conversion, addition and multiplication of the binary numbers.

One of the four types of the number system is the binary one. It describes numbers by only two digits: 1 and 0. A Binary digit or, as we call it, bit is the smallest unit of data. One bit represents either 1 or 0, which means it can’t take any other value. That is why it is called the base - 2 system. These digits are also called electric signals. In transistors, for example, 1 refers to a flow of electricity, and 0 refers to the lack of it.
In contrast to the binary system, decimal one is a base - 10 system, in which we use one of ten digits (0-9) to describe a number. And there are various methods for decimal to binary conversion. One of those methods is repeatedly dividing the decimal number by 2, and the remainders are written down till we get to the 0 quotients. After these steps, we need to write the remainders in reverse order to get the binary value of our decimal number.
The following steps will guide you on how to do the inverse conversion from binary to the decimal system. Firstly, we should multiply each digit of our binary number by the base of 2, raised to the respective power depending on the digit’s position in the number. And the sum of all these values will be the decimal version of our binary number.
With binary numbers, we can also do mathematical operations: multiplication, addition, subtraction, and division.
In this post, I’ll explain how you can do only two operations: multiplication and addition. The same principle does these operations of binary numbers as with decimal numbers.
Binary addition is considered much easier to do than decimal one. In order to add binary numbers, we add the first digit of the first number to the first digit of the second number, and so on. If we have 1+1, we should write 0 in the respective position and carry 1.
Then comes the multiplication of binary numbers. The first step is multiplying the second number’s first digit with the first number. Afterward, we do the same with the second digit but write the result shifting it one digit to the left. After doing the same action with all of the digits of the second number, we should add them together, which is explained above.
And this is how two mathematical operations are done in the binary numerical system.

Top comments (0)