We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide
binary code :?
TeaBoy_2
Posts: 408 Forumite
in Techie Stuff
im trying to get my head around binary code (for ip addresses), hate anything at all mathematical.
i'm ok changing the binary code to a number.
say 11010111 is 215. (128+64+0+16+0+4+2+1) but i cant work it out the other way. for example, how would i know what the binary is for 239?
its for an exam tomorrow. help would be much appreciated!
i'm ok changing the binary code to a number.
say 11010111 is 215. (128+64+0+16+0+4+2+1) but i cant work it out the other way. for example, how would i know what the binary is for 239?
its for an exam tomorrow. help would be much appreciated!
What's it going to be, eh?
0
Comments
-
Basically subtract the largest power of two from the number, and keep going...
eg..
239 - 128 = 111 (1)
111 - 64 = 47 (1)
47 - 32 = 15 (1)
15 - 16 = (not possible therefore 0)
15 - 8 = 7 (1)
7 - 4 = 3 (1)
3 - 2 = 1 (1)
1 - 1 = 0 (1)
so 239 = 11101111This is not a signature...0 -
Xio's right, that's how I do it. Starting with largest binary, mark it as 1 for every number you can successfully subtract until you get down to 1."She is quite the oddball. Did you notice how she didn't even get excited when she saw this original ZX-81?"
Moss0 -
keep dividing by 2 and note the remainder
http://www.groovyweb.uklinux.net/index.php?page_name=how%20to%20convert%20binary%20to%20decimal
or line up in a
1024 512 256 128 64 32 16 8 4 2 uEver get the feeling you are wasting your time? :rolleyes:0 -
Hi TeaBoy
If you're using Windows...
Open up the Calculator (It's in Accessories)
Click 'View'
Click 'Scientific'
Click the 'Dec' radio button
Enter your decimal number
Click the 'Bin' radio button
Sorted
:cool:
ps I know you won't be able to take your pc into the exam, but it might help to check your answers while practicing.Never interrupt your enemy when he is making a mistake.0 -
oh yeah, of course! thanks very much for the replies. makes sense now.What's it going to be, eh?0
-
There used to be a signature on here a few months back.
"There are 10 types of people. Those who understand binary and those who do not"I used to be indecisive but now I am not sure.0 -
i'm one of those who don't. i've spent all day trying to answer last years paper with the use of the internet and all my notes!! still struggling! god help me tomorrow.What's it going to be, eh?0
-
albertross wrote:keep dividing by 2 and note the remainder
http://www.groovyweb.uklinux.net/index.php?page_name=how%20to%20convert%20binary%20to%20decimal
or line up in a
1024 512 256 128 64 32 16 8 4 2 u
This is the way Ive done it for years. Doing it this way will also help with dec to hex or hex to dec.
a hex example
number = 2C4F
32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
0 0 1 1 1 1 0 0 0 1 0 0 1 1 1 10 -
DrSmutt wrote:This is the way Ive done it for years. Doing it this way will also help with dec to hex or hex to dec.
a hex example
number = 2C4F
32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
0 0 1 1 1 1 0 0 0 1 0 0 1 1 1 1
Hopefully you were just jotting down binary numbers as 2C4f in binary is actually 2 C 4 F
10 1100 0100 11110 -
oops didnt double check it.0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 353.5K Banking & Borrowing
- 254.2K Reduce Debt & Boost Income
- 455.1K Spending & Discounts
- 246.6K Work, Benefits & Business
- 603K Mortgages, Homes & Bills
- 178.1K Life & Family
- 260.6K Travel & Transport
- 1.5M Hobbies & Leisure
- 16K Discuss & Feedback
- 37.7K Read-Only Boards