What are the hex and binary data conventions?
FollowThe data follow the little endian convention. This means that to convert HEX to decimal you need to put the lowest significant byte before the most significant byte and the convert. For example: FD0C->0CFD->3325 (*0.1deg) ->332.5 degrees.
Go to http://en.wikipedia.org/wiki/Endianness for more information.
All values which have a sign (+ve or -ve) use Two's complement convention. In this case follow these steps:
1) Convert to binary (remember little endian)
2) If the first bit is 0 convert to decimal
3) If the first bit is 1. Invert all the numbers (0=1 and 1=0), add one and convert to decimal and change the sign to minus.
For example:
F1FF>FFF1>1111111111110001>0000000000001110+1>0000000000001111>-15 (*0.1 degrees) > -1.5 degrees
Go to http://en.wikipedia.org/wiki/Two's_complement for more information.
Comments
0 comments
Please sign in to leave a comment.