Hexidecimal conversion

Discussion in 'A+ Certification' started by Gary Kendall, Oct 29, 2003.

  1. Gary Kendall

    Gary Kendall Guest

    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
     
    Gary Kendall, Oct 29, 2003
    #1
    1. Advertising

  2. Gary Kendall

    Blam Guest

    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" <> wrote in message
    news:...
    > 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, Oct 29, 2003
    #2
    1. Advertising

  3. Gary Kendall

    Dan Dawson Guest

    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.
    8) You got the answer!!

    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" <> wrote in message
    news:...
    > On Wed, 29 Oct 2003 22:36:23 GMT, Gary Kendall <>
    > 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
    >
    > Add them all up and you have your decimal equivalent.
    >
    > 1 + 4 + 64 + 128 + 256 + 512 + 2048 + 4096 + 32768 = 39,877
    >
    > Or, you could always buy a calculator with hex conversion.
    >
    > NRJ
    >
    >
     
    Dan Dawson, Oct 30, 2003
    #3
  4. 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"
    <> 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.
    >8) You got the answer!!
    >
    >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" <> wrote in message
    >news:...
    >> On Wed, 29 Oct 2003 22:36:23 GMT, Gary Kendall <>
    >> 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
    >>
    >> Add them all up and you have your decimal equivalent.
    >>
    >> 1 + 4 + 64 + 128 + 256 + 512 + 2048 + 4096 + 32768 = 39,877
    >>
    >> Or, you could always buy a calculator with hex conversion.
    >>
    >> NRJ
    >>
    >>

    >
     
    Gordon Findlay, Oct 30, 2003
    #4
  5. Gary Kendall

    Ken Briscoe Guest

    > 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
     
    Ken Briscoe, Oct 30, 2003
    #5
  6. On Thu, 30 Oct 2003 15:59:36 +1300, Gordon Findlay
    <> 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"
    ><> 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.
    >>8) You got the answer!!
    >>
    >>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" <> wrote in message
    >>news:...
    >>> On Wed, 29 Oct 2003 22:36:23 GMT, Gary Kendall <>
    >>> 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
    >>>
    >>> Add them all up and you have your decimal equivalent.
    >>>
    >>> 1 + 4 + 64 + 128 + 256 + 512 + 2048 + 4096 + 32768 = 39,877
    >>>
    >>> Or, you could always buy a calculator with hex conversion.
    >>>
    >>> NRJ
    >>>
    >>>

    >>
     
    Tom MacIntyre, Oct 31, 2003
    #6
  7. Gary Kendall

    Kenny Guest

    Windows calculator will do it for you, make sure View is scientific.

    --

    Kenny


    "Gary Kendall" <> wrote in message
    news:...
    > 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
     
    Kenny, Nov 1, 2003
    #7
  8. Gary Kendall

    John D Loop Guest

    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" <> wrote in message
    news:...
    > 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, Nov 1, 2003
    #8
  9. On Sat, 1 Nov 2003 11:20:10 -0500, "John D Loop"
    <> 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, Nov 4, 2003
    #9
  10. On Fri, 7 Nov 2003 22:08:27 -0700, "Mark Stinson" <m
    > 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" <> wrote in message
    >news:...
    >>
    >> How about an easy to remeber formula to convert back to Hex from Base
    >> 10? Can anyone help?
    >>
    >>
    >> VOLAND
    >> Sign up for free daily practice questions at: http://www.QoD.US
    >> ------------------------------------------------------------------------
    >> Posted via http://www.examnotes.net
    >> ------------------------------------------------------------------------
    >> View this thread: http://www.examnotes.net/article1026562.html
    >>
    >>
    >>

    >
     
    Tom MacIntyre, Nov 8, 2003
    #10
  11. On Sat, 08 Nov 2003 15:15:24 GMT, Tom MacIntyre
    <> wrote:

    >On Fri, 7 Nov 2003 22:08:27 -0700, "Mark Stinson" <m
    >> 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.


    Since division is repeated subtraction, don't bother remembering
    powers of 16. Stick with the same divisor throughout

    1: Take a decimal number
    2: Divide by 16 - record, then ignore (for now) the remainder
    3: Repeat step 2 until you have a number which is less than 16.
    4: Start with that number, then write down the remainders in reverse
    order to their generation. Convert remainders 10 - 15 to A - F of
    course.

    Voila!

    Dead easy to program too - no need for a lookup table of poowers of
    16.

    [I learnt this method in school over 40 years ago. The education
    system isn't getting any better]

    Gordon
     
    Gordon Findlay, Nov 9, 2003
    #11
  12. Gary Kendall

    B Guest

    try this chart

    to convert hex to bin find the hex number. the number on the top row is its
    first 2 digits in bin. the left row is its last two digits in binary. for
    example hex number 6 first 2 digits in binary would be 01 and second two
    would be 10 making 0110. It could also be used in reverse to convert hex to
    bin.

    00 01 10 11
    00 0 4 8 C
    01 1 5 9 D
    10 2 6 A E
    11 3 7 B F



    "Gordon Findlay" <> wrote in message
    news:...
    > On Sat, 08 Nov 2003 15:15:24 GMT, Tom MacIntyre
    > <> wrote:
    >
    > >On Fri, 7 Nov 2003 22:08:27 -0700, "Mark Stinson" <m
    > >> 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.

    >
    > Since division is repeated subtraction, don't bother remembering
    > powers of 16. Stick with the same divisor throughout
    >
    > 1: Take a decimal number
    > 2: Divide by 16 - record, then ignore (for now) the remainder
    > 3: Repeat step 2 until you have a number which is less than 16.
    > 4: Start with that number, then write down the remainders in reverse
    > order to their generation. Convert remainders 10 - 15 to A - F of
    > course.
    >
    > Voila!
    >
    > Dead easy to program too - no need for a lookup table of poowers of
    > 16.
    >
    > [I learnt this method in school over 40 years ago. The education
    > system isn't getting any better]
    >
    > Gordon
     
    B, Nov 9, 2003
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    465
  2. Rik Bain

    DNS Doctoring conversion?

    Rik Bain, Nov 10, 2003, in forum: Cisco
    Replies:
    2
    Views:
    2,422
    Walter Roberson
    Nov 10, 2003
  3. Phil
    Replies:
    0
    Views:
    710
  4. aaron

    ip subnet conversion

    aaron, Jan 5, 2005, in forum: Cisco
    Replies:
    2
    Views:
    1,889
    Barry Margolin
    Jan 6, 2005
  5. Will Hay

    Shadow BIOS in RAM and hexidecimal representation?

    Will Hay, Mar 2, 2004, in forum: A+ Certification
    Replies:
    1
    Views:
    776
    Nigel Kendrick
    Mar 2, 2004
Loading...

Share This Page