A binary code represents
text,
computer processor instructions, or any other
data using a two-symbol system. The two-symbol system used is often "0" and "1" from the
binary number system
A binary number is a number expressed in the base-2 numeral system or binary numeral system, a method of mathematical expression which uses only two symbols: typically "0" (zero) and "1" ( one).
The base-2 numeral system is a positional notation ...
. The binary code assigns a pattern of binary digits, also known as
bits, to each character, instruction, etc. For example, a binary
string
String or strings may refer to:
*String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects
Arts, entertainment, and media Films
* ''Strings'' (1991 film), a Canadian anim ...
of eight bits (which is also called a byte) can represent any of 256 possible values and can, therefore, represent a wide variety of different items.
In computing and telecommunications, binary codes are used for various methods of
encoding data, such as
character strings, into bit strings. Those methods may use fixed-width or
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
A binary number is a number expressed in the base-2 numeral system or binary numeral system, a method of mathematical expression which uses only two symbols: typically "0" (zero) and "1" ( one).
The base-2 numeral system is a positional notatio ...
, is usually displayed in code tables in
octal,
decimal
The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers of the Hindu–Arabic numeral ...
or
hexadecimal
In mathematics and computing, the hexadecimal (also base-16 or simply hex) numeral system is a positional numeral system that represents numbers using a radix (base) of 16. Unlike the decimal system representing numbers using 10 symbols, hexa ...
notation. There are many
character sets and many
character encodings for them.
A
bit string, interpreted as a binary number, can be
translated into a decimal number. For example, the
lower case
Letter case is the distinction between the letters that are in larger uppercase or capitals (or more formally ''majuscule'') and smaller lowercase (or more formally ''minuscule'') in the written representation of certain languages. The writing ...
''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 codes
The modern binary number system, the basis for binary code, was invented by
Gottfried Leibniz in 1689 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.
[Leibniz G., Explication de l'Arithmétique Binaire, Die Mathematische Schriften, ed. C. Gerhardt, Berlin 1879, vol.7, p.223; Engl. trans]
/ref> Leibniz's system uses 0 and 1, like the modern binary numeral system. Leibniz encountered the ''I Ching
The ''I Ching'' or ''Yi Jing'' (, ), usually translated ''Book of Changes'' or ''Classic of Changes'', is an ancient Chinese divination text that is among the oldest of the Chinese classics. Originally a divination manual in the Western Zho ...
'' through French Jesuit Joachim Bouvet and noted with fascination how its hexagrams
, can be seen as a compound composed of an upwards (blue here) and downwards (pink) facing equilateral triangle, with their intersection as a regular hexagon (in green).
A hexagram ( Greek language, Greek) or sexagram (Latin) is a six-pointed ...
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
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
he admired. Leibniz saw the hexagrams as an affirmation of the universality of his own religious belief.
Binary numerals were central to Leibniz's theology. He believed that binary numbers were symbolic of the Christian idea of '' creatio ex nihilo'' or creation out of nothing. Leibniz was trying to find a system that converts logic 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 64 hexagrams of six-bit visual 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.
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. The binary system of the ''I Ching'', a text for divination, is based on the duality of yin and yang. Slit drums with binary tones are used to encode messages across Africa and Asia. The Indian scholar Pingala (around 5th–2nd centuries BC) developed a binary system for describing prosody in his ''Chandashutram''.
The residents of the island of Mangareva in French Polynesia
)Territorial motto: ( en, "Great Tahiti of the Golden Haze")
, anthem =
, song_type = Regional anthem
, song = " Ia Ora 'O Tahiti Nui"
, image_map = French Polynesia on the globe (French Polynesia centered).svg
, map_alt = Location of Frenc ...
were using a hybrid binary-decimal
The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers of the Hindu–Arabic numeral ...
system before 1450. In the 11th century, scholar and philosopher Shao Yong
Shao Yong (; 1011–1077), courtesy name Yaofu (堯夫), named Shào Kāngjié (邵康節) was a
Chinese cosmologist, historian, philosopher, and poet who greatly influenced the development of Neo-Confucianism across China during the Song dynast ...
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
In computing, bit numbering is the convention used to identify the bit positions in a binary number.
Bit significance and indexing
In computing, the least significant bit (LSB) is the bit position in a binary integer representing the binary 1 ...
on top. The ordering is also the lexicographical order
In mathematics, the lexicographic or lexicographical order (also known as lexical order, or dictionary order) is a generalization of the alphabetical order of the dictionaries to sequences of ordered symbols or, more generally, of elements of a ...
on sextuples of elements chosen from a two-element set.
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. 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".
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. 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. 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.
Other forms of binary code
The bit string is not the only type of binary code: in fact, 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 the blind to read and write by touch, named for its creator, Louis Braille. This system consists of grids of six dots each, three per column, in which each dot has two states: raised or not raised. The different combinations of raised and flattened dots are capable of representing all letters, numbers, and punctuation signs.
Bagua
The '' bagua'' are diagrams used in '' feng shui,'' Taoist cosmology and ''I Ching
The ''I Ching'' or ''Yi Jing'' (, ), usually translated ''Book of Changes'' or ''Classic of Changes'', is an ancient Chinese divination text that is among the oldest of the Chinese classics. Originally a divination manual in the Western Zho ...
'' 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'') 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.'' (See also, the King Wen sequence The King Wen sequence () is an arrangement of the sixty-four divination figures in 易經 Yì Jīng, the I Ching or Book of Changes. They are called '' hexagrams'' in English because each figure is composed of six 爻 yáo—broken or unbroken line ...
of the 64 hexagrams).
Ifá, Ilm Al-Raml and Geomancy
The Ifá
Ifá is a Yoruba religion and system of divination. Its literary corpus is the ''Odu Ifá''. Orunmila is identified as the Grand Priest, as he revealed divinity and prophecy to the world. Babalawos or Iyanifas use either the divining chain kno ...
/Ifé system of divination in African religions, such as of Yoruba
The Yoruba people (, , ) are a West African ethnic group that mainly inhabit parts of Nigeria, Benin, and Togo. The areas of these countries primarily inhabited by Yoruba are often collectively referred to as Yorubaland. The Yoruba consti ...
, Igbo, Ewe, consists of an elaborate traditional ceremony producing 256 oracles made up by 16 symbols with 256 = 16 x 16. An initiated priest "babalowo" who had memorized oracles, would request sacrifice from consulting clients and make prayers. Then, divination nuts or a pair of chains are used to produce random binary numbers, which are drawn with sandy material on an "Opun" figured wooden tray representing the totality of fate.
Through the spread of Islamic
Islam (; ar, ۘالِإسلَام, , ) is an Abrahamic monotheistic religion centred primarily around the Quran, a religious text considered by Muslims to be the direct word of God (or '' Allah'') as it was revealed to Muhammad, the mai ...
culture, Ifé/Ifá was assimilated as the "Science of Sand" (ilm al-raml), which then spread further and became "Science of Reading the Signs on the Ground" ( Geomancy) in Europe.
This was thought to be another possible route from which computer science was inspired, as Geomancy arrived at Europe at an earlier stage (about 12th Century, described by Hugh of Santalla Hugo of Santalla (also Hugh of Santalla, of Sanctalla, Hugo Sanctelliensis) was a significant translator of the first part of the twelfth century. From Arabic originals, he produced Latin translations of texts on alchemy, astronomy, astrology and ge ...
) than I Ching
The ''I Ching'' or ''Yi Jing'' (, ), usually translated ''Book of Changes'' or ''Classic of Changes'', is an ancient Chinese divination text that is among the oldest of the Chinese classics. Originally a divination manual in the Western Zho ...
(17th Century, described by Gottfried Wilhelm Leibniz).
Coding systems
ASCII code
The 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
In computing and electronic systems, binary-coded decimal (BCD) is a class of binary encodings of decimal numbers where each digit is represented by a fixed number of bits, usually four or eight. Sometimes, special bit patterns are used for ...
(BCD) is a binary encoded representation of integer values that uses a 4-bit nibble
In computing, a nibble (occasionally nybble, nyble, or nybl to match the spelling of byte) is a four-bit aggregation, or half an octet. It is also known as half-byte or tetrade. In a networking or telecommunication context, the nibble is oft ...
to encode decimal digits. Four binary bits can encode up to 16 distinct values; but, in BCD-encoded numbers, only 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.
Early uses of binary codes
* 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
* 1937: Alan Turing electro-mechanical binary multiplier
* 1937: George Stibitz "excess three" code in the Complex Computer
* 1937: Atanasoff–Berry Computer
* 1938: Konrad Zuse Z1
Current uses of binary
Most modern computers use binary encoding for instructions and data. CDs, DVDs, and Blu-ray Disc
The Blu-ray Disc (BD), often known simply as Blu-ray, is a Digital media, digital optical disc data storage format. It was invented and developed in 2005 and released on June 20, 2006 worldwide. It is designed to supersede the DVD format, and c ...
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 codes,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
A binary number is a number expressed in the base-2 numeral system or binary numeral system, a method of mathematical expression which uses only two symbols: typically "0" (zero) and "1" ( one).
The base-2 numeral system is a positional notatio ...
* List of binary codes
* Binary file
* Unicode
* Gray code
The reflected binary code (RBC), also known as reflected binary (RB) or Gray code after Frank Gray, is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit).
For example, the representati ...
References
External links
Sir Francis Bacon's BiLiteral Cypher system
predates binary number system.
*
An updated version of the tables of bounds for small general binary codes given in .
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.
Computer data
English inventions
Encodings
Gottfried Wilhelm Leibniz
2 (number)