As I understand it, in signed binaries the first bit indicates whether the number is positive (0) or negative (1). For example, if using signed values the binary number 10100110 represents -38 and 00100110 = +38 (note: if not using signed values, 10100110 = 166).
What has me confused is that Tunerpro doesn't seem to work this way. If the binary value is 10100110 and I check the Signed checkbox in the item's xdf settings I get -90 instead of -38. 90 in binary is 01011010, so -90 should be 11011010. How is Tunerpro getting 11011010 out of 10100110?? I'll try to summarize below:
Signed binaries
10100110 = -38
00100110 = +38
Tunerpro
10100110 = 166 if "Signed" is unchecked, -90 if checked
What am I missing here???
Questions regarding signed values in Tunerpro
Moderators: Mangus, robertisaar, dex
Whilst the high bit of a signed byte is used to signify whether the number is positive or negative it's not simply a case of toggling it to change the value from positive to negative and vice versa.
To convert a number to negative perform NOT and add 1
To convert a number to positive subtract 1 and perform NOT
Thus if you take your example of -38 this is 11011010 in binary and if you try this you'll see it works out
To convert a number to negative perform NOT and add 1
To convert a number to positive subtract 1 and perform NOT
Thus if you take your example of -38 this is 11011010 in binary and if you try this you'll see it works out