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
Converting Binary number to Hex
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Converting Binary number to Hex
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Converting Binary number to Hex
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 .
http://www.easycalculation.com/decimal-converter.php
hope it is of some use .
