gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AIS message 1, Rate of turn


From: Gary E. Miller
Subject: Re: AIS message 1, Rate of turn
Date: Thu, 18 May 2023 12:04:06 -0700

Yo Владимир!

On Thu, 18 May 2023 15:53:29 +0300
Владимир Калачихин <v.kalachikhin@gmail.com> wrote:

> I am, of course, stupid, but:
> 
> https://www.navcen.uscg.gov/ais-class-a-reports :
> 'Rate of turn' field has 8 bits.
> It may contain:
> "-127 = turning left at more than 5 deg per 30 s (No TI available)"
> 
> How to cram in 8 bits the '-127' number?
> 
> 
> Next:
> "-128 (80 hex) indicates no turn information available (default)."
> 
> But '80 hex' === 128, not the -128.
> 
> Can anyone clarify?

That's just the way twos complement binary works.

I can't improve upon Wikipedia:

    https://en.wikipedia.org/wiki/Two%27s_complement

Maybe think of it as 7 bits and the sign bit, but 128 is a fudge.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgppzbvALVU5d.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]