Hex to Decimal to Binary


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322

    Default Hex to Decimal to Binary

    Hi All!
    Got a question about a pressure sensor I have been looking at. The spec sheet says the output range is 19A to E66 in hex. It also says that the resolution is 12 bit! If you take 19A hex and convert it to decimal you get 410. Take the same 19A and convert it to binary and you get 110011010, which is only 9 digits? If the resolution is 12 bit should there not be 3 more digits?


    Thanks, Ed
    Attached Images Attached Images

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: Hex to Decimal to Binary

    at last count it takes 12 binary digits to make $E66, i guess that if it can get a result of $e65 that's 1 digit different hence 12 bit resolution

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: Hex to Decimal to Binary

    Hi Ed,
    Your ordinary PIC ADC has a resolution of 10 bits. Yet, when it returns a result of 5 and you convert that to binary and you get 101, that's only three bits.....what's up with that?

    Max reading from your sensor is 0xE66, Min reading from your sensor is 0x19A. 0xE66-0x19A=0xCCC which in binary is 1100 1100 1100 - 12bits. Strictly speaking I'd say the resolution is somewhere between 11 and 12bits.

    /Henrik.

  4. #4
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: Hex to Decimal to Binary

    Thanks!
    I guess it makes sense now.

    Best, Ed

Similar Threads

  1. Binary Coded Decimal
    By -Dan- in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 25th May 2009, 10:23
  2. How to convert binary to decimal?
    By Cabomba in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th October 2007, 02:27
  3. Decimal to Binary Conversion
    By schlaray in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2006, 15:58
  4. Binary to Decimal from ADC
    By RYTECH in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th July 2005, 19:51
  5. Decimal to binary conversion
    By Demon in forum Code Examples
    Replies: 9
    Last Post: - 25th February 2005, 21:05

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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