Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

Decimal to Binary Conversion

For converting a number from the base 10 to the base 2, we first write down that number and then divide it by the number 2, and note the remainder obtained from the division. Ultimately, we divide the quotient of the division obtained by 2. The obtained remainder should be noted. This process needs to be repeated till the quotient happens to be 0. Write the values of the remainders in this process from the bottom to the top. This one will be the answer that is required.

Before you proceed ahead with this concept, check out the basics of conversion to various bases. In this article, we will take a look at the Decimal to Binary Conversion according to the GATE Syllabus for CSE (Computer Science Engineering). Read ahead to learn more.

Table of Contents

How to Perform Decimal to Binary Conversion?

In the case of number systems, it is very crucial that one has an in-depth knowledge of how one can convert various numbers from a given base to another one. In this article, we will learn how we can convert some numbers from any given base 10 to base 2.

An available number can be converted from base 10 to other bases using the division method along with the multiplication method. Thus, the following two cases would be possible here:

Case 01: In the case of Numbers that Carry No Fractional Part:

Use the division method when the conversion of any such number from base 10 to any other base is required. Here, one can perform this division with the required base.

Here are the steps that are required for converting a number from decimal to binary:

  • Divide the available number (present in base 10 with us) with 2. Do this until the final result is less than 2.
  • Traverse the remainders available to us from bottom to top. This way, you get the number that is required in base 2.

Case 02: In the case of Numbers that Carry a Fractional Part:

Treat the real and the fractional part separately when you want to convert any such available decimal numbers with base 10 to binary with base 2.

For the Real Part-

When someone wants to convert the real part of a number from decimal to any other base, the steps involved would be the same as above.

For the Fractional Part-

Use the multiplication method when the conversion of a number’s fractional part from decimal to any other base is required. Perform the multiplication using the required base.

Here are the steps that are required for converting a number from decimal to binary:

  • Multiply the available fraction (given in base 10) using 2.
  • Separately write the real and the fractional part of our result so as to obtain them separately.
  • Multiply the fractional part by 2.
  • Separately write the real and the fractional part of this result so as to obtain it separately.
  • Repeat this procedure unless and until the fractional part happens to be 0.
  • If the fractional part doesn’t terminate to 0, then one needs to find the result of the fraction up to as many places as required.

The Required Number in the Base 2 = A series of the real part of results obtained by multiplication in the steps above from top to bottom.

Practice Problems on Decimal to Binary Conversion

1. Convert the given numbers from the base 10 to the base 2-

1.1. (18)10

Answer – We use the division method here, and we get-

Decimal to Binary Conversion Image 1

From here, we get (18)10 = (10010)2

1.2. (18.625)10

Answer – We will use the real and the fractional part separately here.

The real part is (18)10. Here, we will use the division method, and we get-

(18)10 = (10010)2

The fractional part here is (0.625)10. We will convert the fractional part of the base 10 to the base 2. Here, using the multiplication method, we will get-

Fractional part Real Part
0.625 x 2 0.25 1
0.25 x 2 0.50 0
0.50 x 2 0 1

Since the fractional part becomes 0 here, we will finally stop. Here, the fractional part is getting terminated to 0 after 3 subsequent iterations. If we traverse the real part from top to bottom, we obtain the number in the binary base or base 2.

Thus, here, (0.625)10 = (0.101)2

If we combine the results of the real and the fractional part, we will get-

(18.625)10 = (10010.101)2

1.3. (172)10

Answer – We use the division method here, and we get-

Decimal to Binary Conversion Image 2

From here, we get (172)10 = (10101100)2

1.4. (172.878)10

Answer – We will use the real and the fractional part separately here.

The real part is (172)10. Here, we will use the division method here, and we will get-

(172)10 = (10101100)2

The fractional part here is (0.878)10. We will convert the fractional part of the base 10 to the base 2. Using the multiplication method here, we will get-

Fractional part Real Part
0.878 x 2 0.756 1
0.756 x 2 0.512 1
0.512 x 2 0.024 1
0.024 x 2 0.048 0

Since the fractional part does not become 0 here, we will find the values up to a total of 4 decimal places. So if we traverse the real part from top to bottom, we obtain the number in the binary base or base 2.

Thus, here, (0.878)10 = (0.1110)2

If we combine the results of the real and the fractional part, we will get-

(172.878)10 = (10101100.1110)2

Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Syllabus, GATE Previous Year Question Paper, and more.

Also Explore,

Comments

Leave a Comment

Your Mobile number and Email id will not be published.

*

*