Decimal to Binary Formula
The decimal to the binary formula is used to convert decimal numbers to binary numbers. Decimal numbers can be easily converted into binary numbers by using the remainder formula. In the method, we divide the given decimal number recursively by 2 and note down the remainders until we get 0 or 1 as the quotient. We will learn more about the decimal to the binary formula along with a few solved examples in the following section.
What is Decimal to Binary Formula?
In the formula to convert decimal to the binary method, we will perform division on the given decimal number recursively by 2 and note down the remainders till we have either 0 or 1 as the final quotient. Steps that are used to convert decimal to the binary number using decimal to the binary formula are shown below,
Step 1: Divide the given decimal number by 2, note down the remainder.
Step 2: Now divide the quotient thus obtained in the above step by 2, note down the remainder.
Step 3: Repeat the above steps until we get 0 or 1 as a quotient.
Step 4: Write down the last quotient in line with remainders from last to the first, this is our binary conversion of the given decimal number.
Let us have a look at a few solved examples to understand decimal to the binary formula better.
Solved Examples on Decimal to Binary Formula
Example 1: Using decimal to binary formula, convert 29 decimal into a binary number.
Solution:
Using decimal to binary formula, we have,
Step 1: Divide the number by 2, note down the remainder:
29 ÷ 2 gives \(Q_1\) = 14, R = 1
Step 2: Divide \(Q_1\) by 2, note down the remainder:
14 ÷ 2 gives \(Q_2\) = 7, R = 0
Step 3: Divide \(Q_2\) by 2, note down the remainder:
7 ÷ 2 gives \(Q_3\) = 3, R = 1
Step 4: Divide \(Q_3\) by 2, note down the remainder:
3 ÷ 2 gives \(Q_4\) = 1, R = 1
Step 5: Write down the last quotient in line with remainders from last to the first, this is our binary conversion of the given decimal number:
11101
Answer: Hence, 29 as binary is \(11101_2\).
Example 2: Convert 145 decimal into a binary number.
Solution:
Using decimal to binary formula, we have,
Step 1: Divide the number by 2, note down the remainder:
145÷ 2 gives \(Q_1\) = 72, R = 1
Step 2: Divide Q1 by 2, note down the remainder:
72 ÷ 2 gives \(Q_2\) = 36, R = 0
Step 3: Divide \(Q_2\) by 2, note down the remainder:
36 ÷ 2 gives \(Q_2\) = 18, R = 0
Step 4: Divide \(Q_2\) by 2, note down the remainder:
18 ÷ 2 gives \(Q_3\) = 9, R = 0
Step 5: Divide \(Q_3\) by 2, note down the remainder:
9 ÷ 2 gives \(Q_4\) = 4, R = 1
Step 6: Divide \(Q_4\) by 2, note down the remainder:
4 ÷ 2 gives \(Q_5\) = 2, R = 0
Step 7: Divide \(Q_5\) by 2, note down the remainder:
2 ÷ 2 gives \(Q_6\) = 1, R = 0
Step 8: Write down the last quotient in line with remainders from last to the first, this is our binary conversion of the given decimal number:
10010001
Answer: Hence, 145 decimal as binary is \(10010001_2\).
visual curriculum