Jump to content

Binary code: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Reverting possible vandalism by 96.230.96.162 to version by Gilliam. Report False Positive? Thanks, ClueBot NG. (2596297) (Bot)
Line 1: Line 1:
ode, was discovered by [[Gottfried Leibniz]] in 1679 and appears in his article ''Explication de l'Arithmétique Binaire''. The full title i
[[Image:Wikipedia in binary.gif|thumb|The word 'Wikipedia' represented in [[ASCII]] binary.]]

A '''binary code''' represents [[Plain text|text]] or [[Instruction set|computer processor instructions]] using the [[binary number|binary number system]]'s two binary [[Numerical digit|digit]]s, 0 and 1. The binary code assigns a [[bit]] string to each symbol or instruction. For example, a binary [[String (computer science)|string]] of eight binary digits ([[bit]]s) can represent any of 256 possible values and can therefore correspond to a variety of different symbols, letters or instructions.

In computing and telecommunications, binary codes are used for various methods of [[encoding]] data, such as [[character string]]s, into bit strings. Those methods may use fixed-width or [[variable-length code|variable-width]] strings. In a fixed-width binary code, each letter, digit, or other character is represented by a bit string of the same length; that bit string, interpreted as a [[binary number]], is usually displayed in code tables in [[octal]], [[decimal]] or [[hexadecimal]] notation. There are many [[character sets]] and many [[character encoding]]s for them.

