Binary
Let’s learn about the binary number system.
We'll cover the following
Writing a number in binary
Binary numbers are numbers written in base 2. Binary numbers follow very similar rules to decimal numbers. In fact, the only real change is that the role of the number 10 in writing a decimal number is replaced by the number 2. Thus, the new rules are:
-
The digits of a binary number can take the value 0 or 1.
-
Every digit in a binary number can be multiplied by some power of 2. The powers of 2 start with 0 (the furthest digit to the right) and then increase from right to left.
Consider the binary number (We have used the subscript 2 to make it clear that we mean the number 1101 in binary and not the decimal number one thousand one hundred and one, which we would have written as ). Using the rules given above (and comparing them with the explanation of decimal numbers), we see that each binary number is a sum of multiples of powers of 2:
Similarly, the number is the sum of multiples of powers of 2 expressed by:
Every binary number has a decimal equivalent, and every decimal number has a binary equivalent. In the next section, we’ll explain how to convert from one to the other.
Converting binary to decimal
Converting binary to decimal is easy. Simply express the binary number as its sum of multiples of powers of 2, and then add them up. So, what is 11012 in decimal? We know that:
So what we are saying is that the number 1101 in binary is the same as the number 13 in decimal, or in other words, .
Here, we have a coded example of the binary to decimal conversion defined above:
Get hands-on with 1400+ tech skills courses.