The expression of a negative number in the computer (the example is taken from coursera), and the negative value is coursera.
When I started the coursera test today, the class was not very clear at the beginning. I made a mistake at the time of the test and finally got a correct answer for the second time. Well, I posted the result first:
Here, a negative number is printed after the right shift of 2 digits. The negative number is expressed in the form of a supplementary code in the computer. Because + 12 is an integer data, it is expressed as 00000000 00000000 00000000 00001100 (original code)
-12 first, the original code of + 12 should be reversed: 11111111 11111111 11111111 11110011 (reverse code) and then the reverse code + 1 (0001)
11111111 11111111 11111111 11110100 at the same time, the binary bit is a symbol bit, so 0100 is changed to 1100
Finally, the binary number of-12 is 11111111, 11111111, 11111111, and 11111100.
Printed in hexadecimal notation is fffffffd.