Decimal to Register conversion

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Decimal to Register conversion

#1 Post by rdonnay »

I am working on a customer application that retrieves data from a PC board via IP.
The board scans a card that has an embedded number.
The data is returned as 5 decimal values from 5 registers.

The number printed on the card is 31152.
The data is returned in 5 registers:
RegE: 0
RegD: 2
RegC: 202
RegB: 243
RegA: 96

I cannot figure out how the values in these registers equals 31152.
I try to assign different binary weights to each register but it never adds up to 31152.

Any ideas?

Here is another one:

Number of card is 62081
RegE: 0
RegD: 3
RegC: 115
RegB: 229
RegA: 2

One more:

Number of card is 38463
RegE: 0
RegD: 0
RegC: 19
RegB: 44
RegA: 127
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: Decimal to Register conversion

#2 Post by bwolfsohn »

it's simple algebra...

If i could remember simple algebra, i'd help you..

but it's gotten so bad i can't even remember what crs IS.. :lol: :lol:
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Decimal to Register conversion

#3 Post by rdonnay »

I figured it out.
It appears that the data in the registers are all shifted left by 1 bit.

I had to take that into consideration.
The eXpress train is coming - and it has more cars.

Post Reply