A numbering system is a set of symbols and rules through which we can express all valid numbers within that system. For example, the decimal system, which is the system we use the most on a daily basis, uses the number 10 as a base and is made up of 10 different numbers with which you can represent all the others: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. This is a positional system and therefore the value of each number varies depending on its position (units, tens, hundreds, etc.).

The binary system, which is popularly known because it is the numbering system used by computers and other electronic devices, is a base 2 system. This means that it uses only two digits to represent all its numbers and in the case of the binary code these two numbers are 0 and 1. Computers use the binary system because they only work with two voltage levels: OFF or without the presence of an electrical charge (0) and ON or with the presence of an electrical charge (1).

There are other numbering systems with different uses, such as the octal system (base 8) and the hexadecimal system (base 16), both also used in the computer world, or the sexagesimal system (base 60), which is another numbering system that we use every day to measure time (one hour equals 60 minutes and each minute equals 60 seconds).

The origins of the binary system

The first descriptions of a binary system date from the 3rd century BC and are attributed to an ancient Indian mathematician named Pingala. The first representations of binary numbers are found in classical works of Chinese origin, specifically in the philosophical work “I Ching“, which dates between the years 1200 and 100 a. c.

Throughout the following centuries, we can also find documentation of other mathematicians and other thinkers who expound ideas related to the binary system. For example, Sir Francis Bacon created the Bacon Code in the early 17th century, a cryptographic code based on the binary system which used the letters A and B grouped into five-letter combinations to encrypt messages.

As for the modern binary system, the mathematical basis of the binary system as we know it was first documented in the 17th century by the German mathematician Gottfried Wilhelm Leibniz. In 1703, Leibniz published the article “Explication de l’Arithmétique Binaire”, which explained how numbers could be represented using the digits 0 and 1. At that time, his studies did not answer any specific goal, but with the arrival of the first computers at the beginning of the 20th century, almost 300 years later, it was possible to understand how everything that Leibniz had explained in his article was applied by the first computer programmers.

Also, it is important to highlight the contributions of the British mathematician George Boole, who in 1854 published an article in which he detailed a system of logic, called Boolean Algebra, which started from the theory of the binary system and was key to the development of electronic circuits.

Conversion of numbers from one system to another

It is possible to convert a number from one number system to another, for example from binary to decimal or vice versa. In the first case, it is necessary to factorize the binary number (base 2) and later we can convert it to an equivalent number in the decimal system. If we have the binary number 10111101 and we want to convert it into a decimal number, we must first factor it using the number 2 and raising it to the power corresponding to each digit according to the position it occupies within the series of numbers. As exponents, we would use 0, 1, 2, 3… until we reach 7, and we will start factorizing following the order from left to right and starting with the largest exponent. Finally we will calculate the addition and find the equivalent decimal number, which in this case is 189:

10111101 = (1·27) + (0·26) + (1·25) + (1·24) + (1·23) + (1·22) + (0·21) + (1·20)
10111101 = (128) + (0) + (32) + (16) + (8) + (4) + (0) + (1)
10111101 = 189

To convert an integer from the decimal system and find its equivalent in the binary system, we must use the number we want to convert (189) as the dividend and the number 2 as the divisor, since the number we are looking for has base 2. Then we would take the result of this first division and divide it again by 2 (and so on with each quotient obtained until it is no longer possible to divide further). Once the divisions are finished, we would write the numbers corresponding to the residues of each division in reverse order, that is, taking them from the last division we made to the first one. In this way we will obtain the equivalent binary number, which this time it was 10111101.