# Decimal to binary. Subtract or Add?

Phandy
Posts:

**7**Member ■□□□□□□□□□
in CCNA & CCENT

Hi, when converting binary to decimal I was taught to create a table and add up the 1s. I.e :

128.64.32.16.8.4.2.1

O0001001

Equal 9 (pretty straightforward)

When converting decimal to binary, I was taught to use the same table above but to subtract the IP Address. So.

240.240.240.0

128 64 32 16 8 4 2 1

You would say can 128 be subtracted from 240? If yes place a 1, if not place a 0, and so on as you go through all the octets.

But, could you not just use the table and place ones in the columns from left to right until you get to 240 I.e add them up. Or, am I missing something?

Hope some one can clarify.

128.64.32.16.8.4.2.1

O0001001

Equal 9 (pretty straightforward)

When converting decimal to binary, I was taught to use the same table above but to subtract the IP Address. So.

240.240.240.0

128 64 32 16 8 4 2 1

You would say can 128 be subtracted from 240? If yes place a 1, if not place a 0, and so on as you go through all the octets.

But, could you not just use the table and place ones in the columns from left to right until you get to 240 I.e add them up. Or, am I missing something?

Hope some one can clarify.

0

## Comments

2,741MemberGenerally I know that if it's at least 128 then stick a 1 in the 128 column and go from there. I'm pretty quick at subnetting now after years of practice, but that's essentially how I do it.

129MemberAlso

128.64.32.16.8.4.2.1

O0001001

Equal 9 (pretty straightforward)

head

How did you get 9? As there are only 8 bits there

Each octect only contains 8 bits so from what you are showing up there you only have 8. (9 could be a typing error?)

95Member ■■□□□□□□□□In Progress:WGU B.S. - I.T. - Security (and all the certs that come with it)

7Member ■□□□□□□□□□So 9 in Binary

00001001

7Member ■□□□□□□□□□So 9 in Binary 00001001

7Member ■□□□□□□□□□95Member ■■□□□□□□□□You're welcome!

By the way you are not alone, subnetting will forever be intertwined with your networking career. The fact that you have questions means you're learning. Keep it up, it does get a little easier to understand the more you get exposure to it.

In Progress:WGU B.S. - I.T. - Security (and all the certs that come with it)

2,741Member