How do binary numbers complement (positive and negative)?

How do binary numbers complement (positive and negative)?


All the same
Negative: except sign bit, you take negative and add one



Binary negative complement to decimal
Does it make sense?
For example, the original code of - 59 is 1011 1011
The complement is 1100 0101. Isn't that decimal-69? What's the point


This is represented by an eight bit complement, the highest bit being the sign bit, 0 being a positive number and 1 being a negative number
-59 is negative, so the highest order is 1
59D=111011B
So - 59D = 1011, 1011
Inverse code is to negate except sign bit
So the inverse code is 1100 0100
The complement is the inverse plus one
So the reverse code is 1100 0101
If the complement is known and the original code is obtained, we only need to find the complement again to get the original code
For example, the complement is known
1100 0101
First, the highest order is 1, so it is negative
The reverse code is 1011 1010
The original code is: 1011 1011 = - 59
When expressed by complement code, the binary subtraction operation is changed into addition operation, which is convenient for computer to process data
For example, 8-5 is represented by complement
1000(8)
+ 1011(-5)
0011=3D



The signed binary number 10000000 is used as the complement to find the original code
What is the result of subtracting 10000000 from 10000000? Because the highest bit is sign bit 1, can you participate in the subtraction operation? Is the result 01111111 (positive number) and then negating 10000000? Doesn't this mean - 0? How can - 128 be represented by signed source code? + 128?


10000000-00000001 = 10000000 + 11111111 = 01111111, the result is 01111111, and there is carry, which means there is overflow, the highest is that it must participate in the operation, because the machine does not know whether the original code or the complement code, which is the method of converting subtraction into addition



Ask the math question as follows: go through point a (3, - 1) to make a straight line L, intersect X axis at point B, intersect straight line L1; y = 2x at point C, BC vector = 2Ab vector, find the equation of straight line L
There should be standard steps to solve problems. Thank you


Let L: y = ax + B, then B (- B / A, 0), simultaneous L, L1 equations can obtain C (B / a (2-A), 2b / (2-A)), then BC vector = (2B / a (2-A), 2b / (2-A)), AB vector = (- B / a-3,1) from BC = 2Ab, then a + B = 2 -------- - (1) bring a (3, - 1) into L equation, then 3A + B = - 1 --------