Binary……….the language that computers speak. What is this binary language? Its is a language that computers speak that consist of only off and on switches, off being represented by 0’s and on represented by 1’s. A system bases on these 2 numbers is call a base2 system. Well lets get started with the first lesson: converting decimals to binary.
A decimal is basically any number, so we are going to start with the number 20. How are we going to make the decimal 20 into a base2 system so it can be read in binary. We do this by dividing the decimal by the number 2 first. We come out with an answer with no remander. If this is the case that will represent a 0.
Now we have the number 10 from the previous problem(20/2=10). We now do the samething with 10. We divide it by 2 and again we come up with a number that doesn’t have a remander. Again this will be a 0. Now we have 5. Unlike the other numbers, this is odd. So we will be left with a remander of 1. You guessed it, this will give us a 1 in the binary code. With the whole number left (2) that is the number we continue with. 2/2 is 1 with no remander and so that is a 1 also in binary. Now we are left with the last number which is 1 and that will be our final problem which leaves us with out final 1.
Lets review the binary we have for 20:
20=00101
Now read the binary backwards and you get 10100. That is the binary for the decimal 20.
Now lets go backwards. How will we get 20 out of 10100. Well, because we are in a base2 system, the numbers 1 and 0 are exponetially increasing by 2 (ex. 1,2,4,8,16,32). So what you do is make a chart as the one below.
__16(2^4)__|__8(2^3)__|__4(2^2)__|__2(2^1)__|_1(2^0)_
Now plug in you binary to the chart above so that each digit has its own place value like the one below:
__16(2^4)__|__8(2^3)__|__4(2^2)__|__2(2^1)__|_1(2^0)_
1 0 1 0 0
Now add the values together that has a 1 in the place value: 16+4=20
Thats how you convert binary to decimal.
No comments:
Post a Comment