Double word, any creative solutions?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    Lancashire
    Posts
    50

    Default Double word, any creative solutions?

    Hi All

    I have a project where I need to store numbers consisting of 6 digits. This obviously wont fit into a single word as is and I`m sure PBP wont support double word. Any creative ideas as to how to get around this?. In the project having stored this number I then have to do a comparison against a list of similar 6 digit numbers for a match so a solution needs to be easily sorted too.

    Cheers Pete

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Take the six digits, convert them to three Bytes and save them as such... eg...

    Number=990714

    Byte1=99
    Byte2=07
    Byte3=14

    You can quickly scan down a huge (sorted) list in EEPROM just comparing Byte1, if it matches go on to Byte2 and if that matches go on to Byte3.

  3. #3
    Join Date
    Jul 2003
    Location
    Lancashire
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Hi Melanie!

    Thanks for that, quite logical really!. I`ll have a futher play with this and see what I can make work, I only have around 30 pairs of numbers to compare and the second of the pair depend on the outcome of the match of the first.

    Cheers Pete

Similar Threads

  1. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  3. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  4. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23

Members who have read this thread : 0

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