The expression of a negative number in the computer (the example is taken from coursera), and the negative value is coursera.

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.