Binary code: Difference between revisions

Content deleted Content added
Ahoerstemeier (talk | contribs)
m Binary code on 485 wheels moved to Binary code
it's broader and looser than a just machine code and bytecode
 
Line 1:
{{Short description |Encoded data represented in binary notation}}
The term '''binary code''' can mean several different things:
{{For|the binary form of computer software|Machine code}}
* There are a variety of different methods of coding numbers or symbols into strings of bits, including fixed-length [[binary number]]s, [[prefix code]]s such as [[Huffman code]]s, and other coding techniques including [[arithmetic coding]].
* [[binaryImage:Wikipedia andin textbinary.gif|thumb files]]|The onASCII-encoded computersletters areof "Wikipedia" represented as binary codes.]]
[[Image:Binary to Hexadecimal or Decimal.jpg|thumb |Values represented in binary, hex and decimal]]
* and characters within text files can be represented by any of a number of [[character code]] systems, including [[ASCII]], [[EBCDIC]] and [[Unicode]].
A '''binary code''' is the value of a [[data encoding |data-encoding]] convention represented in a [[Binary number |binary]] notation that usually is a sequence of 0s and 1s; sometimes called a ''[[bit]] string''. For example, [[ASCII]] is an 8-bit text encoding that in addition to the [[human readable]] form (letters) can be represented as binary. ''Binary code'' can also refer to the [[mass noun]] ''code'' that is not human readable in nature such as [[machine code]] and [[bytecode]].
 
Even though all modern computer data is binary in nature, and therefore, can be represented as binary, other [[numerical base]]s are usually used. [[Power of 2]] bases (including [[hexadecimal |hex]] and [[octal]]) are sometimes considered binary code since their power-of-2 nature makes them inherently linked to binary. [[Decimal]] is, of course, a commonly used representation. For example, ASCII characters are often represented as either decimal or hex. Some types of data such as [[image]] data is sometimes represented as hex, but rarely as decimal.
{{disambig}}
 
==History==
[[nn:Binær kode]]
{{further|Binary number#History}}
{{Disputed section|date=April 2015}}
[[File:Gottfried Wilhelm Leibniz, Bernhard Christoph Francke.jpg|thumb|upright|[[Gottfried Leibniz]]]]
 
=== Invention ===
The modern binary number system, the basis for binary code, is an invention by [[Gottfried Leibniz]] in 1689 and appears in his article ''Explication de l'Arithmétique Binaire (''English: ''Explanation of the Binary Arithmetic'') which uses only the characters 1 and 0, and some remarks on its usefulness. Leibniz's system uses 0 and 1, like the modern binary numeral system. Binary numerals were central to Leibniz's intellectual and theological ideas. He believed that binary numbers were symbolic of the Christian idea of ''[[creatio ex nihilo]]'' or creation out of nothing.<ref name="on">{{cite book |author1=Yuen-Ting Lai |url=https://books.google.com/books?id=U9dOmVt81UAC&pg=PA149 |title=Leibniz, Mysticism and Religion |publisher=Springer |year=1998 |isbn=978-0-7923-5223-5 |pages=149–150}}</ref><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> In Leibniz's view, binary numbers represented a fundamental form of creation, reflecting the simplicity and unity of the divine.<ref name="lnz" /> Leibniz was also attempting to find a way to translate logical reasoning into pure mathematics. He viewed the binary system as a means of simplifying complex logical and mathematical processes, believing that it could be used to express all concepts of arithmetic and logic.<ref name="lnz" />
 
=== Previous Ideas ===
Leibniz explained in his work that he encountered the ''[[I Ching]]'' by [[Fu Xi]]<ref name="lnz" /> that dates from the 9th century BC in China,<ref name="HackerMoore2002">{{cite book |author1=Edward Hacker |url=https://books.google.com/books?id=S5hLpfFiMCQC&pg=PR13 |title=I Ching: An Annotated Bibliography |author2=Steve Moore |author3=Lorraine Patsco |publisher=Routledge |year=2002 |isbn=978-0-415-93969-0 |page=13}}</ref> through French Jesuit [[Joachim Bouvet]] and noted with fascination how its [[hexagram (I Ching)|hexagrams]] 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 visual binary [[mathematics]] he admired.<ref>{{Cite book|last=Aiton|first=Eric J.|title=Leibniz: A Biography|year=1985|publisher=Taylor & Francis|isbn=978-0-85274-470-3|pages=245–8}}</ref><ref name="smith" /> Leibniz saw the hexagrams as an affirmation of the universality of his own religious belief.<ref name="smith">{{cite book|author1=J.E.H. Smith|title=Leibniz: What Kind of Rationalist?: What Kind of Rationalist?|url=https://books.google.com/books?id=Da_oP3sJs1oC&pg=PA4153|year=2008|publisher=Springer|isbn=978-1-4020-8668-7|page=415}}</ref> After Leibniz ideas were ignored, 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 Leibniz">{{Cite web|url=http://www.kerryr.net/pioneers/leibniz.htm|title=Gottfried Wilhelm Leibniz (1646 - 1716)|website=www.kerryr.net}}</ref> The binary system of the ''I Ching'' 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=https://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=978-0-8493-7189-9|page=37}}</ref><ref>W. S. Anglin and J. Lambek, ''The Heritage of Thales'', Springer, 1995, {{ISBN|0-387-94544-X}}</ref>
 
[[Mangareva]] people in [[French Polynesia]] were using a hybrid binary-[[decimal]] system before 1450.<ref>{{Cite journal |last1=Bender |first1=Andrea |last2=Beller |first2=Sieghard |date=16 December 2013 |title=Mangarevan invention of binary steps for easier calculation |journal=Proceedings of the National Academy of Sciences |volume=111 |issue=4 |pages=1322–1327 |doi=10.1073/pnas.1309160110 |pmc=3910603 |pmid=24344278 |doi-access=free}}</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 |last=Ryan |first=James A. |date=January 1996 |title=Leibniz' Binary System and Shao Yong's "Yijing" |journal=Philosophy East and West |volume=46 |issue=1 |pages=59–90 |doi=10.2307/1399337 |jstor=1399337}}</ref>
 
[[File:George Boole color.jpg|thumb|upright|[[George Boole]]]]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|author-link=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}}</ref>
 
