Page 1 of 1

Decimal to Register conversion

Posted: Fri Mar 09, 2018 7:09 pm
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

Re: Decimal to Register conversion

Posted: Sat Mar 10, 2018 9:19 am
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:

Re: Decimal to Register conversion

Posted: Sat Mar 10, 2018 3:58 pm
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.