• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Whats the easiest way to convert a number into binary

NightAngel79

Mandalorian
Administrator
I can easily turn 11101111 into a number (its 239 right?) but when given a number the way it was explained by my professor who barely speaks english had me lost. Anyone care to explain or know of a simple method?

Gotta take my network+ cert test for this classes final(not for 12 more weeks) and trying to asorb as much as possible
 
Since binary is a base-2 system, each digit represents an increasing power of 2, with the rightmost digit representing 20, the next representing 21, then 22, and so on. To determine the decimal representation of a binary number simply take the sum of the products of the binary digits and the powers of 2 which they represent. For example, the binary number:
100101
is converted to decimal form by:
[(1)
 
Since binary is a base-2 system, each digit represents an increasing power of 2, with the rightmost digit representing 20, the next representing 21, then 22, and so on. To determine the decimal representation of a binary number simply take the sum of the products of the binary digits and the powers of 2 which they represent. For example, the binary number:
100101
is converted to decimal form by:
[(1)
 
Or you could get the binary conversion app. LOL. I forget how to since I've never used it outside of the classroom.
 
I can easily turn 11101111 into a number (its 239 right?) but when given a number the way it was explained by my professor who barely speaks english had me lost. Anyone care to explain or know of a simple method?

Gotta take my network+ cert test for this classes final(not for 12 more weeks) and trying to asorb as much as possible
Do you have to do it by hand? I used to know how (it's not hard), but I'm so out of practice I can't help you right now. However, even in the '80s when I was in college we were [generally] allowed to use scientific calculators for math, chemistry, and physics tests. Is this an option for you, or must it be done by hand?
 
Its basically remainder math.

For 239, what is the highest power of 2 smaller than your number. 256 is higher, so start with 128, or 2^7

10000000

239-128 = 111. 64 is the highest that will go in, so

11000000

111-64 = 47, 32 goes in

11100000

47-32 = 15.... 16 does not go in, so you leave a 0, 8 goes in

11101000

15-8 = 7 , 4 goes in

11101100

3, 2 goes in

11101110

1, 1 goes in

11101111



kinda long, but the only way I know how
 
just work from left to right subtracting the highest number that will fit

128, 64, 32, 16, 8, 4, 2, 1

so as 239 converts into an 8 bit number (8 bit max is 256) we firstly take off 128 which gives us
10000000 and 111 left over so we now take off 64 which gives us
11000000 and 47 left over so we now take off 32 which gives us
11100000 and 15 left over so as we cant take off 16 we now take off 8 which gives us
11101000 and 7 left over so we now take off 4 giving us
11101100 and 3 left over ..........................2.........
11101110 and 1 left over ..........................1.........
11101111 and 0 left over


HTH
 
Or you could get the binary conversion app. LOL. I forget how to since I've never used it outside of the classroom.

Do you have to do it by hand? I used to know how (it's not hard), but I'm so out of practice I can't help you right now. However, even in the '80s when I was in college we were [generally] allowed to use scientific calculators for math, chemistry, and physics tests. Is this an option for you, or must it be done by hand?
Need to know it to take the comptia network+ certification test so i assume no calculators allowed....
 
Nozspark has hit it bang on correct. This is the way I learnt it for the CCNA. So just start by writing the numbers out so you get

128, 64, 32, 16, 8, 4, 2, 1

and work from there as Nozspark has shown you.








Also once you have the number written in binary you can easily convert to hexadecimal

just write out:

8,4,2,1 8,4,2,1 (yes it is the 1st 4 numbers from binary:))

then write in your binary number below

8,4,2,1 8,4,2,1
1 1 1 0 1 1 1 1 to give
14 15
E F

So decimal is 239
Binary is 11101111
Hex is EF

This may be more than you need, but the ability to do convert between decimal, binary and hex on paper is an asset to you and admired by some employers.
 
Back
Top Bottom