DEV Community

SShahumyan
SShahumyan

Posted on

Understanding binary numbers and how to convert decimal numbers to binary

We all know 10 based numbering system which has numbers from 0-9
And when we think of numbers we think about decimal numbers but have you asked yourself how a computer “thinks” about numbers?
So essentially computer consists of many small “processors” which can only process one thing whether there is a signal or there is not, and in order to communicate with the computer we created a binary numbering system that consists of two numbers:1(on) and 0(off)
The computer can do complex tasks by doing a lot of easy ones for example if we need to add two decimal numbers computer will convert each number to a binary number add them and then convert it back to a decimal number to give us an answer
Understanding how to convert a decimal number to a binary number.
We need to divide the given number repeatedly by 2 writing down every remainder until we get 0. Then, we write the remainders in reverse order to get the binary number.

Top comments (0)