Binary number

The dual system (lat. = dualis containing two ), also base two or binary called, is a number system that uses only two digits to represent numbers.

In the common decimal digits 0 to 9 are used. In the dual system, however, numbers are represented with the numeric value of zero and one. Often the symbols 0 and 1 are used for these numbers. The numbers zero through fifteen are listed in the rightmost list.

The dual system is the place value system to the base 2, that provides the dyadic (2- adic ) representation of numbers ( dyadics ) (Greek dyo = two).

Due to its importance in digital technology, it is next to the decimal system, the most important number system.

The number representations in the binary system are called binary numbers or binary numbers. The latter is the more general term, as these may simply represent binary coded numbers. The term binary number specifying the representation of a number that is not closer, he says only that two different numbers are used.

  • 2.1 Development of the dual system
  • 2.2 The first realizations in the art
  • 3.1 Calculation of required points
  • 4.1 Written addition
  • 4.2 Written subtraction
  • 4.3 Written multiplication
  • 4.4 Written Division
  • 5.1 From the binary system to decimal
  • 5.2 from decimal to binary system

Definition and representation

In the representation of numbers in the binary system, the digits are written in the decimal system commonly used with no delimiters in a row, however, their importance corresponds to matching the power of place and not the power of ten.

The most significant digit of the value is so far left and wrote down the lower-order places with the values ​​in descending order to the right. For the presentation of rational or real numbers then follow after a comma separating the digits to representing the fractional part of the number. If this account is canceled, it looks like this:

The value of the binary number is obtained by adding these numbers, which are pre- multiplied by their importance:

Usually, the symbols are analogous to other number systems 0 and 1 used to represent the two digits.

In older literature regarding electronic data processing sometimes the symbols Low ( L) and high ( H) instead of 0 and 1. Low is then usually for zero and high for the value one. This mapping is called positive logic, negative logic in the values ​​assigned to the other way around. In computer science are binary coded values ​​for the " digits" true ( w) and false ( f ) or the English translations true ( t ) and false ( f ), where false = 0 and true = 1.

The symbols L for the value one and 0 for zero found (rarely ) use.

Negative numbers are in the binary system as in the decimal system with a minus - written ().

Examples

The sequence of digits 1101 for example does not (as in the decimal system ) the thousand one hundred one is, but the thirteen, because in the dual system, the value calculated by

And not, as in the decimal system by

For further techniques and examples for converting binary numbers to decimal and vice versa: see section Conversion of binary numbers into other value systems.

The bracketing of the results with the subscript 2 and the 10 indicates the base of the priority system used. Thus it can be easily detected if the number is in the dual or represented in the decimal system. In the literature, the square brackets are often omitted, and the subscript number then sometimes placed in parentheses. Also possible is the marking by the trailing uppercase letter B ( for binary, engl. For binary).

Various forms of representation of the number twenty-three in the binary system:

  • 2
  • 101112
  • 10111 (2)
  • 10111b (so-called Intel Convention)
  • 10111B
  • 0b10111
  • 10111 % (so-called Motorola convention, but eg also with DR- DOS DEBUG )
  • HLHHH
  • L0LLL

History

Development of the dual system

The old Indian mathematician Pingala presented the first known description of a number system consisting of two characters before the 3rd century BC. However, this number system had no zero.

A series of eight trigrams and hexagrams 64 are known from the ancient Chinese and Daoist text I Ching. The Chinese scholar and philosopher Shao Yong developed in the 11th century from a systematic arrangement of hexagrams that represents the sequence of 0 to 63, and a method to produce the same. However, there is no evidence that Shao understood how to make calculations in the dual system or had recognized the concept of the significance.

Leibniz felt at the end of the 17th century, the dyadics ( dyo, Greek = two ), ie the representation of numbers in the binary system, which he developed, as very important. He saw it as such a compelling symbol of the Christian faith, that he wanted to convince the Chinese Emperor Kangxi. To this end, he wrote to the French Jesuit Father Bouvet:

