−45 in 8-bit two's complement
introinvert and add one
Answer
11010011
Why this example is worth doing
The standard procedure: write the magnitude in binary, invert every bit, add one. The page shows all three stages rather than the answer, because the marks are for the stages, and it verifies the result by adding it back to +45 to get zero with the carry discarded. That check is worth teaching as a habit — it catches an off-by-one in the increment step immediately.
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
-45 in 8-bit two's complement
Encode -45 in 8-bit two's complement. Representable range: -128 to 127.
|-45| in binary00101101
invert every bit11010010
add 111010011— invert-and-add-one is the negation rule
8-bit pattern1101 00110xD3
check11010011 reads 211 unsigned and -45 signed