Two’s complement and negative numbers
Learn mathematics and working with numbers is the first skills we need to gather in our youngest steps, this skills brings us a huge universe of rules and magic, this magic continue surprising our little mind especially when we discover the “Binary world” and how this little two numbers 0 and 1 could be “Cain and Abel” of the computer and machine science. how could even handle a simple mathematics operations?
Binary representation of decimal number
First thing first we need to cover a binary representation of the denary number and like a normal concept for the decimal family number each digit represent the base (10 = the number of available digit in this family) powered by the digit position starting from 0. for example: 8*1 + 9*10 = 98.

working on binary number we have two available digit 0 and 1 and you may guess the base we have is 2. we need to write the number 98 like a sequence of addition starting from “2 power 0” that’s what we call it a Bit. for example the number of 98 is sum of three number 2 + 32 + 64:

this is the main concept behind the binary converting of the ordinary number, so for 8 bit (1 byte) we can represent at most 127 is the equivalent of the all the boxes filling with 1: 127=1+2+4+8+16+32+64 and this is obvious we are not filling the last box, it’s like the unreachable box for the positive numbers it’s reserved for the negative number if you forget about ;) it’s like the negative sign (-) for the binary. so if we filling the last left box we can get the opposite number of 127 which is (-127).
Two’s compliment
The conversion version you just seen it’s particularly useful because it lets you convert from decimal to binary or from binary to decimal it’s also tell us about the principal behind the representation of negative numbers in binary in terms of place value, there’s another way to arrive exactly to the same representation and this method it’s reserved for metallic mind like computer and machines.
So suppose we want to convert (-98) to 8-bit binary number, first we write the magnitude of (-98) which is the positive equivalent of the number in this case (+98):

Then we find a number which is the One’s compliment like his name says the compliment we need to add to (+98) to reach the (1) binary value, and here when 0 converted to 1and 1 becomes 0:

and now we need add 1 to this One’s compliment number to get the so-called Two’s compliment number, and there it is the (-98) presentation on binary

So let’s check out the Two’s compliment calculated by converted to decimal and we can see we arrived to the same representation of minus (-98) by adding this all value (-128) + 16 + 8 + 4 + 2 = (-98):

To summarize, when we need to convert a positive number to it’s equivalent din binary all we need to do is an addition operation between the base 2 exponent of the different digit place weight. but if you need to get the negative opposite of this number you need to revert the number ~(number), add 1 to it and you get the two’s compliment negative representation of the same number