Gray code: Difference between revisions

Content deleted Content added
Function: rm invalid description list abused for unnecessary indentation
Tags: Mobile edit Mobile web edit Advanced mobile edit
Invention: again; don't use ellipsis character
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 34:
[[George R. Stibitz]] described such a code in a 1941 patent application, granted in 1943.<ref name="Stibitz_1941"/><ref name="Winder_1959"/><ref name="Knuth_2014"/> [[Frank Gray (researcher)|Frank Gray]] introduced the term ''reflected binary code'' in his 1947 patent application, remarking that the code had "as yet no recognized name".<ref name="Gray_1947"/> He derived the name from the fact that it "may be built up from the conventional binary code by a sort of reflection process".
 
In the standard encoding of the Gray Code the least significant bit follows a repetitive pattern of 2 on, 2 off {{nowrap|(... {{mono|11001100}} ...);}} the next digit a pattern of 4 on, 4 off; the ''i''-th least significant bit a pattern of 2<sup>''i''</sup> on 2<sup>''i''</sup> off. The most significant digit is an exception to this: for an ''n''-bit Gray code, the most significant digit follows the pattern 2<sup>''n''-1</sup> on, 2<sup>''n''-1</sup> off, which is the same (cyclic) sequence of values as for the second-most significant digit, but shifted forwards 2<sup>''n''-2</sup> places. The four-bit version of this is shown below:
 
[[File:Gray_code_tesseract.svg|thumb|Visualized as a traversal of [[Vertex (graph theory)|vertices]] of a [[tesseract]]]]
[[File:Gray code number line arcs.svg|thumb|Gray code along the number line]]
 
: {| class="wikitable sortable" style="text-align:center;"
|-
! Decimal !! Binary !! Gray