Page 1 of 1

Converting Binary number to Hex

Posted: Fri Aug 03, 2007 9:21 am
by Benj
to configure bits in registers it is fairly easy to convert between binary and hex.

eg Bx000100011

split the binary value into two sections of 4 bits

0001 and 0011

then imagine that starting from the right and working left for each block of 4 that the first bit is 1 the next bit is 2 then 4 then 8.

0001 and 0011
8421 and 8421

Addup the value of the ones.

If the value is over 9 then 10 is equal to A, 11 is equal to B ... 15 is equal to F

then you have the hex value. 0x 1 3 ... 0x13

A few other examples

Bx01010101
= 0101 0101
= 5 5
=0x55

Bx11101011
= 1110 1011
= 14 11
= E B
= 0xEB

Re: Converting Binary number to Hex

Posted: Thu Sep 25, 2008 7:04 pm
by chevy6600
here is a internet site that does the conversion automaticly for you, you sellect what you want to convert to, then input your data, and it shows the result. I use it all the time....the site also converts all sorts of data that may be of interest in other things.
http://www.easycalculation.com/decimal-converter.php
hope it is of some use . :mrgreen: