0
$\begingroup$

I am aware of two ways to convert hexadecimal values into decimal values. The first method is adding the multiples of the number, multiplied by exponents of 16. The second method is by first converting to binary and then to decimal.

I was wondering if there are other methods or short cuts that I am unaware of?

I am taking a computer networking course in college and have to convert hex/bin/dec values frequently (without the aid of a calculator), so I am trying to find the most efficient method.

Thanks

  • 0
    By the way, this site: http://easycalculation.com/hex-converter.php has a very nice converter2012-01-15

3 Answers 3

1

Your first method is evaluating a polynomial in $x$ at $x=16$. There is a nice way to arrange polynomial evaluation, called Horner's Method. A search for this phrase should yield much information.

0

Start with result = most significant digit, and for each subsequent digit, multiply result by 16 and add the digit. (I suppose this is Horner's method that Gerry Myerson recommends.)

For instance, to convert A74B9 to decimal:

result = 10 (from first digit 'A') Multiply by 16, and add 7: result = 167 Multiply by 16, and add 4: result = 2676 Multiply by 16, and add 11 (from 'B'): result = 42827 Multiply by 16, and add 9: result = 685241 
  • 0
    Yes, that's Horner.2019-01-23
0

In practice you should end up (for mental conversions between the 3 modes) :
- remembering the powers of 2 in decimal (especially the powers of 16)
- in binary noticing the positions of the bits separated by groups of 4
- memorizing binary codes of the hexadecimal numbers $0,1... F$ (ex. $A=1010_2$)
(these tricks work better with 'sparse' bits)

This was useful in the 16 bits old days (and) when the bits were few... :-)