Magnitude5
00000101Convert a signed integer to its binary pattern and back. Inspect the sign bit, representable range and every invert-and-add-one step.
The value is non-negative: two's complement uses the ordinary binary representation, padded with leading zeros.
For a negative number: represent its magnitude using the selected width, invert every bit and add 1.
0000010111111010You can enter the bits directly. The pattern width must match the width selected above.
Because the most significant bit is 1, the number is negative. Apply two's complement again to recover its magnitude:
11111011Invert00000100+100000101Use the tool to check and experiment; the lesson provides explanations, guided exercises and a mastery check.