True-value source code anti-Code complement

Source: Internet
Author: User

True Value:
The true value of a positive or negative number is a positive or negative sign before the binary number corresponding to the absolute value.
For example, the true value of 2 is + 00000010.
-2 has a true value of-00000010.
(The positive number can be omitted)

 

Negative

Original code:
The original code of positive numbers is the corresponding binary number, for example, the original code of 2 is 00000010;
The original code of a negative number is the first digit of the binary number corresponding to its absolute value to 1, for example, the original code of-2 is 10000010
(The first digit of the original code indicates the symbol bit, 0 indicates positive, and 1 indicates negative)

Anti-code:
The reverse code of a positive number is the same as the original code;
A negative number is used to reverse the original code, except for the symbol bit.

Complement:
The positive complement is the same as the original code;
The complement of a negative number is to add 1 at the end of its anticode.

Code transfer:
The QR code is obtained after the signed bits of the complement code are obtained. It is introduced to facilitate the comparison of the size.

For example ):
2-2

True Value: 00000010-00000010
Original code 00000010 10000010
Reverse code 00000010 11111101
Makeup 00000010 11111110
Code transfer 10000010 01111110

0-0

True Value: 00000000-00000000
Original code 00000000 10000000
Reverse code 00000000 11111111
Makeup 00000000 00000000
Code transfer 10000000 10000000

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.