A bit string, interpreted as a binary number, can be [[Binary number#Decimal|translated into a decimal number]]. For example, the [[Letter case|lower case]] ''a'', if represented by the bit string 01100001 (as it is in the standard [[ASCII]] code), can also be represented as the decimal number 97.

==History of binary code==
{{Multiple issues|section=yes|
{{Disputed-section|date=April 2015}}
{{POV-section|date=April 2015}}
}}
{{further|Binary number#History}}
[[File:Gottfried Wilhelm von Leibniz.jpg|thumb|upright|[[Gottfried Leibniz]]]]
The modern binary number system, the basis for binary code, was discovered by [[Gottfried Leibniz]] in 1679 and appears in his article ''Explication de l'Arithmétique Binaire''. The full title is translated into English as the "Explanation of the binary arithmetic", which uses only the characters 1 and 0, with some remarks on its usefulness, and on the light it throws on the ancient Chinese figures of [[Fu Xi]]."<ref name=lnz>Leibniz G., Explication de l'Arithmétique Binaire, Die Mathematische Schriften, ed. C. Gerhardt, Berlin 1879, vol.7, p.223; Engl. transl.[http://www.leibniz-translations.com/binary.htm]</ref> (1703). Leibniz's system uses 0 and 1, like the modern binary numeral system. Leibniz encountered the ''[[I Ching]]'' through French Jesuit [[Joachim Bouvet]] and noted with fascination how its [[hexagram]]s correspond to the binary numbers from 0 to 111111, and concluded that this mapping was evidence of major Chinese accomplishments in the sort of philosophical [[mathematics]] he admired.<ref>{{Cite book|last=Aiton|first=Eric J.|title=Leibniz: A Biography|year=1985|publisher=Taylor & Francis|isbn=0-85274-470-6|pages=245–8|postscript=<!--None-->}}</ref><ref name="smith"/> Leibniz saw the hexagrams as an affirmation of the universality of his own religious beliefs.<ref name="smith">{{cite book|author1=J.E.H. Smith|title=Leibniz: What Kind of Rationalist?: What Kind of Rationalist?|url=http://books.google.com/books?id=Da_oP3sJs1oC&pg=PA4153|year=2008|publisher=Springer|isbn=978-1-4020-8668-7|page=415}}</ref>

Binary numerals were central to Leibniz's theology. He believed that binary numbers were symbolic of the Christian idea of ''[[ex nihilo|creatio ex nihilo]]'' or creation out of nothing.<ref name="lniz">{{cite book|author1=Yuen-Ting Lai|title=Leibniz, Mysticism and Religion|url=http://books.google.com/books?id=U9dOmVt81UAC&pg=PA149|year=1998|publisher=Springer|isbn=978-0-7923-5223-5|pages=149–150}}</ref> Leibniz was trying to find a system that converts logic’s verbal statements into a pure mathematical one. After his ideas were ignored, he came across a classic Chinese text called ''I Ching'' or ‘Book of Changes’, which used a type of binary code. The book had confirmed his theory that life could be simplified or reduced down to a series of straightforward propositions. He created a system consisting of rows of zeros and ones. During this time period, Leibniz had not yet found a use for this system.<ref name="Gottfried Leibiniz">[http://www.kerryr.net/pioneers/leibniz.htm Gottfried Wilhelm Leibniz (1646-1716)]</ref>

Binary systems predating Leibniz also existed in the ancient world. The aforementioned ''I Ching'' that Leibniz encountered dates from the 9th century BC in China.<ref name="HackerMoore2002">{{cite book|author1=Edward Hacker|author2=Steve Moore|author3=Lorraine Patsco|title=I Ching: An Annotated Bibliography|url=http://books.google.com/books?id=S5hLpfFiMCQC&pg=PR13|year=2002|publisher=Routledge|isbn=978-0-415-93969-0|page=13}}</ref> The binary system of the ''I Ching'', a text for divination, is based on the duality of [[yin and yang]].<ref name="scientific">{{cite book|author1=Jonathan Shectman|title=Groundbreaking Scientific Experiments, Inventions, and Discoveries of the 18th Century|url=http://books.google.com/books?id=SsbChdIiflsC&pg=PA29|year=2003|publisher=Greenwood Publishing|isbn=978-0-313-32015-6|page=29}}</ref> [[Slit drum]]s with binary tones are used to encode messages across Africa and Asia.<ref name="scientific"/> The Indian scholar [[Pingala]] (around 5th–2nd centuries BC) developed a binary system for describing [[prosody (poetry)|prosody]] in his Chandashutram.<ref>{{Cite book|last1=Sanchez|first1=Julio|last2=Canton|first2=Maria P.|title=Microcontroller programming: the microchip PIC|year=2007|publisher=CRC Press|location=Boca Raton, Florida|isbn=0-8493-7189-9|page=37|postscript=<!--None-->}}</ref><ref>W. S. Anglin and J. Lambek, ''The Heritage of Thales'', Springer, 1995, ISBN 0-387-94544-X</ref>

[[File:George Boole color.jpg|thumb|upright|[[George Boole]]]]
The residents of the island of [[Mangareva]] in [[French Polynesia]] were using a hybrid binary-[[decimal]] system before 1450.<ref>{{Cite journal|last=Bender|first=Andrea|last2=Beller|first2=Sieghard|title=Mangarevan invention of binary steps for easier calculation|journal=Proceedings of the National Academy of Sciences|volume=|issue=|date=16 December 2013|doi=10.1073/pnas.1309160110}}</ref> In the 11th century, scholar and philosopher [[Shao Yong]] developed a method for arranging the hexagrams which corresponds, albeit unintentionally, to the sequence 0 to 63, as represented in binary, with yin as 0, yang as 1 and the [[least significant bit]] on top. The ordering is also the [[lexicographical order]] on [[sextuple]]s of elements chosen from a two-element set.<ref>{{cite journal |doi=10.2307/1399337 |title=Leibniz' Binary System and Shao Yong's "Yijing" |first=James A. |last=Ryan |journal=Philosophy East and West |volume=46 |issue=1 |date=January 1996 |pages=59–90 |publisher=University of Hawaii Press |jstor=1399337}}</ref>

In 1605, [[Francis Bacon]] discussed a system whereby letters of the alphabet could be reduced to sequences of binary digits, which could then be encoded as scarcely visible variations in the font in any random text.<ref name="Bacon1605" /> Importantly for the general theory of binary encoding, he added that this method could be used with any objects at all: "provided those objects be capable of a twofold difference only; as by Bells, by Trumpets, by Lights and Torches, by the report of Muskets, and any instruments of like nature".<ref name="Bacon1605">{{Cite web|last=Bacon|first=Francis|authorlink=Francis Bacon|title=The Advancement of Learning|url=http://home.hiwaay.net/~paul/bacon/advancement/book6ch1.html|year=1605|volume=6|location=London|pages=Chapter 1|postscript=<!--None-->}}</ref>

Another mathematician and philosopher by the name of [[George Boole]] published a paper in 1847 called 'The Mathematical Analysis of Logic' that describes an algebraic system of logic, now known as [[Boolean algebra (logic)|Boolean algebra]]. Boole’s system was based on binary, a yes-no, on-off approach that consisted of the three most basic operations: AND, OR, and NOT.<ref name="Boolean operations">[http://www.kerryr.net/pioneers/boolean.htm What's so logical about boolean algebra?]</ref> This system was not put into use until a graduate student from [[Massachusetts Institute of Technology]] by the name of [[Claude Shannon]] noticed that the Boolean algebra he learned was similar to an electric circuit. Shannon wrote his thesis in 1937, which implemented his findings. [[A Mathematical Theory of Communication|Shannon's thesis]] became a starting point for the use of the binary code in practical applications such as computers, electric circuits, and more.<ref name="Claude Shannon">[http://www.kerryr.net/pioneers/shannon.htm Claude Shannon(1916-2001)]</ref>

==Other forms of binary code==
{{original research|section|date=March 2015}}
[[File:Bagua-name-earlier.svg|thumb|Daoist Bagua]]
{{Main|List of binary codes}}
The bit string is not the only type of binary code. A binary system in general is any system that allows only two choices such as a switch in an electronic system or a simple true or false test.

===Braille===
[[Braille]] is a type of binary code that is widely used by blind people to read and write. This system consists of 6-dot positions, three in each column. Each dot has two states: raised or not raised. This official Braille code was based on Braille's publication of 1837, in which the six-dot code accounted for all letters, numbers, and punctuation signs. Braille, however, had almost perfected his system by 1829 when he published the book, Procedure for Writing Words, Music, and Plainsong in Dots.

===Bagua {{anchor|BaGua}}===
The ''[[bagua]]'' are diagrams used in ''[[feng shui]],'' [[Taoist]] [[cosmology]] and ''[[I Ching]]'' studies. The ''ba gua'' consists of 8 trigrams; ''bā'' meaning 8 and ''guà'' meaning divination figure. The same word is used for the 64 guà (hexagrams). Each figure combines three lines (''yáo'') that are either broken ([[Yin and yang|''yin'']]) or unbroken (''yang''). The relationships between the trigrams are represented in two arrangements, the primordial, "Earlier Heaven" or "Fuxi" ''bagua'', and the manifested, "Later Heaven,"or "King Wen" ''bagua.''<ref name='wilhelm'>{{cite book |last=Wilhelm |first=Richard |others=trans. by Cary F. Baynes, forward by C. G. Jung, preface to 3rd ed. by Hellmut Wilhelm (1967) |title=The I Ching or Book of Changes |publisher=Princeton University Press |year=1950 |location=Princeton, NJ |url=http://books.google.com/books?id=bbU9AAAAIAAJ&lpg=PA266&pg=PA266 |isbn=0-691-09750-X |pages=266, 269}}</ref> (See also, the [[King Wen sequence]] of the 64 hexagrams).

===Ifá divination {{anchor|IFÁ Oracle}}===
<div style="float:right; margin-left:0.5em;" title="The order varies, depending on region.">
{| class="infobox" style="text-align:center;font-weight:bold;letter-spacing:0.14em;padding:0.5em;"
|-
|colspan=11 style="text-align:center;letter-spacing:normal;font-size:111%"| {{color|#933|Sixteen}} {{color|#096|Principal Odú}}
|-
|style="text-align:left;letter-spacing:normal;"| ''Ogbe''  || I || I || I || I ||   ||style="text-align:left;letter-spacing:normal;"| ''Ogunda''  || I || I || I || II
|-
|style="text-align:left;letter-spacing:normal;"| ''Oyẹku''  || II || II || II || II ||   ||style="text-align:left;letter-spacing:normal;"| ''Ọsa''  || II || I || I || I
|-
|style="text-align:left;letter-spacing:normal;"| ''Iwori''  || II || I || I || II ||   ||style="text-align:left;letter-spacing:normal;"| ''Ika''  || II || I || II || II
|-
|style="text-align:left;letter-spacing:normal;"| ''Odi''  || I || II || II || I ||   ||style="text-align:left;letter-spacing:normal;"| ''Oturupọn''  || II || II || I || II
|-
|style="text-align:left;letter-spacing:normal;"| ''Irosun''  || I || I || II || II ||   ||style="text-align:left;letter-spacing:normal;"| ''Otura''  || I || II || I || I
|-
|style="text-align:left;letter-spacing:normal;"| ''Iwọnrin''  || II || II || I || I ||   ||style="text-align:left;letter-spacing:normal;"| ''Irẹtẹ''  || I || I || II || I
|-
|style="text-align:left;letter-spacing:normal;"| ''Ọbara''  || I || II || II || II ||   ||style="text-align:left;letter-spacing:normal;"| ''Ọsẹ''  || I || II || I || II
|-
|style="text-align:left;letter-spacing:normal;"| ''Ọkanran''  || II || II || II || I ||   ||style="text-align:left;letter-spacing:normal;"| ''Ofun''  || II || I || II || I
|}</div>''[[Ifá]]'' is the ancient system of divination and literary corpus of the [[Yoruba people]] of [[Nigeria]]. In [[Yoruba religion]], the rite provides a means of communication with spiritual divinity. The [[Orisa]] Ifá or [[Orunmila]] ("Grand Priest") permits access to an initiated priest, a [[Babalawo]] ("father of the secrets") who generates binary values using sacred palm nuts. In wood powder, these are recorded as single and double lines. There are 16 principal ''Odú'' that are said to compose the 256 ''Odú''. From memory alone, a Babalawo must be able to recite four to ten verses for each of the 256 ''Odú Ifá:'' generally, orisa lore, [[Traditional African medicine|traditional medicine]], and ritual advice. In 2005, [[UNESCO]] listed Ifá in the [[Masterpieces of the Oral and Intangible Heritage of Humanity]].

==Coding systems==

===ASCII code===
The [[ASCII|American Standard Code for Information Interchange (ASCII)]], uses a 7-bit binary code to represent text and other characters within computers, communications equipment, and other devices. Each letter or symbol is assigned a number from 0 to 127. For example, lowercase "a" is represented by 1100001 as a bit string (which is 97 in decimal).

===Binary-coded decimal===
[[Binary-coded decimal]], or BCD, is a binary encoded representation of integer values that uses a 4-bit [[nibble]] to encode decimal digits. Four binary bits can encode up to 16 distinct values; but, in BCD-encoded numbers, only the first ten values in each nibble are legal, and encode the decimal digits zero, through nine. The remaining six values are illegal, and may cause either a machine exception or unspecified behavior, depending on the computer implementation of BCD arithmetic.

BCD arithmetic is sometimes preferred to floating-point numeric formats in commercial and financial applications where the complex rounding behaviors of floating-point numbers is inappropriate.<ref name="Cowlishaw_GDA">{{cite web |first=Mike F. |last=Cowlishaw |author-link=Mike F. Cowlishaw |title=General Decimal Arithmetic |orig-year=1981,2008 |publisher=IBM |date=2015 |url=http://speleotrove.com/decimal/<!-- http://www2.hursley.ibm.com/decimal/ --> |access-date=2016-01-02}}</ref>

==Early uses of binary codes==

* 1875: [[Émile Baudot]] "Addition of binary strings in his ciphering system," which, eventually, lead to the ASCII of today.
* 1884: The [[Linotype machine]] where the matrices are sorted to their corresponding channels after use by a binary-coded slide rail.
* 1932: [[C. E. Wynn-Williams]] "Scale of Two" counter<ref name="Glaser">{{Harvnb|Glaser|1971}}</ref>
* 1937: [[Alan Turing]] electro-mechanical binary multiplier
* 1937: [[George Stibitz]] [[Excess three code|"excess three" code]] in the [[George Stibitz#Computer|Complex Computer]]<ref name="Glaser"/>
* 1937: [[Atanasoff-Berry Computer]]<ref name="Glaser"/>
* 1938: [[Konrad Zuse]] [[Z1 (computer)|Z1]]

==Current uses of binary==
Most modern computers use binary encoding for instructions and data. [[CD]]s, [[DVD]]s, and [[Blu-ray Disc]]s represent sound and video digitally in binary form. Telephone calls are carried digitally on long-distance and mobile phone networks using [[pulse-code modulation]], and on [[voice over IP]] networks.

==Weight of binary codes==
The weight of a binary code, as defined in the table of [[constant-weight code]]s,<ref>[http://www.research.att.com/~njas/codes/Andw/ Table of Constant Weight Binary Codes]</ref> is the [[Hamming weight]] of the binary words coding for the represented words or sequences.

==See also==
* [[Binary number]]
* [[List of binary codes]]
* [[Binary file]]
* [[Unicode]]
* [[Gray code]]

==References==
{{reflist}}

==External links==
* [http://www.baconlinks.com/docs/BILITERAL.doc Sir Francis Bacon's BiLiteral Cypher system], predates binary number system.
* {{MathWorld |urlname=Error-CorrectingCode |title=Error-Correcting Code}}
* [http://www.win.tue.nl/~aeb/codes/binary.html Table of general binary codes]. An updated version of the tables of bounds for small general binary codes given in {{citation |author=M.R. Best, A.E. Brouwer, F.J. MacWilliams, A.M. Odlyzko & N.J.A. Sloane |title=Bounds for Binary Codes of Length Less than 25 |journal=IEEE Trans. Inf. Th. |volume=24 |year=1978 |pages=81–93}}.
* [http://www.eng.tau.ac.il/~litsyn/tableand/ Table of Nonlinear Binary Codes]. Maintained by Simon Litsyn, E. M. Rains, and N. J. A. Sloane. Updated until 1999.
* {{Cite book | last = Glaser | first = Anton | title = History of Binary and other Nondecimal Numeration | publisher = Tomash | year = 1971 | chapter = Chapter VII Applications to Computers | isbn = 0-938228-00-5}} cites some pre-ENIAC milestones.

[[Category:Computer data]]
[[Category:English inventions]]
[[Category:Encodings]]
[[Category:Gottfried Leibniz]]
[[Category:Cryptographic algorithms]]

Revision as of 15:37, 22 March 2016

ode, was discovered by Gottfried Leibniz in 1679 and appears in his article Explication de l'Arithmétique Binaire. The full title i