# Binary > Decimal > Hexadecimal and vice versa?

Gaz 25 19:36 29 Sep 2004
Locked

I am always confused about the binary digits and convertion to decimal and to hexadecimal.

I reliase 8bits are in a byte which is one binary digit array.

However, is there an easy way of doing 147 to binary then to decimal, then to hexadecimal?

Im confused, its needed to progress further in a cisco course. :-o It's just very confusing.

VoG II 19:40 29 Sep 2004

147

10010011

147

93

Graham ® 19:41 29 Sep 2004

Here's a ready reckoner, though I suspect that's not what you want!

gillersuk 19:43 29 Sep 2004

binary to decimal. steps:
1. divide by two;
if remainder then put one
if no remainder then put zero (i.e. decimal number is even)
2. now take off the remainder if there is one and do step 1.
3. repeat 1 and 2 untill you get to the number one then stop.

e.g. decimal 11
divide by 2 = 5.5

gillersuk 19:43 29 Sep 2004

binary to decimal. steps:
1. divide by two;
if remainder then put one
if no remainder then put zero (i.e. decimal number is even)
2. now take off the remainder if there is one and do step 1.
3. repeat 1 and 2 untill you get to the number one then stop.

e.g. decimal 11
divide by 2 = 5.5

Gaz 25 19:45 29 Sep 2004

I don't think in a cisco exam your allowed calc's otherwise I wouldnt be bothered.

I think the idea is to learn a technique, but I cant seem to grasp it from the cisco's website.

Thanks anyway for the websites.

Dan the Confused 19:47 29 Sep 2004

Difficult to give a lesson in one post, I'm sure Google will prove more help.

A neat way of converting bin to hex is to divide the binary number into 4s, so 11010101 becomes 1101 and 0101 then replace with the hex values, which is D and 5 (13 and 5) so 11010101 is D5.

Any help? Nope!

gillersuk 19:48 29 Sep 2004

cont from last post;

eg. decimal 11.

divide by two = 5.5 1
divide 5 by 2 = 2.5 1
divide 2 by 2 = 1 0
divide 1 by 2 = 0.5 1

then stop and you have 11 decimal in binary (1011)

then to hexedecimal;

make sure that your binary number has a multiple of four digits in it, if not then add zeros to the front untill you do. then take the first four binary digits and convert them to decimal. and put the answer down (if the answers is 10-15 use a-f instead of numbers), contine this untill you have no more digits to use.

11 (decimal), 1011 (binary), b (hexedecimal)

hope that helps.

VoG II 19:48 29 Sep 2004

Gaz 25 19:49 29 Sep 2004

How did you work that out?

147 = 10010011

I need a method you see, I don't understand the one on cisco's website.

gillersuk 19:53 29 Sep 2004

147/2 = 73 remainder 1
73/2 = 36 remainder 1
36/2 = 18 remainder 0
18/2 = 9 remainder 0
9/2 = 4 remainder 1
4/2 = 2 remainder 0
2/2 = 1 remainder 0
1/2 = 0 remainder 1