Convert Decimal Number to Binary
Binary Number
A binary number system is defined as a number that is used in binary systems. It is also called base 2 numeral system. It represents the numeric values with two symbols, 0 (zero) and 1 (one).
Decimal Number:
The decimal number system is also known as the base 10 numeral system. It uses ten digits from 0 to 9. In the decimal number system, the positions continuous to the left of the decimal point represent units, tens, hundreds, thousands and so on. Thus, the base of the decimal number system is 10.
How to convert Decimal Number to Binary?
This Code With Nick article will teach you how to convert a decimal number to binary.
To convert a decimal number to binary, follow these steps:
1. Divide the decimal number by 2.
2. Write down the quotient and the remainder.
3. If the quotient is greater than 0, divide it by 2 and write down the new quotient and remainder.
4. Repeat step 3 until the quotient is 0.
5. Write the remainders in reverse order. This is the binary equivalent of the decimal number.
Here's an example:
Let's convert the decimal number 27 to binary, using the division -by-2 method.
1. Divide 27 by 2, and write down the quotient and remainder:
27 ÷ 2 = 13 with a remainder of 1
2. Divide 13 by 2, and write down the quotient and remainder:
13 ÷ 2 = 6 with a remainder of 1
3. Divide 6 by 2, and write down the quotient and remainder:
6 ÷ 2 = 3 with a remainder of 0
4. Divide 3 by 2, and write down the quotient and remainder:
3 ÷ 2 = 1 with a remainder of 1
5. Divide 1 by 2, and write down the quotient and remainder:
1 ÷ 2 = 0 with a remainder of 1
We then read the remainders in reverse order to obtain the binary representation of 27:
27 in binary is 11011
Therefore, 27 in binary is 11011.
Another Example:
Let's convert the decimal number 25 to binary.
1. 25 ÷ 2 = 12 with a remainder of 1
2. Write down the quotient (12) and the remainder (1)
3. 12 ÷ 2 = 6 with a remainder of 0
4. 6 ÷ 2 = 3 with a remainder of 0
5. 3 ÷ 2 = 1 with a remainder of 1
6. 1 ÷ 2 = 0 with a remainder of 1
So the remainders in reverse order are: 1 1 0 0 1, which means the binary equivalent of 25 is 11001.
.jpeg)
Comments
Post a Comment