What is two's complement, and how do I calculate it?

Two's complement is one way negative numbers can be represented in Binary. In Decimal notation, we use a + or - sign to indicate whether it is a postive or negative number respectivly. Two's complement is a little different. Normally, each digit in your binary number will represent (from right to left) 1, 2, 4, 8, 16... In two's complement, we make that left most digit represent the negative value instead - for example 1, 2, 4, 8, -16. We can still represent positive numbers in exactly the same way - 01100 is still 12 (8+4), 00010 is still 2. But we can also represent a negative number, using the -16. 10000 would therefore represent -16 (the smallest number we can write) and 10110 would represent -10 (-16 + 4 + 2). This gives us a nice way of calculating the "two's complement" of a given number - you invert all the digits and add 1 - inverting the digits of 01100 gives 10011 and adding 1 gives 10100, which is -12 (-16+4). We can also quickly check if a number is positive or negative by looking at the most significant (left most) bit - if it's a 0, the number is a positive number, if it's a 1 the number is negative.

TH
Answered by Tim H. Computing tutor

10136 Views

See similar Computing GCSE tutors

Related Computing GCSE answers

All answers ▸

What is the purpose of RAM in a computer?


i) Convert 01101001 from binary to denary. ii) Convert 27 from denary to hexadecimal. ii) State one use of hexadecimal in computing and why it is more beneficial in this application that binary.


How do I convert decimal to binary?


In terms of programming software, what is a translator? Describe the differences between the following three translators: assembler, compiler, interpreter.


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

MyTutor is part of the IXL family of brands:

© 2025 by IXL Learning