Discussion Locked

How do I convert hex bits?

0 helpful
12 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How can I convert 16 bit hex into a 22 bit hex?

12 replies

by jay

hex called hexadesimal because it has 16bit numeric.
hex use 0-9 and A-F so 22bit you can use 0-9,A-L for numeric symbol.

by russ werner

There is no converting of a 16 bit to a 22 bit hexidecimal number. A binary number in hexideciaml format number each bit represent the base 16 number to a different power. Example the least significent digit (on the right when written) is 16 to the 0 power the next digit to the left is 16 to the 1st power, the next 16 to the 2nd power so on and so forth. In a 16 bit hexidecimal the most siginificent digit (the one on the left)would be 16 to the 15th power. If you had a 22 bit number the most siginificent number is 16 to the 21st power. The answer above made reference to the letters above F ??? That isn't hexidecimal then. Hexidecimal is base 16 or 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F... You read the binary number, each position of a 1 is 16 to that power, then sum the 16 bit numbers and that is your total in decimal. This is a crude and short answer, but I would need lots more time and space to explain further, hope it helped.

by pbgerrard

I am assuming that you know that HEX is base 16, so I am not sure exactly what it is that you want to do, but there are conversion programs. Ultra-Edit text and HEX editor is a not too expensive software that can do all kinds of conversions, but look on the net, you may be able to find all the conversion programs you need.

by zlatin zlatev

First convert the hex to binary - then do shift right to 6 bits.
What programing language are you using for that (or you may be want to do it manually)?
Why not add a single "0" in front of the Hex Number.
I suppose you are using some special encoding, because 22bits is not a standard size - please, if the above answers are not what you need - explain your problem in details.
Regards,
Zlatin Zlatev, MCP

by zlatin zlatev

If you want to change the base of the number from 16 to 22 - this is another story. Mail me for more details to tell you the way (do not expect fast answer - I'm to busy at the moment)

This discussion is closed to new replies.