store/display very large numbers (700000)


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2007
    Posts
    17

    Default store/display very large numbers (700000)

    Hi,

    Okay, I'm new to the fw thing and have a few questions about storing, incrementing and displaying large numer.

    I have a project where a user will enter a trigger-value between 100000-700000 using a keypad. A variable value will be incremented (from 0 to the trigger-value) until the trigger value is reached. Both the trigger value and the incrementing variable value will be stored in EEPROM on a 18FXXXX PIC.

    What I question is working (comparing the two and incrementing the variable value) with these values using an 8-bit processor. I need a bit of help getting started. How do I dissect and write a large number in EEPROM and then read and reconstruct this for display on a LCD? This is not a time critical-task, the processor will be sitting idol.

    Okay, oaky, I'm a recovering windows programmer and never had to deal with this :-)

    I did search the archives and there were 6xx+ threads, if someone can point me to a particular thread(s), it would be appreciated!

    thx,

    Tim

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ttease View Post
    Hi,

    Okay, I'm new to the fw thing and have a few questions about storing, incrementing and displaying large numer.

    thx,

    Tim
    A thousand different ways to do it...
    One...use byte values, keep 2 digits in each byte
    Byte0 = 0-99 (ones), Byte1 = 0-99 (hundreds), Byte2 = 0-99 (ten thousands), and so on...
    Same thing with words...
    Word0 = 0-9999 (ones), Word1 = 0-9999 (ten thousands)

    If you have to do math on the bytes(words), do the math on one word at a time, roll the 'overflow' into the next byte(word)...
    i.e. 50 + 75 = 125 in byte 0, roll the 100 into the Byte1, keep the 25 in byte0...and so on...and so on...

    After that, it'll be a piece of cake to display on an LCD using the built LCD commands and same thing for storing the number...

Similar Threads

  1. Replies: 4
    Last Post: - 15th April 2009, 01:54
  2. handling Large Numbers
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th April 2007, 02:33
  3. Multiplying large numbers
    By jhonea1 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 14th April 2006, 17:41
  4. How to display large numbers
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th March 2006, 23:17
  5. math problems - large numbers
    By Tomasm in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th February 2004, 07:48

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