Velocity Reviews > Hexidecimal conversion

# Hexidecimal conversion

Gary Kendall
Guest
Posts: n/a

 10-29-2003
I know that you can convert Binary numbers to Deciaml, but is there a
formula to convert Hexidecimal numbers to decial?
If so can you direct me to it or let me know what it is.

Thanks,
Gary

Blam
Guest
Posts: n/a

 10-29-2003
its east to memorize this:
0=0
1=1
2=10
3=11
4=100
5=101
6=110
7=111 (I included octal too)
8=1000
9=1001
A=1010
B=1011
C=1100
D=1101
E=1110
F=1111

Say you got A49=1010(A)0100(4)1001(9) Each hex is just strung together with
its binary equvalent
"Gary Kendall" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I know that you can convert Binary numbers to Deciaml, but is there a
> formula to convert Hexidecimal numbers to decial?
> If so can you direct me to it or let me know what it is.
>
> Thanks,
> Gary

Dan Dawson
Guest
Posts: n/a

 10-30-2003
Here is the formula to directly convert from hex to dec:
1) You always start from the right most hex number and then go left
2) Multiply the right most number by 16 to the power of 0 (16^0 = 1)
3) Multiply the next number by 16 to the power of 1 (16^1=16)
4) Multiply the next number by 16 to the power of 2 (16^2=256)
5) Multiply the next number by 16 to the power of 3 (16^3=4096)
6) Follow this algorithm until you reach the left most number.
7) Now add all those multiplied results.

I will take the same example:
9BC5

5*16^0 = 5
12*16^1= 192 (note: C=12)
11*16^2= 2816 (note: B=11)
9*16^3= 36864
_______+
39877
======

"Navin R. Johnson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Wed, 29 Oct 2003 22:36:23 GMT, Gary Kendall <(E-Mail Removed)>
> wrote:
>
> >I know that you can convert Binary numbers to Deciaml, but is there a
> >formula to convert Hexidecimal numbers to decial?
> >If so can you direct me to it or let me know what it is.
> >
> > Thanks,
> > Gary

>
> I always convert the hex number back to binary then simply add up the
> bit values. For example:
>
> 9BC5 = 1001 1011 1100 0101
>
> 1 1 1
> 2 0
> 4 1 4
> 8 0
>
> 16 0
> 32 0
> 64 1 64
> 128 1 128
>
> 256 1 256
> 512 1 512
> 1024 0
> 2048 1 2048
>
> 4096 1 4096
> 8192 0
> 16384 0
> 32768 1 32768
>
>
> 1 + 4 + 64 + 128 + 256 + 512 + 2048 + 4096 + 32768 = 39,877
>
> Or, you could always buy a calculator with hex conversion.
>
> NRJ
>
>

Gordon Findlay
Guest
Posts: n/a

 10-30-2003

An alternative, which saves wondering what the powers of 16 are, is to

- start at the LEFT
- take the digit there, and multiply by 16 (If the hex digit is A,
treat it as 10 decimal, etc)
- add the next digit to the result

If there are any digits left, multiply the total so far by 16, and add
the next digit. Repeat this step until you add the last digit.

This assumes that there are at least two digits in the hexadecimal
number. This is the easiest way to program too.

Thus 9BC5 gives
9 * 16 + 11 = 155
155 * 16 + 12 = 2492
2492 * 16 + 5 = 39877

Remember, start at the left. And guys, it's hexAdecimal, not
hexIdecimal

On Wed, 29 Oct 2003 21:28:26 -0500, "Dan Dawson"
<(E-Mail Removed)> wrote:

>Here is the formula to directly convert from hex to dec:
>1) You always start from the right most hex number and then go left
>2) Multiply the right most number by 16 to the power of 0 (16^0 = 1)
>3) Multiply the next number by 16 to the power of 1 (16^1=16)
>4) Multiply the next number by 16 to the power of 2 (16^2=256)
>5) Multiply the next number by 16 to the power of 3 (16^3=4096)
>6) Follow this algorithm until you reach the left most number.
>7) Now add all those multiplied results.
>
>I will take the same example:
>9BC5
>
> 5*16^0 = 5
>12*16^1= 192 (note: C=12)
>11*16^2= 2816 (note: B=11)
> 9*16^3= 36864
> _______+
> 39877
> ======
>
>
>"Navin R. Johnson" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed).. .
>> On Wed, 29 Oct 2003 22:36:23 GMT, Gary Kendall <(E-Mail Removed)>
>> wrote:
>>
>> >I know that you can convert Binary numbers to Deciaml, but is there a
>> >formula to convert Hexidecimal numbers to decial?
>> >If so can you direct me to it or let me know what it is.
>> >
>> > Thanks,
>> > Gary

