Original code representation: as specified in the computer, the highest digit of a number represents positive and negative, 0 is positive, and 1 is negative. for example, 0111,1111 is converted to 127,1111 in decimal format, and 1111 is-127. Therefore, we know that the range of a byte is-127--127. Therefore, the expression of a positive and negative integer is clear, and the range of other bytes is similar.
Back-code representation: data in the computer is stored in the complement code. Only in this way can the CPU burden be reduced. when it comes to code complementing, You have to reverse code. this is the inverse code in the computer. If it is a positive number, it will remain unchanged in the original code form, for example, 127 is still 0111,1111; if it is a negative number, the first digit is 1, for example, the original code-127 (1111,1111) is represented.
The complement representation is the same as above. If it is a positive number, the original code format remains unchanged. For example, 127 is still 0111,1111. If it is a negative number, the first digit is 1. If it is a negative number, the other parts are reversed by 1, for example,-127, first, take the inverse value 1000,000, and then add 1 to 1. however, 128 and are special. It is used to represent-. Therefore, we know that the value range of the complement code is-128--127.
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