Binary code

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. The binary code assigns a pattern of binary digits, also known as bits, to each character, instruction, etc. For example, a binary string 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, is usually displayed in code tables in octal, decimal or hexadecimal 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 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".
no
Other forms of binary code
![]() | This section possibly contains original research. (March 2015) |

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 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.[1] (See also, the King Wen sequence of the 64 hexagrams).
Ifá, Ilm Al-Raml and Geomancy
The Ifá/Ifé system of divination in African religions, such as of Yoruba, Igbo, and Ewe, consists of an elaborate traditional ceremony producing 256 oracles made up by 16 symbols with 256 = 16 x 16. An initiated priest, or Babalawo, 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,[2] which are drawn with sandy material on an "Opun" figured wooden tray representing the totality of fate.
Through the spread of Islamic 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,[3] as Geomancy arrived at Europe at an earlier stage (about 12th Century, described by Hugh of Santalla) than I Ching (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 (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 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.[4]
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[5]
- 1937: Alan Turing electro-mechanical binary multiplier
- 1937: George Stibitz "excess three" code in the Complex Computer[5]
- 1937: Atanasoff–Berry Computer[5]
- 1938: Konrad Zuse Z1
Current uses of binary
Most modern computers use binary encoding for instructions and data. CDs, DVDs, and Blu-ray Discs 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,[6] is the Hamming weight of the binary words coding for the represented words or sequences.
See also
References
- ^ Wilhelm, Richard (1950). The I Ching or Book of Changes. trans. by Cary F. Baynes, foreword by C. G. Jung, preface to 3rd ed. by Hellmut Wilhelm (1967). Princeton, NJ: Princeton University Press. pp. 266, 269. ISBN 978-0-691-09750-3.
{{cite book}}
: ISBN / Date incompatibility (help) - ^ Olupona, Jacob K. (2014). African Religions: A Very Short Introduction. Oxford: Oxford University Press. p. 45. ISBN 978-0-19-979058-6. OCLC 839396781.
- ^ Eglash, Ron (June 2007). "The fractals at the heart of African designs". www.ted.com. Archived from the original on 2021-07-27. Retrieved 2021-04-15.
- ^ Cowlishaw, Mike F. (2015) [1981, 2008]. "General Decimal Arithmetic". IBM. Retrieved 2016-01-02.
- ^ a b c Glaser 1971
- ^ Table of Constant Weight Binary Codes
External links
- Sir Francis Bacon's BiLiteral Cypher system Archived 2016-09-23 at the Wayback Machine, predates binary number system.
- Weisstein, Eric W. "Error-Correcting Code". MathWorld.
- Table of general binary codes. An updated version of the tables of bounds for small general binary codes given in M.R. Best; A.E. Brouwer; F.J. MacWilliams; A.M. Odlyzko; N.J.A. Sloane (1978), "Bounds for Binary Codes of Length Less than 25", IEEE Trans. Inf. Theory, 24: 81–93, CiteSeerX 10.1.1.391.9930, doi:10.1109/tit.1978.1055827.
- Table of Nonlinear Binary Codes. Maintained by Simon Litsyn, E. M. Rains, and N. J. A. Sloane. Updated until 1999.
- Glaser, Anton (1971). "Chapter VII Applications to Computers". History of Binary and other Nondecimal Numeration. Tomash. ISBN 978-0-938228-00-4. cites some pre-ENIAC milestones.
- First book in the world fully written in binary code: (IT) Luigi Usai, 01010011 01100101 01100111 01110010 01100101 01110100 01101001, Independently published, 2023, ISBN 979-8-8604-3980-1. URL consulted September 8, 2023.