>>
>> I always convert the hex number back to binary then simply add up the
>> bit values. For example:
>>
>> 9BC5 = 1001 1011 1100 0101
>>
>> 1 1 1
>> 2 0
>> 4 1 4
>> 8 0
>>
>> 16 0
>> 32 0
>> 64 1 64
>> 128 1 128
>>
>> 256 1 256
>> 512 1 512
>> 1024 0
>> 2048 1 2048
>>
>> 4096 1 4096
>> 8192 0
>> 16384 0
>> 32768 1 32768
>>
>>
>> 1 + 4 + 64 + 128 + 256 + 512 + 2048 + 4096 + 32768 = 39,877
>>
>> Or, you could always buy a calculator with hex conversion.
>>
>> NRJ
>>
>>

>

Ken Briscoe
Guest
Posts: n/a

 10-30-2003
> I know that you can convert Binary numbers to Deciaml, but is there a
> formula to convert Hexidecimal numbers to decial?
> If so can you direct me to it or let me know what it is.
>

If you know how to convert binary numbers to decimal, and vice versa, then
it's easy to convert hexadecimal (and octal) to binary - and vice versa. I
taught myself by literally using Windows Calculator, typing in a number,
reading the conversion, and figuring out the steps to get there. Then
reverse the steps, and you're back at decimal. I quickly figured out, it's
the same thing as binary, just with a different base. I must admit, I'm no
expert at anything other than decimal, but I can read (if you give me a
minute...) binary, hex, and octal, all from just messing around with
Calculator.

--

KB

first inital last name AT hotmail DOT com

Tom MacIntyre
Guest
Posts: n/a

 10-31-2003
On Thu, 30 Oct 2003 15:59:36 +1300, Gordon Findlay
<(E-Mail Removed)> wrote:

>
>An alternative, which saves wondering what the powers of 16 are, is to
>
> - start at the LEFT
> - take the digit there, and multiply by 16 (If the hex digit is A,
>treat it as 10 decimal, etc)
> - add the next digit to the result
>
>If there are any digits left, multiply the total so far by 16, and add
>the next digit. Repeat this step until you add the last digit.
>
>This assumes that there are at least two digits in the hexadecimal
>number. This is the easiest way to program too.
>
>Thus 9BC5 gives
> 9 * 16 + 11 = 155
> 155 * 16 + 12 = 2492
> 2492 * 16 + 5 = 39877

I never saw this method before, and it's cool the way it takes
advantage of the cumulative effect of the multiplication by 16. Nice,
and easy to remember!

Tom

