Binary question

Status
Not open for further replies.

harnar123

Daemon Poster
Messages
539
so I am learning how to convert numbers to binary in my networking class. I was wondering how the **** does 221 =11011101. I am using the divide the number by 2 method until there is nothing left method. When I divide 221/2 I get 110.5 which then is 1, but then 110/2 is 55, which when then be 0

Seeing as the book says it starts with 11 and not 10 I am really confused.
 
Hello,

...When I divide 221/2 I get 110.5 which then is 1, but then 110/2 is 55, which when then be 0

Seeing as the book says it starts with 11 and not 10 I am really confused...

The steps you are taking are correct. The problem is that when you've finished the division process you're reading the binary numbers in the wrong direction (that is, the sequence of binary numbers should be read from the end of the division process to the beginning).

So...

<tt>2)221 1
</tt><tt>2)110 0</tt><tt>
2)55 1
2)27 1
</tt><tt>2)13 1</tt><tt>
2)6 0
2)3 1
1</tt>

(Note that I've rounded the non whole numbers down to the nearest whole number). You read the binary numbers going up, so 221 in base 10 = 11011101 in base 2 (binary).
 
I never learned any methods of converting it like that, but:

11011101

1+4+8+16+64+128=221
 
alright, thanks, yeah, I don't know the first method works for me, but I can't do the second method. It gives me a headache. This book explains it strange and it looks like I need to know how to do it Spit-wad's way to do subnet masks. Care to explain?
Also, so once the internet switches to ipv6 then subnetting won't be used half as much?
 
Hello,



The steps you are taking are correct. The problem is that when you've finished the division process you're reading the binary numbers in the wrong direction (that is, the sequence of binary numbers should be read from the end of the division process to the beginning).

So...

221/2 1
110/2 0
55/2 1
27/2 1
13/2 1
6/2 0
3/2 1
1/1 1

(Note that I've rounded the non whole numbers down to the nearest whole number). You read the binary numbers going up, so 221 in base 10 = 11011101 in base 2 (binary).

So basically you just do "integer division" and keep dividing by 2, and if it's not an even number, it gets a 1?
 
if the resulting number is not a even number it gets one I believe so lets see 221/2 = 110.5 so that gets a 1
Man, anybody have a subnetting for dummies, cause this is so confusing!
 
"however, you can't use the IP address in which all host bits are 1's because ot
s the broadcast address for that networlk" um what?
 
if the resulting number is not a even number it gets one I believe so lets see 221/2 = 110.5 so that gets a 1...

Yes that's correct, but rather if the resulting number is not a whole number (which I think you mean to say anyway).

Personally I prefer the subtraction method rather than the division method:

Decimal to Binary using Subtraction
d2bej8.gif

How to Convert from Decimal to Binary
 
Yeah, I think the subtraction method would be easier if you haven't taken a basic programming or Java course or something (cuz then integer division should be ez).
 
...This book explains it strange and it looks like I need to know how to do it Spit-wad's way to do subnet masks. Care to explain?

Also, so once the internet switches to ipv6 then subnetting won't be used half as much?

Yes to your second question, because the number of available addresses is so large with IPv6.

What in particular about subnetworks do you need help with?
 
Status
Not open for further replies.
Back
Top Bottom