Binary code

From Wikipedia, the free encyclopedia
Jump to: navigation, search
The word 'Wikipedia' represented in ASCII binary.

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

In computing and telecommunication, 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.

Contents

History of binary code [edit]

Binary numbers were first described in Chandashutram written by Pingala around 300 BCE. Binary Code was first introduced by the English mathematician and philosopher Eugene Paul Curtis during the 17th century.[citation needed] Curtis 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, Curtis had not yet found a use for this system.

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. Boole’s system was based on binary, a yes-no, on-off approach that consisted the three most basic operations: AND, OR, and NOT.[1] This system was not put into use until a graduate student from Massachusetts Institute of Technology by the name 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. Shannon's thesis became a starting point for the use of the binary code in practical applications such as computers, electric circuits, and more.[2]

Other forms of binary code [edit]

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 [edit]

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.

Ba gua [edit]

The ba gua are diagrams used in feng shui, Taoist cosmology and I Ching studies. The ba gua consists of 8 trigrams; 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.[3] (See also, the King Wen sequence of the 64 hexagrams).

Ifá divination [edit]

Sixteen Principal Odú
Ogbe I I I I Ogunda I I I II
Oyẹku II II II II Ọsa II I I I
Iwori II I I II Ika II I II II
Odi I II II I Oturupọn II II I II
Irosun I I II II Otura I II I I
Iwọnrin II II I I Irẹtẹ I I II I
Ọbara I II II II Ọsẹ I II I II
Ọkanran II II II I Ofun II I II I

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 medicine, and ritual advice. In 2005, UNESCO listed Ifá in the Masterpieces of the Oral and Intangible Heritage of Humanity.

Coding systems [edit]

ASCII code [edit]

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 [edit]

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.[4]

Early uses of binary codes [edit]

Current uses of binary [edit]

Many things besides computers use binary, such as CDs, which have a series of hills and valleys on the surface. These either reflect the light of the thin laser beam shone on them, representing a one, or do not, representing a zero. However these hills and valleys do not directly represent user-accessible data bits. This media-level signal is decoded into 14 bit words that are further decoded into 8 bit bytes of user data by a lookup table (audio data goes through Reed-Solomon decoding after this step). The 8-to-14 encoding is done to prevent long runs of 1's or 0's at media level so that the signal won't be susceptible to sync drift and dropouts.

Weight of binary codes [edit]

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 [edit]

Notes [edit]

  1. ^ What's so logical about boolean algebra?
  2. ^ Claude Shannon(1916-2001)
  3. ^ Wilhelm, Richard; trans. by Cary F. Baynes, forward by C. G. Jung, preface to 3rd ed. by Hellmut Wilhelm (1967) (1950). The I Ching or Book of Changes. Princeton, NJ: Princeton University Press. pp. 266, 269. ISBN 0-691-09750-X. 
  4. ^ "General Decimal Arithmetic". 
  5. ^ a b c Glaser 1971
  6. ^ Table of Constant Weight Binary Codes

External links [edit]