Re: modulo reset [message #41700] |
Tue, 23 November 2004 08:39  |
Ralf Schaa
Messages: 37 Registered: June 2001
|
Member |
|
|
Wayne Landsman wrote:
> Ralf Schaa wrote:
>
>> I'm reading out some binary data and the description says this about a
>> data field :
>>
>> in the case of a modulo reset add 2^32
>>
>> What is this about? googling for "modulo reset" didn't get me far;
>> I only imagine that I need some kind of overflow to get things fixed,
>> but it is very unclear to me what is happening and why ...
>
>
> Well, my first guess is that you are working with unsigned 32bit
> integers which have a maximum value of 2^32-1, and then resets to zero.
>
> STIS>print,2UL^31,2UL^32
> 2147483648 0
>
> The easiest way to correct for this reset would be to use 64 bit integers
>
> data = ulong64(datafield) + 2ULL^32
>
> A less likely possiblity is that "modulo reset" refers to a 32bit
> checksum, e.g. as implemented in
> http://idlastro.gsfc.nasa.gov/ftp/pro/misc/checksum32.pro
> which includes links to more documentation.
thanks wayne,
but the problem is this:
I am reading binary data (not longer than 32 bit, and I store it in ULL as suggested)
and the 'modulo reset' I talked about may appear at one datafield: that is in an accumulated
"Doppler" cycle count.
By differentiating with respect to time, one can get the true doppler count.
Than the documentation says, when a modula reset occurs , add 2^32.
I think, this means when the counter is full and is starting with zero again. than add the 2^32.
But I don't see what adding 2^32 exactly would do ...
further suggestions?
-Ralf
|
|
|