# How to convert decimal to binary

In this section I will look at converting

decimals to binary, hexadecimal and also look at the operation called “and”. These skills

are important to learn when you start dealing with IP addresses. If you career starts taking

you more towards the networking side of things, understanding how to convert numbers between

different formats becomes essential to creating and managing a network.

In computing you have switches which can either be set to on or off. This gives you 2 possible

values. To allow you to represent larger numbers computers group these switches together. The

most common one you will deal with is a byte which is 8 bits. A byte has a value of 0 to

255. To convert a decimal to a binary I use the

following table. Each bit in the table has a value assigned to it. You can see, going

from right to left the first value has a 1 in the first position. The second position

has a value of 2. Twice the previous value. The 3 position has a value of 4. As you can

see the value doubles in each position until the final value of 128.

If I take a random number, say 174 and wanted to convert it into binary I would do the following.

First I would go to bit 8 and work out if 174 is greater or equal to 128. If 174 is

greater than 128, which it is, the result is a 1. I would than subtract 128 from 174

and place the result, 46 in the next column. The next column has a value of 64.

46 is not greater than 64 so the result is no and gets a value of 0. I now move 46 to

the next column and compare it with its value of 32. 46 is greater than 32 so I place a

one in this column and subtract 32 from 46 to give me 14. I keep following the same procedure

throughout the table. You will notice that when I get to the second

last column the value 2 equals the column value. In this case the value is equal to

the column value and thus the result is still a one. All columns after this will equal zero

since there is no remainder to subtract from the column value. This gives us a binary value

of 1 0 1 0 1 1 1 0. Using this method you can quickly and easily covert any decimal

number into a binary number. With IP version 6, hexadecimal is used in

the IP address so you need to have an understanding of it in order to master IP version 6. If

I were to take an IP version 4 address and convert to hexadecimal I would do the following.

First of all I would convert the numbers into binary using the previously shown method.

Once the numbers are in binary they are easier to work with. The next step is to divide the

binary into groups of four. Dividing the bits up like this gives each group of 4 bits 16

different possible values. Hexadecimal uses 16 values and thus that is where hexadecimal

gets it’s name from. It is a simple matter to convert these values into decimal values.

As you can see each group of 4 bits has been given a value between 0 and 15. Once you have

this value you can use this table to determine the hexadecimal value. As you can see the

first value 12 and gets a value of C. Values between 0 and 9 get the same value so therefore

the values in the example 0, 9, 1, 1 and 3 all get the same values.

It is not till we get to far right you see the value 14 will get the value of E and the

value 10 will get the value of A. Certain IP version 6 addresses have IP version 4 addresses

imbedded in them. It is important to understand how to covert decimal to hexadecimal to understand

IP version 6 addresses. Slide 4

Once you start working with more than one network, it is important to understand how

the “and” operator works. Consider this table. When comparing two bits, if both bits

are 1 the result is a one. You will notice that in all other cases the results is zero.

All it takes is one or both bits to be zero and the result it zero. If you have trouble

understanding this, think of the “and” operator as a multiplication operator instead.

1 times 1 is 1. 1 times 0 is 0. 0 times 1 is 0 and 0 times 0 is 0.

Why is the “and” operator important? Later in the course you will learn the “and”

operator is used to determine the destination of a packet. Consider this small network.

If a computer sends data over the network to a server, the computer needs to determine

if the data is to be sent directly to the server or the data needs to be sent via a

router. If the server is on the same network as the

client it sends it directly to the server. If the server is on anther network the client

computer sends the data to a router. By using the “and” operator, your computer can

work out where to send the data. Later on in the course this process will be explained

in more detail. This has been a short induction to converting

decimals. If you don’t work a great deal with the networking side, you may want to

consider using the windows calculator to convert decimals to hexadecimal and binary for you.

Just remember to switch the calculator to scientific mode first. Before sitting for

your exam, check the exam requirements. A lot of the exams will allow you to use the

windows calculator in the exam. If you are planning to sit any Cisco exams, you need

to have an excellent understanding of how to covert decimals.

Cisco don’t give you a calculator in the exam to help you and believe me you need to

do the math fast. Lastly if you need more practice there are a lots of resources on

the internet. When I was first learning networking I used a web site called learn to subnet dot

com. This is a great little site that will help