>
>Remember, start at the left. And guys, it's hexAdecimal, not
>hexIdecimal
>
>On Wed, 29 Oct 2003 21:28:26 -0500, "Dan Dawson"
><(E-Mail Removed)> wrote:
>
>>Here is the formula to directly convert from hex to dec:
>>1) You always start from the right most hex number and then go left
>>2) Multiply the right most number by 16 to the power of 0 (16^0 = 1)
>>3) Multiply the next number by 16 to the power of 1 (16^1=16)
>>4) Multiply the next number by 16 to the power of 2 (16^2=256)
>>5) Multiply the next number by 16 to the power of 3 (16^3=4096)
>>6) Follow this algorithm until you reach the left most number.
>>7) Now add all those multiplied results.
>>
>>I will take the same example:
>>9BC5
>>
>> 5*16^0 = 5
>>12*16^1= 192 (note: C=12)
>>11*16^2= 2816 (note: B=11)
>> 9*16^3= 36864
>> _______+
>> 39877
>> ======
>>
>>
>>"Navin R. Johnson" <(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed). ..
>>> On Wed, 29 Oct 2003 22:36:23 GMT, Gary Kendall <(E-Mail Removed)>
>>> wrote:
>>>
>>> >I know that you can convert Binary numbers to Deciaml, but is there a
>>> >formula to convert Hexidecimal numbers to decial?
>>> >If so can you direct me to it or let me know what it is.
>>> >
>>> > Thanks,
>>> > Gary
>>>
>>> I always convert the hex number back to binary then simply add up the
>>> bit values. For example:
>>>
>>> 9BC5 = 1001 1011 1100 0101
>>>
>>> 1 1 1
>>> 2 0
>>> 4 1 4
>>> 8 0
>>>
>>> 16 0
>>> 32 0
>>> 64 1 64
>>> 128 1 128
>>>
>>> 256 1 256
>>> 512 1 512
>>> 1024 0
>>> 2048 1 2048
>>>
>>> 4096 1 4096
>>> 8192 0
>>> 16384 0
>>> 32768 1 32768
>>>
>>>
>>> 1 + 4 + 64 + 128 + 256 + 512 + 2048 + 4096 + 32768 = 39,877
>>>
>>> Or, you could always buy a calculator with hex conversion.
>>>
>>> NRJ
>>>
>>>

>>

Kenny
Guest
Posts: n/a

 11-01-2003
Windows calculator will do it for you, make sure View is scientific.

--

Kenny

"Gary Kendall" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I know that you can convert Binary numbers to Deciaml, but is there a
> formula to convert Hexidecimal numbers to decial?
> If so can you direct me to it or let me know what it is.
>
> Thanks,
> Gary

John D Loop
Guest
Posts: n/a

 11-01-2003
The Windows calculator works just fine for this... calc.exe
J
--
Check my web site for tips on insuring safe computing in wired and wireless
homenetworking environments!
www.pccitizen.com

"Gary Kendall" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I know that you can convert Binary numbers to Deciaml, but is there a
> formula to convert Hexidecimal numbers to decial?
> If so can you direct me to it or let me know what it is.
>
> Thanks,
> Gary

Tom MacIntyre
Guest
Posts: n/a

 11-04-2003
On Sat, 1 Nov 2003 11:20:10 -0500, "John D Loop"
<(E-Mail Removed)> wrote:

>The Windows calculator works just fine for this... calc.exe
>J

It has been my theory for quite some time now that the brain, like the
rest of the human body, requires periodic workouts to stay at or near
peak operating levels.

Tom

Tom MacIntyre
Guest
Posts: n/a

 11-08-2003
On Fri, 7 Nov 2003 22:08:27 -0700, "Mark Stinson" <m
http://www.velocityreviews.com/forums/(E-Mail Removed)> wrote:

>There is the formula that I learned back in my skool daze, but it was a
>royal pain, involved memorizing powers of 16 and doing a lot of math (which
>may be why I learned it in a math class). Today, I convert decimal to
>binary, then start from the right, split the binary into groups of four
>digits and convert each group to one hex digit:
>
>38,463 = 1001 0110 0011 1111
>
>1001 0110 0011 1111
> 9 6 3 F
>
>Alternatively (and more commonly), I open calc.exe in scientific mode, enter
>my decimal number, click "hex" and viola!
>
>But if you really insist on doing it the hard way:
>
>The largest power of 16 that can be subtracted from 38,463 without getting a
>negative result is 4096, so
>
>38,463 / 4096 = 9 with 1599 remainder
>
>1599 / 256 = 6 with 63 remainder
>
>63 / 16 = 3 with 15 remainder
>
>15 / 1 = 15 (F in hex) with 0 remainder
>
>So 38,463 = 963F
>
>And now you also know why you learned remainders in your math classes.
>
>Mark Stinson
>Horizon City, Texas

Mark...thanks for the math refresher, and the chuckle that went along
with it.

Tom

>
>"VOLAND" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>>
>> How about an easy to remeber formula to convert back to Hex from Base
>> 10? Can anyone help?
>>
>>
>> VOLAND
>> ------------------------------------------------------------------------
>> Posted via http://www.examnotes.net
>> ------------------------------------------------------------------------
>>
>>
>>

>