![What's the process for converting decimal to binary?](https://codenga-com-content.s3.us-west-2.amazonaws.com/articles/decimal-to-binary.jpg)
Autor: 24.11.2023
How to Convert Decimal to Binary?
The binary system is the fundamental number system used in computer technology. In this article, we'll explain the basics of this system and show how to convert a number written in the decimal system into a binary number.
How Binary System Works
In the binary system, we use only two digits: 0 and 1. Unlike the decimal system, which uses digits from 0 to 9, the binary system is highly simplified. It may seem unusual from our perspective, but it's ideal for computers that operate based on the principles of electronics.
In the decimal system, numbers 0-9 are represented by the same digits. In the binary system, we also use digits from the decimal system, but we have only two options: 0 and 1. Here are a few examples of how numbers are represented in the binary system:
- 0 in the decimal system is 0 in the binary system.
- 1 in the decimal system is 1 in the binary system.
- 2 in the decimal system is 10 in the binary system.
- 5 in the decimal system is 101 in the binary system.
You can notice that each number in the binary system is a sequence of zeros and ones.
How to Convert Decimal to Binary
Let's consider - how do we convert 5 in the decimal system to a number in the binary system? We'll use the division with remainder for this purpose.
- Start with the number 5.
- Divide 5 by 2 = 2 with a remainder of 1.
- Take the result from the previous operation and divide by two: 2 divided by 2 = 1 with a remainder of 0.
- Take the result from the previous operation and divide by two: 1 divided by 2 = 0 with a remainder of 1.
Continue this process until you get a result of zero. Then, stop our operations. The binary number is made up of the remainders from the division, read "from the bottom" of our operations, so ultimately:
decimal 5 = binary 101
Now you know how to transform a number in the decimal system into a number in the binary system.