Loans | Loans | Mortgage Calculator | Houses for Sale | Xecuter 3 Mod Chip
Binary to decimal. [Archive] - PCMech Forums

PDA

View Full Version : Binary to decimal.


Airmack
10-23-2002, 10:43 AM
Not really a problem with internet. But how do I convert binary to decimal?

0110 and 1001

How do you make a decimal into binary?

4-18
62-67
125-130


Thanks for your help!

Ryan J

homer15
10-23-2002, 11:32 AM
<a href="http://www.learnbinary.com/Binary2Dec.html" target="_blank">here</a> is a binary to decimal converter that sort of shows how it's done.

and <a href="http://www.geocities.com/binary_converter/" target="_blank">here</a> is an all around converter.

reboot
10-23-2002, 11:37 AM
Basic binary is easy.
The first digit (it's backwards in binary, you start at the right and work your way left) is worth 1, the second digit is worth 2, the third 4, the fourth 8, the fifth 16 and so on. Just add them up.
So 0110 translates as zero ones, one 2, one 4, and zero 8's. Thus it's adding 2 and 4 to get 6, and 1001 is one 1, zero 2's, zero 4's, and one 8, added up make 9.

Trent Steel
10-23-2002, 11:54 AM
Binary to decimal
6 and 9

Decimal to binary
100-10010
111110-1000011
1111101-10000010

To get those conversions you can cheat and just use a scientific calculator and go from dec ---> bin and bin ---> dec. You can even use the built in windows calculator as long as you change it from standard to scientific.
To convert it you need to know how many characters are in a number system decimal = 10, binary = 2, hex =16, oct = 8, etc.
In a decimal system the number (usable numbers are 0123456789)
12345
is the same as
1*10^4 + 2*10^3 + 3*10^2 + 4*10^1 + 5*10^0
is the same as
10000 + 2000 + 300 + 40 + 5.

Where as the binary system the number (usable numbers are 01)
10111011
is the same as
1*2^7 + 0*2^6 + 1*2^5 + 1*2^4 + 1*2^3 + 0*2^2 + 1*2^1 + 1*2^0
which is the same as
128 + 0 + 32 + 16 + 8 + 0 + 2 + 1
which is the same as
187

You should see the pattern, this method will convert any number system into a decimal one (changes need to be made if dealing with number systems larger then the decimal system, but I will not detail that now). You take the number and time it by the number base you are dealing with dec = 10 bin = 2 to the power of the placeholder. For example the number 5061 (in the decimal system) has a 5 in the third place holder a 0 in the second a 6 in the first and a 1 in the zero. Hopefully that explains it well enough for you to convert any (binary) number system into decimal.

As for converting decimal into binary it is a little bit more difficult as most people normally think in decimal and not binary so a little more work needs to be done.
Lets convert the following number into binary
736
first see what the largest power of two that will fit into that
2^0 = 1
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16
2^5 = 32
2^6 = 64
2^7 = 128
2^8 = 256
2^9 = 512 (biggest that fits)
so now subtract 2^9 or 512 from 736
736 - 512 = 224
again find the largest power of two that will fit into it
2^7 =128
repeat the subtraction procedure
224 - 128 = 96
and continue
2^6 = 64
96 - 64 = 32
2^5 = 32
32 - 32 = 0 (once you reach zero your done)

Now what numbers did we subtract from the original
2^9 + 2^7 + 2^6 + 2^5
these places will have a value of one in the binary system all others will have a zero.
To be more complete you can write the above equation will the zero places
1*2^9 + 0*2^8 + 1*2^7 + 1*2^6 + 1*2^5 + 0*2^4 + 0*2^3 + 0*2^2 + 0*2^1 + 0*2^0

now writing it in binary
1011100000
check the results using a calculator untill you get the hang of the procedure.

Well I hope that helps you there Airmack.

reboot
10-23-2002, 12:08 PM
Yeah, what he said... :D

TEEB
10-23-2002, 12:32 PM
Us Canadians really know our math:D

homer15
10-23-2002, 12:57 PM
sometimes, i like to look at decimal to binary as sort of using a filter.


you start with 512:
___
______
__________
_____________
_________________
___________________
______________________
________________________
__________________________
________________________________
________________________________
__________________________ 1
________________________ 2
______________________ 4
___________________ 8
________________ 16
_____________ 32
__________ 64
______ 128
___ 256
512



you take your number, whatever it is, and slide it through the filter. the filter takes out the chunck that it's alotted and moves it down. for each chunk taken, a 1 is placed under the value.
like, say you had 176. slide it through the filter, and 128 takes a chunk, 32 takes a chunk, and 16 takes a chunk. leaving the binary number 0010110000.
i know it's sort of stupid, but sometimes looking at things in a different way like this helps me out.

doctorgonzo
10-23-2002, 01:23 PM
That's a pretty good visual representation, homer. There is more than one way to think about the concept of base arithmetic.

Airmack
10-23-2002, 02:54 PM
the binary to decimal was easy, after you seen how its done.

still not sure on the other way around.


Off topic question, can you eneter a binary into IE and get a web site?

doctorgonzo
10-23-2002, 03:15 PM
Originally posted by Airmack
Off topic question, can you eneter a binary into IE and get a web site?

No, but you can enter a dotted-quad decimal IP address. Entering http://209.197.112.213/ will get you this forum, but entering the binary address (11010001.11000101.01110000.11010101) will not.

Iman74
10-23-2002, 03:30 PM
Or you can be like me and just use the Windows Calculator.

Airmack
10-23-2002, 03:34 PM
Use my ti 83