Why Gray Code??????


 As we all know that for Altitude encoding we use grey code instead of Binary....but why???? 


In Transponder (mode C) altitude is reported in 100 ft increment.If we goes from one zone to another zone (Altitude change)  the bit will change .

If we use Binary coding than:--- 

Zone 0 is represented by ABC = 0 0 0 
Zone 1 is represented by ABC = 0 0  1
Zone 2 is represented by ABC = 0  1 0

If object moves from Zone 1 to Zone 2 ,both B & C has to change to sense that movement & suppose sensor B (may be an electro mechanical switch ) reacts slightly late than sensor C ,then initially   ABC =000 will be sensed as if the object has moved in the other direction from Zone 1 to Zone 0.
This problem can be more prominent if the object moves from Zone-3 (ABC=011) to                    Zone-4(ABC=100) ,when all three sensor has to change its value.

Now, If Zones are grey coded,such problem does not appear as between two consecutive zones only one sensor changes its value. 

                                 0            1                2                   3                           4
   Sensor ABC
(Binary Coded)  000         001            010               011                         100 

 Sensor  ABC     000          001           011                010                        110
(Gray Code)

Normally In transponder,where the 100 ft increment coding has to be done,the coding are in this way.

  8        9       0       1          2                              3                  4                  5                 6                7
   001  011   010   110     100         ↔             100              110             010              011             001
                                                  Reflection

The disadvantage with grey code is that it is not good for arithmetic operation.

                                   

Comments