Did I convert this correctly

I am trying to convert 0xffffffe0 to binary using 2 com. I come up with 83. But that does not seem right. E0 = 11100000. what did I do wrong?
Start with the bits:
11111111111111111111111111100000
Flip the bits:
00000000000000000000000000011111
Add one:
00000000000000000000000000100000
What do you get?
32
So it's
-32

More naturally, just think of it as an odometer going backwards. It would have to go back 32 to get from 0x0000 to 0xffe0, two turns of the second wheel worth 16 each.
Wait. Are you trying to convert the hex representation to raw binary, or to signed representation in binary? In other words, would the expected result be 11111111111111111111111111100000, or -100000?
Topic archived. No new replies allowed.