Binary code

A binary code is a code ( incorrectly, for example 1/ 0 or true / ) are represented in the information by sequences of two different symbols. The base of this system is the dual system. The term derives from the Latin prefix bi which the meaning two or twice has.

Binary form due to their simplicity usually the basis for the processing of digital information and are therefore frequently mentioned in connection with their processing; "Computer work with this code ." Many of the Binary - types have emerged in the field of information technology and be used there; the term " binary code " is used in computer parlance as a synonym for machine code, machine program or machine language.

Binary code can be technically very easy to map and process, eg by voltages: voltage applied → 1 corresponds to or logically true voltage is not present → 0 corresponds to or logically false. This is the smallest unit of information consisting of 0/ 1 or true / false basis is known in computer science as a bit. By logical connection or technical use more of these simple values ​​can be mapped more complex, higher-quality information. As a value-added information is mapped, is determined exactly by the respective code. For example, applies in ASCII code, the bit sequence 1000001 as "A", 1100001 "a"; these signs are comprehensible to human beings as long as 0-1- sequences in the binary system. With these shortcuts deals Boolean algebra.

The presentation and interpretation of information using binary code is not tied to a specific medium, but is everywhere applicable where the change between two states may be generated and measured again. For example, it would even be possible (although due to the low data transmission rate nonsensical ) to transmit information in binary with smoke signals (long smoking → ​​logic 1, short smoking logic 0).

  • 2.1 Classification opportunities
  • 2.2 Code Examples

Application of binary codes

As Claude Shannon proved the end of the 30s, it is with switch states (such as 0 or 1) possible to perform logical operations. Such binary code can be depicted in art by electronic or optical signals. The information stored in this way can be processed using complex algorithms that are implemented on integrated circuits as they are used in a wide variety of computer processors.

Displayable information

With binary integers having a value depending on the number of bits used values ​​range from 0 to n can be represented. Other types of numbers can be represented with special codes, such as floating-point numbers (IEEE 754), negative values ​​( two's complement). Also, text and special characters are represented with binary code, in which case each character corresponds to a code defined bit combination whose elements are each dual coded.

Protection against transmission errors

In the data transmission special codes are often used, recognized by the transmission error and may even be corrected. These codes have a higher redundancy, so as to use more bits to represent the information to be transmitted would be necessary.

Code conversion

For transport, processing or presentation of data usually different code systems are used. For this purpose, the existing data, usually automatically converted as part of the processing, in a different code. For example, were ( from n- code 1- a ) converted numeric data stored in the computer for processing the read operation in the EBCDIC code on punch cards; be a binary number stored amount fields for displaying converted ( for example in a form invoice or statement of account ) into a character code, such as ASCII; when printing the printer driver or the printer converts even the information to be printed in a printer- specific code. To convert codes, so-called character set tables, also called " code page ", can be used.

Detection / identification of binary codes

Although the bit patterns stored data can be optically pure suggest the use of a particular code, the reliable identification of the code is usually not clearly possible. In general, the data does not contain explicit information about code by which they are stored. Rather 's access to or processing of data whose code needs (format) ' be implicitly known '. Examples:

  • Machine code of a computer program: It exists as one long string of bits. These bits are eg to ASCII text, fixed - or floating-point numbers, address details ' bundled ' ( in each individual length) and machine instructions and are seemingly without structure in the main memory or in libraries. Alone the instructions / declarations described in the source code to determine the format of these pieces of code and hence the code. These decisions accordingly used the programmer commands generated as machine instructions by the compiler, to match the defined data types and codes.
  • It is the same with stored on disk files: You must be handled with appropriate programs, such as with programs for spreadsheet, word processing, graphics display is etc. (which in some operating systems, the file extensions a tool are ) - and / or he the data must be converted accordingly before processing. Without this adjustment, the data can not be processed, or, for example a normal text editor displays other than ASCII encoded data as confused ' data Salad ' to.

In a data set or data set can be found depending on its structure different binary application. So when you set the data structure is the sequence of data fields and their format defined (declared ). This results in each field of the applicable code. Example: Field ' record length ' = dual code 2Byte; Record type = ASCII 2 bytes, valid-from date = hex ( YYYYMMDD) 4 bytes; Amount = fixed-point number 2dec - points 16 bytes.

Examples of binary codes

Classification options

Binary codes are provisions under which a certain amount is linked to bits so defined higher ( than just dual yes-no - information ) to be able to represent. The numerous variants of binary codes can be classified (with examples) according to different criteria:

  • Form of existence of the binary code elements - with examples:
  • Invisible ( Rauch-/Lichtzeichen )
  • Audible noise / sounds ( drum)
  • Tactile characters (Braille)
  • Mechanically analyzable carrier media ( punched card with holes, Music Boxes for Music )
  • Electrical / electronic media (data in the computer or on electronic media such as hard disks or when wired data transmission, wireless technology ( Wi-Fi ) )
  • In connection therewith: type of processing of the code: manually without tools, mechanical, electronic
  • Type of high-order information: codes for fixed-point numbers, floating point numbers, alphanumeric characters
  • Number of summarized in the code to higher-value information bits: BCD code = 4 ( for numbers from 0 to 9), Hex code = 4 ( for weights from 0 to F corresponds numerically from 0 to 15 ), ASCII = 7, EBCDIC = 8
  • Fixed or variable structure of the code: fix for most character codes, variable eg JPG photos or machine code
  • Use of check bits in the code: No, Yes ( for example, when Gray code)

Code Examples

The dual code is the oldest and most commonly used binary code, which can represent integers in the binary system. He was described in the early 18th century. Using the dual code, you can, for example, with the ten fingers of both hands, represent any decimal integer from 0-1023 (). To code is to define how many bits are used for representation of numbers, common examples are: 1 byte (= 8 bits), 2 or 4 or 8 bytes.

In the BCD code the digits 0 to 9 are coded in four bits. The numbers 0000-1001 may arise. BCD - code is also referred to as 8- 4-2- 1 code.

Developed by IBM EBCDIC is an 8 -bit character encoding, which is based on the older BCD code and the i W. uppercase and lowercase letters, special characters and digits are coded 0 to 9. EBCDIC is used almost exclusively on mainframe computers.

The American Standard Code for Information Interchange encodes all characters, including the English special characters in seven bits. Overall, different characters can be encoded using the ASCII code 128 (). In computer- internal processing, which are aligned to the memory unit byte that is unused bit usually is '0 '.

The computer processors directly executable code has been defined in the instruction set of individual processor types and always contains an opcode and any additional required to run the command details such as addresses, literals, etc. in an exactly defined structure, such as opcode 8 bits address data 16 bytes, registers Information 4 bits.

With the excess code also signed numbers can be converted into binary code. Here, the range of values ​​is mainly shifted.

The Stibitz code is a complementary BCD code, sometimes it is also called excess -3 code. Also it allows the encoding of decimal numbers from 0 to 9

And the code is a complementary Aiken BCD code. It assigns all decimal digits to 4 bits. From the BCD code, it differs only by the weighting of the individual bits.

The 1- of-n code, also code -10 - 1- called encodes a decimal to n bits of which can only ever be a 1 bit. The sum of the coded number so always add 1 However, this encoding is not very efficient, since theoretically up to different numbers can be encoded with n bits. An example of the use of this code is the hole card, where, in purely numerical data, the hole positions were 0-9 used alternatively.

The Gray code is a continuous or single-step code. Its peculiarity is that it may be differentiated values ​​to only one bit. The advantage is that cause small inaccuracies when reading not directly misinformation.

125754
de