Something, however, was his worldly description in a letter to the Duke Rudolf of Brunswick- Wolfenbüttel January 2, 1697

" ... Because one of the main points of the Christian faith ... is the creation of all things out of nothing by God's omnipotence. Now you can say that nothing in the world this better imagine, yes, as it were demonstrating, as the origin of numbers as he is here this presented, arise all the numbers by the pressed- only and alone with one and zero (or nothing). It will probably be difficult to find in nature and philosophy of a better example of this mystery ... This is here the more zupasse because the empty desert depth and darkness to zero and nothing but the Spirit of God is one with His light to the Almighty One. Because of the words of the sense image I have considered myself a Zeiteilang and to finally put this verse to be good: to develop everything from nothing satisfies one ( Omnibus ex nihilo ducendis sufficit unum ) ".

Probably because the fine mechanical skills of that time were not sufficient Leibniz attacked the building of his calculating machines back to the decimal system.

The dual system was developed by Leibniz in the early 18th century in his article Explication de l' Arithmétique Binaire ( Histoire de l' Academie Royale des Sciences in 1703, published in Paris in 1705 ) fully documented. Leibniz also confirmed in the view Joachim Bouvet, a missionary to the Chinese imperial court, which ( see Figure: "Signs of the Fu Hsi " ) the tri-and hexagrams of the Fu Hsi interpreted in certain reading direction as numerals. He saw it as an archaic binary system, which has been forgotten. This interpretation is now considered highly unlikely.

But Leibniz had predecessors in Europe. An earlier treatment of the dual system and other points systems by Thomas Harriot was not released from this, it was found only in the estate. The first release of the dual system in Europe is probably in Mathesis Biceps vetus et nova 1670 the later Spanish bishop Juan Caramuel y Lobkowitz ( 1606-1682 ), who also treats numbers to other bases. Blaise Pascal also already noticed in De numeri multiplicibus (1654, 1665) that the base 10 is not a necessity.

1854, the British mathematician George Boole, a pioneering work that detail describes a logical system, which became known as Boolean algebra. His logical system prepared the realization of electronic circuits the way that implement the arithmetic in the binary system.

The first realizations in the art

  • In November 1937, completed George Stibitz, who later worked at Bell Labs, its relay -based computer " Model K " ( for " K" for "kitchen", where he has assembled it), which dominated the addition in the binary system.
  • 1937 Konrad Zuse built a system based on the dual calculating machine, the mechanical Zuse Z1, but what worked unreliable due to mechanical problems.
  • 1937 Claude Shannon produced his master's thesis at MIT that implemented in electronic relays and switches for the first time the Boolean algebra and arithmetic in the binary system. Under the title " A Symbolic Analysis of Relay and Switching Circuits" Shannon's work gave rise to the construction of digital circuits.
  • 1937-1941 John Atanasoff and Clifford Berry built the first electronic digital computer, the Atanasoff -based electron tubes -Berry Computer.
  • On May 12, 1941 Konrad Zuse led a small group in Berlin, the world's first universally programmable binary digital computer, the electromechanical Zuse Z3, which was however completely destroyed in World War II.
  • On March 19, 1955 presented the Bell Laboratories research the world's first exclusively realized with semiconductor elements binary digital computer, the Transistorized Airborne DIgital computer before.

Application

During the development of electronic computing machines, the dual system gained great importance, because in digital technology numbers are represented by electrical states. Two complementary states such as power on / power off or power / mass are preferably used, since in this way very error- resistant and simple circuits are to be realized (see binary code). These two states can then be used as numbers. The dual system is the easiest way to calculate with numbers that are represented by these two digits.

Binary numbers found in the electronic data processing in the representation of fixed point numbers or integers using. Negative numbers are represented mainly as two, which corresponds to only in the positive range of the binary number representation. Less often the one's complement is used, which corresponds to the inverted representation of binary numbers with a preceding one. The representation of negative numbers in one's complement has the disadvantage that two representations for zero exist, even in the positive and one negative. Another alternative is the based on a range of values ​​shift excess code.

