In computer science or other kinds of machines, there are two ways to transfer data. One is in analog, and one is digital. Analog is like any number, like 5, 4, 11, 26. Digital is only 1 and 0, it is either true or false.
Datas in a computer are transferred as 1s and 0s, like 1001101101011010101, and these are called binary numbers. Today I am going to teach your how to convert binary numbers into the numbers we use normally everyday, which are base 10 numbers.
Datas in a computer are transferred as 1s and 0s, like 1001101101011010101, and these are called binary numbers. Today I am going to teach your how to convert binary numbers into the numbers we use normally everyday, which are base 10 numbers.
First thing you might notice is that binary number is made out of 1s and 0s, not 2, 3, 4, 5, or above. Normal numbers we use in normal life is made out of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and they are called base 10 numbers. In contrast, binary numbers are base 2 numbers.. So what is the relationship?
For a base 10 number like 359684, we can look at it like this
100000 10000 1000 100 10 1
3 5 9 6 8 4
We can write it as
3 x 100000 + 5 x 10000 + 9 x 1000 + 6 x 100 + 8 x 10 + 4 x 1
100000 is 10 to the fifth power, 10000 is 10 to the fourth power, 1000 is 10 to the third power, et cetera.
For binary numbers, you just change them into 2 to the whatever power.
A binary number 101101 can presented like this:
32 16 8 4 2 1
1 0 1 1 0 1
So the value of it in the base 10 number is:
1 x 32 + 0 x 16 + 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1
= 32 + 0 + 8 + 4 + 0 + 1
= 45
So now we know how to convert a binary number into a base 10 number we use in our life, but how do you convert a base 10 number into a binary number
First, I recommend you memorise all the powers of 2 from 0 to 10. They are
Power Number
0 1
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
9 512
10 1024
We can use these numbers to make any number from 1 to 2047(2 to the 11th power minus 1)
For example:
388 = 256(2 to the eighth power) + 128(2 to the seventh power) + 4(2 to the second power)
Ok, so now lets learn how do you actually convert base 10 numbers into binary.
We have 294, a random three digit number.
1. Find the closest number that is smaller than it and should be a power of 2
256 (2 to the eight power)
2. Minus the number you found from the number you started with
294 - 256 = 38
3. Repeat Step 1 and Step 2 until you get 0
32 (2 to the fifth power)
38 - 32 = 6
4 (2 to the second power)
6 - 4 = 2
2 (2 to the first power)
2 - 2 = 0
4. Make a table of power of 2. The upper limit is the first number you found, which should be the largest
256 128 64 32 16 8 4 2 1
5. Under these numbers, if this number is included in your calculations(steps), write a ‘1’ under it, if not, write a ‘0’ under it
256 128 64 32 16 8 4 2 1
1 0 0 1 0 0 1 1 0
6. Write the ‘1’s and ‘0’s into one number, check it, and you have finished converting it.
100100110 is the number
Check:
256 128 64 32 16 8 4 2 1
1 0 0 1 0 0 1 1 0
1 x 256 + 0 x 128 + 0 x 64 + 1 x 32 + 0 x 16 + 0 x 8 + 1 x 4 + 1 x 2 + 0 x 1
= 256 + 0 + 0 + 32 + 0 + 0 + 4 + 2 + 0
= 294
And I have finished, 100100110 is the binary number for 294
For a base 10 number like 359684, we can look at it like this
100000 10000 1000 100 10 1
3 5 9 6 8 4
We can write it as
3 x 100000 + 5 x 10000 + 9 x 1000 + 6 x 100 + 8 x 10 + 4 x 1
100000 is 10 to the fifth power, 10000 is 10 to the fourth power, 1000 is 10 to the third power, et cetera.
For binary numbers, you just change them into 2 to the whatever power.
A binary number 101101 can presented like this:
32 16 8 4 2 1
1 0 1 1 0 1
So the value of it in the base 10 number is:
1 x 32 + 0 x 16 + 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1
= 32 + 0 + 8 + 4 + 0 + 1
= 45
So now we know how to convert a binary number into a base 10 number we use in our life, but how do you convert a base 10 number into a binary number
First, I recommend you memorise all the powers of 2 from 0 to 10. They are
Power Number
0 1
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
9 512
10 1024
We can use these numbers to make any number from 1 to 2047(2 to the 11th power minus 1)
For example:
388 = 256(2 to the eighth power) + 128(2 to the seventh power) + 4(2 to the second power)
Ok, so now lets learn how do you actually convert base 10 numbers into binary.
We have 294, a random three digit number.
1. Find the closest number that is smaller than it and should be a power of 2
256 (2 to the eight power)
2. Minus the number you found from the number you started with
294 - 256 = 38
3. Repeat Step 1 and Step 2 until you get 0
32 (2 to the fifth power)
38 - 32 = 6
4 (2 to the second power)
6 - 4 = 2
2 (2 to the first power)
2 - 2 = 0
4. Make a table of power of 2. The upper limit is the first number you found, which should be the largest
256 128 64 32 16 8 4 2 1
5. Under these numbers, if this number is included in your calculations(steps), write a ‘1’ under it, if not, write a ‘0’ under it
256 128 64 32 16 8 4 2 1
1 0 0 1 0 0 1 1 0
6. Write the ‘1’s and ‘0’s into one number, check it, and you have finished converting it.
100100110 is the number
Check:
256 128 64 32 16 8 4 2 1
1 0 0 1 0 0 1 1 0
1 x 256 + 0 x 128 + 0 x 64 + 1 x 32 + 0 x 16 + 0 x 8 + 1 x 4 + 1 x 2 + 0 x 1
= 256 + 0 + 0 + 32 + 0 + 0 + 4 + 2 + 0
= 294
And I have finished, 100100110 is the binary number for 294