Convert between two's complement binary and denary
Perform binary subtraction using two's complement addition
Perform arithmetic shifts left and right on binary numbers
Two's Complement
Representing Negative Numbers
In two's complement, the most significant bit (MSB) has a negative weight. For an 8-bit number: MSB = −128, then 64, 32, 16, 8, 4, 2, 1. This allows one encoding for zero and arithmetic using the same circuits as unsigned addition.
Method: Positive → Negative
To negate a number: 1. Invert all bits (one's complement) 2. Add 1
The MSB = 1 indicates a negative number. The MSB = 0 indicates non-negative.
Reading Two's Complement
Converting Two's Complement → Denary
If MSB = 0: read as normal unsigned binary (positive number). If MSB = 1: the number is negative. Use the negative MSB weight: −128+… or use the negate-and-convert trick.
Both methods give the same result. Method 1 is faster once you are comfortable; Method 2 avoids mistakes with the negative MSB weight.
Binary Subtraction
Subtraction Using Two's Complement
Computers perform subtraction as addition of the two's complement. To compute A − B: negate B (two's complement), then add A + (−B). Any carry out of the MSB is discarded.
Add: 0110 0100 + 1011 0111 = (1)0001 1011. Carry out of MSB discarded.
1
0001 1011 = 16+8+2+1 = 27. Correct: 100−73=27 ✓
Common Mistakes
Don't Lose Marks
!
Forgetting to add 1 when finding two's complement — invert all bits (one's complement) is NOT the same as two's complement. Always invert then add 1. Students frequently stop after inverting and lose marks.
!
Saying a right arithmetic shift fills with 0 — for a signed two's complement number, arithmetic right shift fills with the sign bit (1 for negative). This preserves the sign. Logical right shift fills with 0, but that changes negative numbers to positive.
!
Not discarding the carry out in two's complement subtraction — when the carry propagates out of the MSB in two's complement addition, it should be discarded. The remaining 8 bits are the correct signed result. Not discarding it gives a wrong answer.
1.4.1b Complete
Well done! ✓
Two's Complement, Binary Arithmetic and Hexadecimal