Write −20 in 8-bit two's complement.
- +20 = 0001 0100.
- Invert: 1110 1011.
- Add 1: 1110 1100.
Answer 1110 1100
A-level Computer Science revision · Data representation
Negative integers can be stored with sign and magnitude (the left bit is the sign) or two's complement (the left bit has a negative place value, −128 in 8 bits). To negate in two's complement, flip all bits and add 1. Binary addition carries 1 when a column totals 2; an overflow occurs if the result needs more bits than available.
Watch out In 8-bit two's complement the range is −128 to +127, not −127 to +127.
Write −20 in 8-bit two's complement.
Answer 1110 1100
What denary value does the 8-bit two's complement number 1111 1010 represent?
Add the unsigned binary numbers 0101 1001 and 0011 0110, and give the result in denary.
What is the range of 8-bit two's complement integers?
A-level Computer Science Pro, OCR H446
£119 once
Price rises to £199 on 1 January. Save £80 by joining before then.
At least 12 months of access
No VAT is charged.