# Understanding Binary Numbers, A way To Master Networking.

From my works and my experience as a network person, I come to find out that the most terror aspect of subnetting narrows down to mastering the binary numbers, many of us struggle with IP addresses because we lack the basic understanding of binary numbers.

Let me quickly say this: As a person seeking carrier in the network industry you must not know all mathematical formula but An understanding of binary numbers, the binary system, and how to convert between binary and decimal is essential for you because it forms most computers, coding, and networking.

For example we are told that “while your typing alphabets from your keyboard, computers sees them as binary numbers like 1 and 0’s” and then code them, process them, and give you the output which is in turn readable in any language.

**In this tutorial we will digest the following:**

How to convert binary to decimal and back again

How to convert binary numbers to Hexadecimal and back again

How to convert Hexadecimal to decimal and back again,

### The Binary Number System

Binary numbers are simply base 2 numbers, and have only two values –

**0 and 1.**If we look at a binary number like 101, then we can again assign column values as we did with our decimal number, but this time we use 2, and not 10 as the base.

So binary

**101**binary has 1 in the units column,0 in the 2s column and 1 in the 4s column.Again if we work our way from right to left then:

The 1 is a 1 as it is in the units column but the next 1 is not 1 but 1*4=4

See picture below

Binary numbers use base 2 and so the columns are

### The Binary Number System

### Binary To Decimal Conversion

### More Examples:

### You can Try doing this Yourself

### Let’s Convert from Decimal to Binary

### Bytes and Octets and Hexadecimal Numbers

### Binary to Decimal and Decimal to Binary Conversion 8 Bit Numbers

#### Decimal to Binary Conversion Example

### Understanding Hexadecimal Numbers

,

### The Binary Number System

Binary numbers are simply base 2 numbers, and have only two values –

**0 and 1.**

Binary numbers use base 2 and so the columns are

### Binary To Decimal Conversion

Here, we will take a few binary numbers and convert them to decimal

Let’s start with the three digit binary number

**101****just like the scenario above.**The number can be converted to decimal by multiplying out as follows:

1*1 + 0*2 + 1*4 = 5

The maximum value we can have with three binary digits is 111 = decimal 7 calculated as follows-

1*1 + 1*2 + 1*4

### More Examples:

1011 binary = 1*1+1*2+0*4+1*8=11

1111 binary = 1*1+1*2+1*4+1*8=15

### You can Try doing this Yourself

1001 binary = ?

1100 binary = ?

### Let’s Convert from Decimal to Binary

How do you convert a decimal number to a binary number.

Example what is

**decimal 10**in binary.The way I do it is by using the following list of 2 multiples.

128,64,32,16,8,4,2,1

Here’s is my best and everyday chart

The procedure is to subtract the number with largest power of two from the decimal number

The

**largest power of two numbe**r that we can subtract is**8**which is 2^{3}.So 10-8 =2

we now do the same with the remainder so the largest number we can subtract is 2 which is =2

^{1}2-2=0

so we have 1 eight , No fours, 1 two, No units = 1010

**= 2**^{3}**+ 2****.**^{1}**Example 2**: Decimal 13 to binary code

1 eight , 1 four, 0 two, 1 units = 1101.

**Example 3**: Decimal 7 to binary code

0 eight , 1 four, 1 two, 1 units = 0111.

**Answers to try it yourself questions**

1001 binary = 9

1100 binary = 12

### Bytes and Octets and Hexadecimal Numbers

In computers, coding and networking 8 bit numbers are common.

An 8 bit number is known as an

**octet**, and also more commonly it is called a**byte**.### Binary to Decimal and Decimal to Binary Conversion 8 Bit Numbers

An 8 bit binary number can represent a maximum of decimal

**255**= binary**11111111**.Calculated as follows:

1*128 +1*64+1*32+1*16+1*8+1*4+1*2+1+1 =

**decimal 255**Here is another 8 bit binary number –

**01101011.**To convert it to decimal we write the number with the column numbers above, as follows:

if we convert our columns to decimal equivalents using the following chart.

then the binary number

**01101011**= 1*1 +1*2+0*4=1*8+0*16=1*32+1*64+0*128=64+32+8+2+1= 107

**Notice**it consists purely of 1’s and 0’s.

To convert this number into decimal we need to understand what each 1 represents.

If we write the

**column value**s above the numbers then it becomes easy to convert the binary number to decimal.#### Decimal to Binary Conversion Example

A final larger example convert decimal 200 to binary code

**200**=128+64+8=

**2**

^{7}**+ 2**

^{6}**+ 2**

**=**

^{3 }**11001000**

Once you are happy with the process then you can use a

**binary to decimal calculator**like the one on windows.This converts binary numbers to decimal

and this converts decimal numbers to binary

### Understanding Hexadecimal Numbers

A hexadecimal number (base 16) requires

**4 bits**and and has a maximum value of**15**. It uses the symbols**0-9,A,B,C,D,E,F**.They are represented in binary form as follows:

0000=0

0001=1

0010=2

0011=3

0100=4

..

1010=A

1011=B

1100=C

1101=D

1110=E

1111=F

0001=1

0010=2

0011=3

0100=4

..

1010=A

1011=B

1100=C

1101=D

1110=E

1111=F

**A byte**(8 bits) can be represented as

**two hexadecimal numbers.**

so

**FF**=binary 11111111 and decimal 255

**F0**=11110000 binary and decimal 240