you understand how to convert decimals to binary and also how to subnet. I will cover

subnetting in more detail later in the course so don’t worry if you don’t understand

it yet. For the present just make sure you understand the basics of binary and hexadecimal.

If you don’t understand how to covert values you can also cheat for the moment and use

the windows calculator.

Thanks to the person who created all the videos, a big thank you:-)

Thanks very much.

sir in this video when i saw this video you are teaching so fast and i understand binary in to decimal but i am lacking in binary in to hexadecimal

if you do not mind so can you post on more video about this topic in more detail

thnak you

Eventually we will look at updating this video, but unfortunately that is a while away. I do agree the video is a little bit short for the material covered.

thanks it helps a lot.

Good to hear, thanks for taking the time to leave a comment.

Thanks for the fantastic vids, they are really helping with study for the 70-642. Are the slides available for download anywhere for notes purposes? I know, I'm being cheeky now 🙂 All the best, and thank you again!

Glad to liked the video. There are no slides available at present. We don't use PowerPoint style presentation style software to make the video so it's not that easy. You are not the first person to ask, so we will look at doing something. For videos like this would help a lot. All the new videos have long descriptions to help you find information fast about the video.

hi sir, i'd like to know how you get 12 and 14 for the hexadecimal.

thank you.

The value is being converted from binary to decimal. So 1100 is 12 in decimal. 1110 is 14 in decimal.

Great as always keep up the good work!

Thank very much and thanks for watching.

U r my guru. Thnx a lot to those team work for easier knowledge.

Your welcome, thanks for watching.

Thanks very much.

this is much easier than my prof had disscussed thankz!

Glad we could help.

Muchas Gracias por el vídeo*Thank you for video*

You are very Welcome

Awesome. I'm in an experiment IT training course. I love it how you simply and clearly explain the concepts without TRYING to confuse. I don't understand why things have to be made harder on purpose! Thanks!

Thanks very much. We do our best.

Thanks very much and thanks for watching.

valuable to watch & i pay thanks for the complete series!

Thanks very much but there is no need to pay. 🙂

thank u very much…….

For anyone wondering where 12, 0, 9, 1,1,3, 14,10 came from, the numbers were converted from binary to decimal.

Binary — Decimal

1100 12

0000 0

1001 9

0001 1

0001 1

0011 3

1110 14

1010 10

Thank you very much for all your hard work. I studied with your videos and I passed my 70 – 642 with 925 scores. Its really nice. and helpful too. Thank you once again.

Hi thank for videos but at first it seemed easy but when i tried to convert 796 according to this table it gave 1111111111 etc. ((( i don't understand why i cheked in caclulator (the programmer view) it gave me1100011100 plz help

if binary 32 bit?

Thanks, it isvery good video.

I didn't catch where the 12 0 9 1 1 3 14 10 came from

Good video! very helpfull Thanks

HELP ME PLEAS ! I DON'T KNOW HOW TO USE IT

I am using for trading

how can i convert this because i got this revision sheet and it tells me to convert from decimal to binary and the question is 77.0625 what is that decimal?(77(.)0625 and there is all convert from binary to decimal 1100001.11011 and I'm like what the hell is this?

I got a better idea for converting Decimal to Binary. It won't need a chart or comparison.

Let's take your value: 174

Divided by 2———- 174/2 = 87 ——0 in binary, because it no remain.

Next take 87/2=43 remain 1. Since it has the remain, It will be 1 in binary.

Keep continue 43/2=21 remain….—–1 in binary.

21/2=10 remain…——1 in binary.

10/2=5 no remain—-0 in binary.

5/2=2 remain…——1 in binary.

2/2=1 no remain—-0 in binary.

Until you get 1/2 ———————1 in binary.

Let's count from bottom to top we have: 10101110 That's it. It's easier RIGHT?

P/s: For converting to Hexadecimal, we can do almost same thing. Divided by 16 and take the remain. Anyway, I can do the example if someone interesting.

how did you get the value mentioned. 12,0 9,1 1,3 14,10?

love how you integrate the conversion going vertical on a slide

plese, helpme my computer doesn't show usb devices, how can i add it?

Such a nice video. Very simple and easy to understand.

Please check my technology videos – @ — learn what I teach in the classroom which allows my students to work in-field while still in school! if you Like, Subscribe and Comment with your channel's link, I will do the same.