# Lesson : Binary number

Warning: Use of undefined constant viewed_cookie_policy - assumed 'viewed_cookie_policy' (this will throw an Error in a future version of PHP) in /home/customer/www/hyperelectronic.net/public_html/wp-content/themes/customizr-child/functions.php on line 99

In digital electronics, binary numbers are often used. Integrated circuits in most cases can only decode binary signals which consist of one or multiples “0s” and/or “1s”. A “0” often being zero volts in electronic and a “1” often being a voltage source (i.e 3.3V, 5V, etc.)*. In the previous lessons, binary numbers were used to describe the state of the inputs and output of the logic gates. They were also used to build the truth table which listed all the possibles inputs combinations with its resulting output. Binary number actually have much more uses in electronics and this is why it is important to understand how to work with binary number. Logic gate is an introduction to the binary numeral system. A binary number is just a different way of expressing a number. The numeral system we uses daily is called the decimal numeral system. The major difference between the two system is that the decimal numeral system uses 10 digits while the binary numeral system uses 2 digits. The decimal numeral system uses the digits : 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. The binary numeral system uses the digits : 0 and 1. We will start by looking at the decimal numeral system since it will helps us understand how a numbering system works.

*There are different ways of transmitting information digitally which uses differents signaling methods than binary “0” or “1”. Those different methods are often used in places where there is an excessive amount of datas that needs to be transfer rapidly and/or reliability.

Decimal numeral system :

In the decimal numeral system, a digit can take a value of 0 to 9 since we have 10 digits. The first digit position in the decimal numeral system has a value of 1. The second digit position has a value of 10, the third one has a value of 100 and so on. Every new digits added to the left has a value 10 times bigger than the one on its right.  In the example below, we have the number 111 and we can see the place value of each digits. The smaller 10 on the right of the number is to indicate that we are in the decimal numeral system.

The first position digit is called “Ones”, the second “tens”, the third “hundreds” and so on. If we look at the mathematics behind this, you will notice that the first digit position is the value of the digit (0 to 9) multiply by one, the second digit position is multiply by ten and the third digit position is multiply by a hundred. This is because of the decimal numeral system.

The value of the first digit position is : $10^{0} = 1$

The value of the second digit position is : $10^{1} = 10$

The value of the third digit position is : $10^{2} = 100$

and so on.

So if we have the number 357, we have the following formula to describe the value: $3 \cdot 10^{2} + 5 \cdot 10^{1} + 7 \cdot 10^{0} = 357$ $3 \cdot 100 + 5 \cdot 10 + 7 \cdot 1 = 357$

The decimal numeral system is fairly easy to understand. The position of each digits has the avantages of showing the actual value without having to use the formula above. If we have the number 300, we already know that it is three hundreds because of the position of the digit three (3). The third digit position is multiply by a hundred (100) which gives us 3 hundred (3 times 100).

Binary numeral system :

In the binary numeral system, a digit can take a value of 0 or 1 since we have 2 digits. The first digit position in the binary numeral system has a value of 1. The second digit position has a value of 2, the third position has a value of 4 and so on. Every new digits added to the left has a value 2 times bigger than the one on its right.  In the example below, we have the binary number 1111 and we can see the place value of each digits. The smaller 2 on the right of the number is to indicate that we are in the binary numeral system.

The value of the first digit position is : $2^{0} = 1$

The value of the second digit position is : $2^{1} = 2$

The value of the third digit position is : $2^{2} = 4$

The value of the fourth digit position is : $2^{3} = 8$

and so on.

In figure 2, the decimal value of this binary number is 15 because : $1 \cdot 2^{3} + 1 \cdot 2^{2} + 1 \cdot 2^{1} + 1 \cdot 2^{0}$ $1 \cdot 8 + 1 \cdot 4 + 1 \cdot 2 + 1 \cdot 1$ $8 + 4 + 2 + 1 = 15$

For the decimal number 9, we need the fourth position digit (has a value of 8) and the first position digit (has a value of 1) : $1 \cdot 2^{3} + 0 \cdot 2^{2} + 0 \cdot 2^{1} + 1 \cdot 2^{0} = 9$ $1 \cdot 8 + 0 \cdot 4 + 0 \cdot 2 + 1 \cdot 1 = 9$ $8 + 0 + 0+ 1 = 9$

The decimal number 9 in binary : $1001_{2}$

This was an introduction to the binary numeral system. In the next lessons, we will see more examples of conversion between the binary numeral system and the decimal numeral system. We will also see techniques on how to find the binary number of a decimal number and vice versa. There are multiples methods for this and we will see multiples techniques.