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 Hexadecimal Conversion

For converting a number from the base 10 to the base 16, first write down that number and then divide it by the number 16. Then note the remainder obtained from the division. Ultimately, divide the quotient of the division obtained by 16. 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. Thus, it 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 Hexadecimal Conversion according to the GATE Syllabus for CSE (Computer Science Engineering). Read ahead to learn more.

Table of Contents

How to Perform Decimal to Hexadecimal 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 one can convert some numbers from any given base 10 to base 16.

One can convert an available number 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 you want to convert any such number from base 10 to any other base. Perform this division with the required base.

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

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

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 hexadecimal with base 16.

For the Real Part-

When we want 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 if you want to convert a number’s fractional part from decimal to any other base. Perform the multiplication using the required base.

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

  • Multiply the available fraction (given in base 10) using 16.
  • Separately write the real and the fractional part of our result so as to obtain them separately.
  • Multiply the fractional part by 16.
  • Separately write the real and the fractional part of this obtained 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 you can find the result of the fraction up to as many places as required.

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

Practice Problems on Decimal to Hexadecimal Conversion

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

1.1. (2020)10

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

From here, we get (2020)10 = (7E4)16

1.2. (2020.65625)10

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

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

(2020)10 = (7E4)16

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

Fractional part Real Part
0.65625 x 16 0.5 10 = A
0.5 x 16 0.0 8

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

Thus, here, (0.65625)10 = (0.A8)16

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

(2020.65625)10 = (7E4.A8)16

1.3. (172)10

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

From here, we get (172)10 = (AC)16

1.4. (172.983)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, and we get-

(172)10 = (AC)16

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

Fractional part Real Part
0.983 x 16 0.728 15 = F
0.728 x 16 0.648 11 = B
0.648 x 16 0.368 10 = A
0.368 x 16 0.888 5

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 hexadecimal base or base 16.

Thus, here, (0.983)10 = (0.FBA5)16

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

(172.983)10 = (AC.FBA5)16

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.

*

*