Storing numbers for caller ID?


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    44

    Default Storing numbers for caller ID?

    Is there a simple way to store 10 digit numbers in NVR then search the NVR for a match?

    I want to store at least 100 numbers and then search them compared to a CLI received via a caller ID unit I already have?

    So to store 9999999999 this would be 3B9AC9FF in hex but as far as I understand can not store a single number this large.

    Rob

  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Rob,

    How about BCD?
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  3. #3
    Join Date
    Mar 2004
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by NavMicroSystems
    Rob,

    How about BCD?
    I could write a routine to store 1001010100000010111110001111111111
    So what would be the best way to search? Ideally I need to search the 100 numbers in under a second.
    Any thoughts?

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Rob,

    Taking your example, BCD would result in

    $9999999999
    or
    %1001100110011001100110011001100110011001

    do you see the difference?
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  5. #5
    Join Date
    Mar 2004
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by NavMicroSystems
    Rob,

    Taking your example, BCD would result in

    $9999999999
    or
    %1001100110011001100110011001100110011001

    do you see the difference?
    After a quick search on Google yes I do
    But it does use more memory

    1001100110011001100110011001100110011001
    1001010100000010111110001111111111
    Or is this an easier way to then search?
    I guess I could search all the last numbers of each sequence for a match.
    I assume i will have to devise so kind of memory allocation per number in order to make searching easier?
    Any more clues?

    **update**
    Just done a quick search and found a previous post from you Ralph
    http://www.picbasic.co.uk/forum/show...ghlight=eeprom
    Could I not use this method to write and read my 10 digit string?


    Rob
    Last edited by Rob Martin; - 28th March 2005 at 09:33.

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


    Did you find this post helpful? Yes | No

    Default

    Method 1.

    Store the numbers in EEPROM in ASCII format. If you try to convert to a just a numeric value, you will lose leading zero's.

    When they are first added, they are SORTED and stored in numeric order.

    There is no time penalty READING from EEPROM, just when writing. Looking through a pre-sorted list will be extremely fast.

    If the SORTING takes too long when adding the number, use Ramtrons FRAM or similar.

    Method 2.

    Store the numbers randomly in EEPROM, but each record contains a HASH KEY which is assigned as it's SEARCH CODE. The HASH KEY (look up HASH KEYS on internet) can be a simple BYTE containing the summed compliment of all the bits in the telephone number (a little like a simple CRCC sum check), or it can be a more sohisticated result.

    example: http://www.concentric.net/~Ttwang/tech/inthash.htm

    The incomming telephone number is similarly hashed and checked across the stored HASH values, only the ones that match (a simple HASH algorythim could produce identical HASH Keys) are then sequentially scanned properly. A method like this will eliminate 95% (or more) of the search task. You use this method for storing large numbers of Records in Databases that require RANDOM rather than SEQUENTIAL access.

    Method 3.

    C'mos Guy's, this is easy 1st Year student stuff... overdosing on Chocolate must have dulled the Grey matter this Easter...

Similar Threads

  1. Replies: 4
    Last Post: - 15th April 2009, 01:54
  2. Working with 3 byte numbers
    By Josuetas in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th July 2007, 22:59
  3. Splitting numbers and recombining them(EEPROM Error)
    By selbstdual in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd June 2007, 06:40
  4. Numbers
    By jcleaver in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 7th April 2007, 18:32
  5. Returning whole numbers for DS1820?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th February 2007, 12:15

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