• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Converting decimal numbers into binary

nusyo

Member
More precisely I am referring to converting an ip address into binary. Do people look at an IP address and are able to convert it right away into binary and the other way around?

I mean , i know how it's done, but is it required to know this without pencil and paper?

I started to take some network classes and kinda work my way to either a degree or certifications.

Thanks
 
It's not that hard once you get the hang of it.
You get uses to the numerical progression.
 
Given a decimal number and start with the LSB going to the MSB:
Step 1. If its even, write 0. If its odd, write 1.
Step 2. If its even, divide by 2. If its odd, subtract 1 then divide by 2.
Step 3. With the new number, repeat step 1 until you reach 0.
 
More precisely I am referring to converting an ip address into binary. Do people look at an IP address and are able to convert it right away into binary and the other way around?

I mean , i know how it's done, but is it required to know this without pencil and paper?

us your fingers (but not thumbs) to keep up with the 8 bits (and their equivalent values) for each octet, makes dealing with subnet masks/host ranges not too bad with some practice

youll probably want something to scribble on if you have to convert an entire address, that would otherwise need several fingers.

also:

http://www.subnettingquestions.com/

it helps to practice regularly.
 
Thank you.
When you go deep into something, it seems so complicated.

There is no other way to subnet a network but to use the formula y=2^n-2 which involves binary digits, right?

I am slowly making progress 🙂
 
I do it in my head. That being said I also know my immediate gas mileage and pi out to about 40 places, AND always have a binary clock running somewhere. You don't need to do this in the real world.
 
The only thing related to IP addressing you need to be able to understand in binary terms are subnet and wildcard masks. Otherwise, there's very little reason to convert an IP address to binary.

Once you understand subnetting, you'll realize that it's a lot easier than that ridiculous formula makes it seem.

For instance, if you're given 192.168.0.0/16 and you're told that you need 100 subnets, all you need to do is figure out which power of 2 gives you the number over 100. 2^7 = 128, meaning you need 7 bits to identify subnets. That means that each subnet is going to have a /23 (16+7) subnet mask (255.255.254.0).

If, on the other hand, you are given 192.168.0.0/16 and are told that you need multiple subnets with 480 hosts in them, you work backwards. 2^9 = 512, so each subnet needs 9 host bits. That means each subnet has to have a /23 (32-9) subnet mask (again, 255.255.254.0).

Learn your powers of 2 and understand what a subnet mask actually does, and subnetting is incredibly easy. No binary necessary, other than to recognize that /23 means 23 consecutive 1's followed by 9 consecutive 0's to form the subnet mask, represented in decimal as 255.255.254.0. But, there are really only 8 numbers you need to remember:

00000000 = 0
10000000 = 128
11000000 = 192
11100000 = 224
11110000 = 240
11111000 = 248
11111100 = 252
11111110 = 254
11111111 = 255

Once those become second nature, nothing else matters.
 
Let me amend that by saying that the freak who designed EUI-64 addressing for IPv6 is a sadistic fucker and makes you figure out the first 8 binary digits of the MAC address so you can arbitrarily flip the 7th bit and then convert back to hex. It performs no functional purpose and adds nothing to the IPv6 standard, but you have to do it anyway.
 
0.0.0.0.0.0.0.0
0. 0. 0. 0. 0.0.0.0
128.64.32.16 8.4.2.1


10000000 = 128
11000000 = 192
11100000 = 224
11110000 = 240
11111000 = 248
11111100 = 252
11111110 = 254
11111111 = 255


00000000 = 0
00000001 = 1
00000010 = 2
00000011 = 3
00000100 = 4
00000101 = 5
00000110 = 6
00000111 = 7
00001111 = 15

Once those become second nature, nothing else matters.

Added a little to your great post.
 
Last edited:
wow the way you guys put it.... it's a lot easier than what's in the books

i am glad i joined the forums 😛 and btw ... these forums should have a "thank" or "rep points" feature ....
 
It's good to look at multiple sources for subjects like binary math and subnetting. For me to get a good grasp, I had to have it explained multiple times and then after the fact do alot of practicing.
 
Used to know this crap off the top of my head like it was just another language from programming so much Comodore Basic, 6502 and direct ML.
When the Matrix came out and Cypher was explaining to Neo about looking at the construct lang I remembered those day past.

Now I can hardly remember squat about it
 
Back
Top