Binary Numbering Versus Decimal Numbering

Binary numbering uses only 0s and 1s. It is a base-2 numbering system in which one is the largest digit that can be used in any position. This is the same as having nine be the largest number that can be used in any position in a decimal number.

Each digit in a binary number is multiplied by 2 to the power of the digit's position in the binary number, with the first position being the power of (0). Any number to the power of 0 is 1. Therefore, (1*(100))=1=(1*(20)).

Consider the binary number 1010. It can written in the more explicit form of 1*(23) + 0*(22) + 1*(21) + 0*(20). This is one way to convert a binary number to a decimal number. In this case, 1*(23) equals decimal 8, 0*(22) equals decimal 0, 1*(21) equals decimal 2, and 0*(20) equals decimal 0, resulting in the following formula: 8+0+2+0=10. Therefore, 1010 in binary is 10 in decimal format.

Compare the binary (base-2) number 1010 with the decimal (base-10) number 1010. You write out the base-10 number using the same system as the base-2 number, resulting in 1*(103) + 0*(102) + 1*(101) + 0*(100), which gives you the formula (1*1000) + (0*100) + (1*10) + (0*1)=1010. This is also written as 1010.

You now need to consider eight-digit numbers (bytes or octets) because this is the unit most commonly used by computer addressing schemes. Extend the concept of powers and position discussed previously to add four more digits.

First, consider the binary number 10101010. You can write it out using the same system as before: 1*(27) + 0*(26) + 1*(25) + 0*(24) + 1*(23) + 0*(22) + 1*(21) + 0*(20)=170 in decimal format. How do you arrive at this answer? Look at the following method for writing out the same number:

1*(27)= 128

+ 0*(26)= 0

+ 1*(25)= 32

+ 0*(24)= 0

+ 1*(23)= 8

+ 0*(22)= 0

+ 1*(21)= 2

+ 0*(20)= 0

= 170

Some people prefer to think about octets in terms of the values represented by each position. The positions are 7, 6, 5, 4, 3, 2, 1, and 0. These are the powers that the base is raised to for each position. For binary, the resulting values in decimal format are 128, 64, 32, 16, 8, 4, 2, and 1. Once again, 27=128, 26=64, 25=32, 24=16, 23=8, 22=4, 21=2, and 20=1.

Compare this to the decimal values for the same eight positions using base 10: 10,000,000; 1,000,000; 100,000; 10,000; 1,000; 100; 10; 1. Once again, 107=10,000,000; 106=1,000,000; 105=100,000; 104=10,000; 103=1,000; 102=100; 101=10; and 100=1.

Just as the decimal numbering system has a ten thousands place, a one thousands place, and a thousands place, the binary numbering system has a 128 place, a 64 place, a 32 place, and so on.

Note

One final note on binary octets: If every digit in an octet is set to 1, the resulting number in decimal format is 255. 128+64+32+16+8+4+ 2+1=255. This is a key point to understand because it plays a significant part in IP addressing.


An easy system for changing decimal numbers into binary numbers uses iterative division, dividing by 2 until a remainder of 1 is achieved. You can convert 170 in decimal form to its binary equivalent. You start by dividing the number to be converted (170) by 2. The result is divided by 2 again, while the remainder is written off to the side. Remainders are written from right to left.

170/2 = 85 R 0. Binary result so far 0.

85/2 = 42 R 1. Binary result so far 10.

42/2 = 21 R 0. Binary result so far 010.

21/2 = 10 R 1. Binary result so far 1010.

10/2 = 5 R 0. Binary result so far 01010.

5/2 = 2 R 1. Binary result so far 101010.

2/2 = 1 R 0. Binary result so far 0101010.

1/2 = 0 R 1. Binary result so far 10101010.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset