Appendix D. Gray Codes
Gray, But Not Gloomy
When moving between states in a standard binary sequence, multiple bits may change from 0 to 1 or vice versa; for example, two bits change value when moving from 00102 to 01002. In the physical world there is no way to ensure that both bits will transition at exactly the same time, so this system may actually pass through an intermediate state. That is, our intended state change of 00102 to 01002 might result in the sequence 00102 to 01102 to 01002, or possibly 00102 to 00002 to 01002. And if more bits are changing, we might bounce though a series of intermediate values.
One way to avoid this problem is to use a Gray code,[1] in which only a single bit changes when moving between states (Figure D.1 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access