To approximately represent rational or even real numbers with non -terminating binary number representation in the electronic data processing, preferably floating point representations are used in the normalized number and is divided into mantissa and exponent. These two values ​​are then stored in the form of binary numbers.

Calculation of required points

A binary number with maximum points can take the value. A four-digit binary number can therefore at most the value, so 16-1 = 15 have.

Consequently, you can connect up, so count in the binary system with its 10 fingers until 1023.

In digital technology, it is important to note that often the sign must be saved when you save a binary number. To the actual most significant bit is used mostly in the reserved memory area for the number. This storage area bit large, is ( in the representation of negative numbers in two's complement ) of the maximum value of the positive numbers, and the minimum value of the negative numbers. It counts the positive to the numbers and that is the " first negative number." Overall, the number of representable numbers remain the same.

Basic arithmetic operations in the binary system

Similar to the numbers in the decimal system can perform the usual arithmetic operations addition, subtraction, multiplication and division with binary numbers. In fact, the required algorithms are even simpler and can be implemented efficiently with electronic logic circuits. The introduction of binary numbers in computer technology therefore brought many advantages.

0 0 = 0 0 1 = 1 1 0 = 1 1 1 = 10

0 - 0 = 0 0-1 = -1 1-0 = 1 1 - 1 = 0

0 0 = 0 0 1 = 0 1 0 = 0 1 1 = 1

0/ 0 = n.def. 0 /1 = 0 1/0 = n.def. 1/1 = 1

Written addition

The binary addition is a fundamental basic operation in the computer world. If you want to add two binary numbers and non-negative, we can do that as in the decimal system. Only one must note that the result at the particular point no "two " is listed, but a zero and at the next character a carry. This is analogous to Dezimaladdition when a ten results in the addition of a point:

The numbers are written one above the other. Now one ( = bits) operates from right to left, all the binary digits and by simultaneously and produces at each intermediate step, and a result bit, a flag bit (also called a transfer ). The bits are counted according to the table on the right. In the columns A and B are the bits of the numbers to be added can be found. In the column stands the flag bit of the previous intermediate step. This leads to ( according to this table, which corresponds to a full adder ), a result bit (E) and a new flag bit (). All result bits, strung together from right to left represent the result dar. originates during the last intermediate step, a flag bit, so you get the result left an additional 1

The best you can with an example. Here, the numbers A and B are added together. In each step, an accumulating memory bit is listed in the next paragraph.

A = 10011010 (154)         B = 00110110 (54 )    Flags = 01111100             -------- Result = 11010000 (208 )             ‗ ‗ ‗ ‗ ‗ ‗ ‗ ‗ Written subtraction

The subtraction is analogous to addition.

Two numbers in the binary system can be subtracted from each as shown in the following example:

Here the subtraction is 110-23 = 87 performed. The little ones in the third row show the transfer. The procedure is the same as it is taught in the school for the decimal system. Something strange looks from the case 0-1. To illustrate the example 2-9 in the decimal system: one a tens digit is thinking in front of the two, resulting in the subtraction results in 12-9. The imaginary tens digit is then passed as a carry to the next position. In the dual system, the same thing happens: From 0-1 10-1. As a result, so a 1 is written down; the imaginary before the 0 One must then be written as a carry to the next position and are also deducted from this.

The process works (as well as in the decimal system ) is not if the minuend ( first number ) is smaller than the subtrahend (2nd speed). If this is the case, the subtraction of a number is determined by adding the Zweierkomplementes this number. The subtraction of a positive number gives the same result as Namely, the addition of the corresponding negative number with the same amount:

If the ( marked in blue ) carry 1, the two's complement of the result would not be formed because the unsigned representation of positive integers in two's complement is the same ( see table below ). The carry is added to the (not shown) leading ones of Zweierkomplementes, whereby only leading zeros in the result emerge. As an example, the above statement is 110-23 = 87:

Written multiplication

The multiplication is carried out just as in the binary system as in the decimal system. The fact that only 0 and 1 appear as digits, is the written multiplication even easier. The following example, in which the numbers 1100 ( 12) and 1101 (13 ) are multiplied, shows the procedure.

First you must write the task in a row and moves to simplify a line under.

1100 · 1101 ----------- The first digit of the second factor is a one and therefore to write the first factor, flush right under this one.

1100 · 1101 -----------      1100 For all other ones of the second factor to write the first factor, right justified below.

1100 · 1101 -----------      1100       1100        0000         1100 The figures thus obtained is then counts together for the result of the multiplication.

1100 · 1101 -----------      1100     1100     0000     1100 -----------     10011100 (156) A particularly simple case, the multiplication of a positive binary number with the number 10 (2). In this case only a 0 must be attached to the positive binary number:

1101 x 10 = 11010

11010 x 10 = 110100

Etc.

For this simple arithmetic operation commands exist in digital technology.

In two's complement multiplication of two binary numbers of the Booth's algorithm.

Written Division

In the division of two binary numbers following algorithms are used.

The example of the Division of 1000010/11 (corresponding to 66:3 in the decimal system )

1000010 ÷ 11 010110 remainder = 0 ( = 22 in the decimal system ) thus mod   - 011   -----     00100     - 011      ----       0011      - 011      -----         0 The application of the modulo function with the divisor 10 ( 2) to positive binary numbers always results in 1 if the last digit of the dividend is 1 or 0 if the last digit of the dividend is 0:

1101 mod 10 = 1

1100 mod 10 = 0

For this arithmetic operation, corresponding to an AND gate 1, there are simple commands in digital technology.

A particularly simple case is the division with remainder of a positive binary number by the number 10 (2). In this case, only the last digit of the dividend must be deleted. If the last digit of the dividend is 1, so this rest If the number of divisions disappears in this process by two the number of digits of the dividend, so the end result is always 0:

1101 ÷ 10 = 110

110 ÷ 10 = 11

11 ÷ 10 = 1

1 ÷ 10 = 0

For this simple arithmetic operation commands exist in digital technology.

Convert binary numbers into other value systems

Due to the small base, there is the disadvantage that in comparison to numbers are decimal numbers to look relatively long and heavy (see table below). This has led to the spread of the hexadecimal system, which has the base 16. Since 16 is a power of 2, it is particularly easy to convert binary numbers to hexadecimal. To four points of the binary number to be replaced by a hexadecimal digit, which also reduces the length of the figures presented by a factor of four. The hexadecimal digits with a value of 0-15 are usually represented by the digits 0-9 and the symbols uppercase letters A- F ( for the values ​​10-15). This makes them relatively easy to read, it can be considered as light that EDA5 (16 ) is greater than ED7A (16 ) whereas not let the corresponding binary number 1110110110100101 (2) and 1110110101111010 ( 2) overlook so fast.

From the binary system to decimal

To convert a binary number to its decimal equivalent, the numbers will change with each their value multiplied ( corresponding power of two ), and then added together.

Example:

Ends with a binary number 1, so the decimal number is an odd number. If the last digit of a binary number 0, the decimal number is even.

Example:

This procedure can be written also in the form of a table. For this purpose, one notes the individual digits of a binary number into columns that are overwritten by the respective value of the digit. In the following table the value is highlighted in orange. In each of the three lines of the white part is a binary number:

It now adds all points values ​​that are above the ones of the binary number and receives the corresponding green deposited decimal. For example, to calculate the decimal value of the third binary number, the point values ​​are 8 and 2 adds. The result is 10

From decimal to binary system

There are several ways to convert to the dual system. In the following, the division method ( modulo method also known) is described using the example 41 (10 ):

The corresponding binary number is obtained by notation of the calculated residues from bottom to top: 101001 (2).

Another method is the subtraction. This is subtracted in each case the maximum power of two of the re -computing decimal. If the next greatest power of two is greater than the difference of the previous subtraction, so the quality of the next binary digit is 0 Otherwise, the next binary digit 1, and the power of two is subtracted. To illustrate this method, we use more of example of the number 41:

125830
de