Results 1 to 4 of 4

Thread: Binary to Hex

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2009
    Location
    Worthing, UK
    Posts
    62

    Binary to Hex

    What is the simplist way to convert a number from binary to hex and back the otherway,

    I can convert both to decimal, its for an upcoming exam I have (ps I'm allowed a calculator)

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Binary to Hex

    Manually it is easiest to convert directly from one to the other - because 4 bits maps directly to 1 hex digit.

    1111 = F (or 15 decimal)
    0010 = 2 (or 2 decimal)
    1010 = 9 (or 9 decimal)

    so:
    1111 0010 1010 = F29 (no idea of the decimal!)



    Some scientific calculators can convert for you.

  3. #3
    Lively Member
    Join Date
    Jun 2002
    Posts
    111

    Re: Binary to Hex

    bin to hex
    break the binary into groups of four starting at the right

    11010100101011

    = 0011 0101 0010 1011

    each one of those 4 groups represents a hex digit; you can work right to left or left to right and I added the leading zeros to the front just to keep the groups of 4 vibe

    1011 = B
    0010 = 2
    0101 = 5
    0011 = 3

    = 352B

  4. #4
    Lively Member
    Join Date
    Jun 2002
    Posts
    111

    Re: Binary to Hex

    hex to bin
    kinda the same thing as each of the hex digits needs to become a 4 character bin:

    B = 1011
    9 = 1001
    6 = 0110 <--remember the leading zero
    1 = 0001

    so

    4C901 is going to be 5 groups of 4 binaries

    4 C 9 0 1
    0100 1100 1001 0000 0001

    I'm taking the same kinda class so good review for me too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width