=== Boolean Logical System ===
[[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">{{Cite web|url=http://www.kerryr.net/pioneers/boolean.htm|title=What's So Logical About Boolean Algebra?|website=www.kerryr.net}}</ref> This system was not put into use until a graduate student from [[Massachusetts Institute of Technology]], [[Claude Shannon]], noticed that the Boolean algebra he learned was similar to an electric circuit. In 1937, Shannon wrote his master's thesis, ''[[A Symbolic Analysis of Relay and Switching Circuits]]'', which implemented his findings. 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">{{Cite web|url=http://www.kerryr.net/pioneers/shannon.htm|title=Claude Shannon (1916 - 2001)|website=www.kerryr.net}}</ref>
 
===Timeline===
* 1875: [[Émile Baudot]] "Addition of binary strings in his ciphering system," which, eventually, led 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]]
 
==Rendering==
{{original research|section|date=March 2015}}
[[File:Bagua-name-earlier.svg|thumb|Daoist Bagua]]
A binary code can be rendered using any two distinguishable indications. In addition to the bit string, other notable ways to render a binary code are described below.
 
; Braille: [[Braille]] is a binary code that is widely used to enable the blind to read and write by touch. The system consists of grids of six dots each, three per column, in which each dot is either raised or flat (not raised). The different combinations of raised and flat dots encode information such as letters, numbers, and punctuation.
 
; Bagua {{anchor|BaGua}}: The ''[[bagua]]'' is a set of diagrams used in ''[[feng shui]],'' [[Taoist]] [[cosmology]] and ''[[I Ching]]'' studies. The ''ba gua'' consists of 8 trigrams; each a combination of three lines (''yáo'') that are either broken ([[Yin and yang|''yin'']]) or unbroken (''yang'').<ref name='wilhelm'>{{cite book |last=Wilhelm |first=Richard |author-link=Richard Wilhelm (sinologist) |others=trans. by [[Cary F. Baynes]], foreword 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=https://books.google.com/books?id=bbU9AAAAIAAJ&pg=PA266 |isbn=978-0-691-09750-3 |pages=266, 269}}</ref>
 
; Ifá{{anchor|Ifá}}: The [[Ifá]]/Ifé system of divination in African religions, such as of [[Yoruba people |Yoruba]], [[Igbo people |Igbo]], and [[Ewe people |Ewe]], consists of an elaborate traditional ceremony producing 256 oracles made up by 16 symbols with 256 = 16 x 16. A priest, or [[Babalawo]], requests sacrifice from consulting clients and makes prayers. Then, divination [[nut (fruit)|nuts]] or a pair of [[chain]]s are used to produce random binary numbers,<ref>{{Cite book |last=Olupona |first=Jacob K. |title=African Religions: A Very Short Introduction |publisher=[[Oxford University Press]] |year=2014 |isbn=978-0-19-979058-6 |___location=Oxford |pages=45 |oclc=839396781}}</ref> which are drawn with sandy material on an "Opun" figured wooden tray representing the totality of fate.<ref>{{Cite web|last=Eglash|first=Ron|date=June 2007|title=The fractals at the heart of African designs|url=https://www.ted.com/talks/ron_eglash_the_fractals_at_the_heart_of_african_designs/up-next#t-13472|url-status=live|access-date=2021-04-15|website=www.ted.com|archive-url=https://web.archive.org/web/20210727161435/https://www.ted.com/talks/ron_eglash_the_fractals_at_the_heart_of_african_designs/up-next |archive-date=2021-07-27 }}</ref>
 
==Encoding==
[[File:2D Binary Index.svg|thumb|An example of a recursive [[binary space partitioning]] [[quadtree]] for a 2D index]]
Innumerable encoding systems exists. Some notable examples are described here.
 
; ASCII: The [[American Standard Code for Information Interchange]] (ASCII) character encoding, is a 7-bit convention for representing (normal/printing) characters and [[Control character |control]] operations. Each printing and control character is assigned a number from 0 to 127. For example, "a" is represented by decimal code 97 which is rendered as bit string <code>1100001</code>.
 
; Binary-coded decimal: [[Binary-coded decimal]] (BCD) is an encoding of integer values that consists of a 4-bit [[nibble]] for each decimal digit. As a decimal digit is only 1 of 10 values (0 to 9) but 4 bits can encode up to 16 values, and BCD element is invalid for a value greater than 9.<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>
 
==See also==
* {{Annotated link |Binary file}}
* {{Annotated link |Bit array}}
* {{Annotated link |Constant-weight code}}
* {{Annotated link |Gray code}}
* {{Annotated link |List of binary codes}}
* {{Annotated link |Unicode}}
 
==References==
{{reflist}}
 
==External links==
* {{usurped|1=[https://web.archive.org/web/20160923014940/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 |author1=M.R. Best |author2=A.E. Brouwer |author3=F.J. MacWilliams |author4=A.M. Odlyzko |author5=N.J.A. Sloane |title=Bounds for Binary Codes of Length Less than 25 |journal=IEEE Trans. Inf. Theory |volume=24 |year=1978 |pages=81–93 |doi=10.1109/tit.1978.1055827|citeseerx=10.1.1.391.9930 }}.
* [https://web.archive.org/web/20170423014446/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 = 978-0-938228-00-4}} cites some pre-ENIAC milestones.
* [https://www.amazon.it/01010011-01100101-01100111-01110010-01110100/dp/B0CHD5Q8W1/ref=sr_1_1?qid=1694173977&refinements=p_27:%22Luigi+Usai%22&s=books&sr=1-1&ufe=app_do:amzn1.fos.9d4f9b77-768c-4a4e-94ad-33674c20ab35 First book in the world fully written in binary code]: (<abbr>IT</abbr>) Luigi Usai, ''01010011 01100101 01100111 01110010 01100101 01110100 01101001'', Independently published, 2023, <nowiki>ISBN 979-8-8604-3980-1</nowiki>. <small>URL consulted September 8, 2023</small>.
 
[[Category:Computer data]]
[[Category:English inventions]]
[[Category:Encodings]]
[[Category:Gottfried Wilhelm Leibniz]]
[[Category:2 (number)]]