Content deleted Content added
removed request for citation for an obvious, but relevant fact |
→Decoding: removed gratituitous requests for citation of obvious facts. The "Gray Code" page is already cited. |
||
Line 56:
== Decoding ==
The Gillham code is an unusual mix of codes. It is a parallel binary code that uses a Gray code to ensure that there are not multiple bit changes between adjacent altitudes. The bit pattern is split into those bits used to indicate the number of 500 ft increments and those used to indicate the number of 100 ft increments. The split is as follows.
Bits D1–B4 use a standard Gray code to store the number of 500 ft increments.<ref name="Code Explanation" />
Bits C1–C4 use a non-linear reflected Gray code to store the number of 100 ft increments +1. The values when converted to decimal follow this repeating pattern: 1 2 3 4 7 7 4 3 2 1 1 2 3 4 7 ....
The C bits must be converted from Gray to standard binary, the 7 changed to a 5 and the reflected order changed when the 500 ft increment is even.
The number resulting from combining the above gives the flight level above the minimum datum (−1200 ft). This offset must be removed to give a corrected altitude value.
The Gillham code can be decoded using various methods. Standard techniques use hardware <ref name="Decoder Patent">[http://www.freepatentsonline.com/3805041.pdf Circuit to decode Gillham code]</ref> or software solutions. The latter often uses a lookup table but an algorithmic approach can be taken.<ref name="Algorithm C code">[http://www.ccsinfo.com/forum/viewtopic.php?p=77544 Aviation Gray Code, software decoding function in C language]</ref>
|