0
Complements
explain me the concept of 2's complement with signed values in C
5 Answers
+ 7
a positive binary number can be written like that :
0111 (for 7)
The last bit (here 0) is the signed bit.
The 2's complement is :
1's complement then add 1
1's complement of our number :
1000
1000 + 1 = 1001
So -7 is written 1001
+ 3
~7 is 1's complement
(~7) + 1 is 2's complement
0
how can we say -7 as 1001?? need more explanation
0
is ~7 and 2's complement of 7 same in binary or do we have any relation among it.