1011 0101 read as a signed 8-bit value — two's complement
introthe leading 1 means negative
Answer
-75
Why this example is worth doing
Decoding rather than encoding. The top bit is 1 so the value is negative, and the magnitude comes from inverting and adding one — the same operation, which is its own inverse. The page also gives the direct method of treating the top bit as having weight −128 and summing normally, since that route generalises better and makes the next example obvious.
Try your own input in the Two’s complement. Encode and decode signed binary at any width, with overflow and sign extension.
How the answer is reached
Decode 10110101 as 8-bit two's complement
bit string1011 01010xB5
unsigned reading181— straight positional value of the bits
sign bit1— set, so the value is negative
181 - 2^8-75