Hello, everyone. With regard to the calculation of frameshift, the book has given such a conclusion:
if the machine word length is n and the specified offset is 2 ^ (Nmai 1), then the shift is equal to the reverse of the complement symbol:
for example: the shift of-7 is 01111001 (because the complement of-7 is 11111001)
later I read a blog about calculating floating-point order codes, in which he calculated that the offset of 7 is 10000110 with an offset of 127.
that is, the source code of 7 + offset (000001111111 = 10000110)
:
then I want to verify the previous conclusion by calculating the frameshift in the blog (the shift equals the complement symbol is inverted): the original code of
-7 (10000111) + the offset original code (where the offset should be 2 ^ (NMAE 1), that is, the binary form 10000000) = 00000111
the result shows that the result of frameshift symbol inversion is 01111001, while the result calculated by using the method in the blog is 00000111
question: why are the two results different? How on earth should the frameshift be calculated?
the book only says that if the offset is 2n-1, the offset is equal to the complement symbol is reversed, but if the offset is not 2 ^ (nMul 1), then how to calculate the offset of the original code? Baidu"s results are not clear, but also ask the gods to give us some advice, thank you.