Splitting numbers and recombining them(EEPROM Error)


Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102

    Default Splitting numbers and recombining them(EEPROM Error)

    Math issue

    I wrote the following numbers to the eeprom
    Position 31 till 40 (included)
    Code:
    2118:  00  00  00  00  00  00  00  03	........ (Position 24 - 31)
    2120:  02  02  06  04  00  03  02  00	........ (Position 32 - 39)
    2128:  01  10  27  64  00  00  00  00	..'d.... (Position 40 - 47)
    Then I wrote the following

    Code:
        READ 31, TenThousand
        READ 32, Thousand
        READ 33, Hundred
        REAd 34, Ten
        READ 35, One
        
        READ 36, BThousand
        READ 37, BHundred
        READ 38, BTen
        READ 39, BOne
        
        Numbers = (TenThousand * 10000) + (Thousand * 1000) + (Hundred * 100) + (Ten * 10) + One
        B = (BThousand * 1000) + (BHundred * 100) + (BTen * 10) + BOne
        
    	WRITE 41, Numbers.Byte0
    	WRITE 42, Numbers.BYte1
    	
    	WRITE 43, B.Byte0
    	WRITE 44, B.Byte1
    Result - as seen in the code above - is for numbers 10 and 27 and for B 64 and 00.

    But being combined and converted to decimal numbers this is not 32264 and 320.

    Why ?
    Last edited by selbstdual; - 3rd June 2007 at 02:33.

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