Original code anti-code complement

Source: Internet
Author: User

1 the original code 0000 0001-1 of the original Code 1000 0001 (the first 1 is the sign bit) the two added 1000 0010 is not equal to 0 so there is the complement, with the complement can be directly calculated

Anti-code Definition1. Positive inverse code is the same as the original code2. Negative number of the anti-code, the sign bit for "1" to remain unchanged, the value of the partial negation. Ex:1 'sAnti-Code0000 0001-1 ofAnti-Code 1111 1110
Complement definition1. The complement of positive numbers is the same as the original code2. The complement of negative number is anti-code +1EX:1 's complement 0000 0001-1 's complement 1111 1111

Comprehensive: a>0,a Anti-code meter for the fa,-a of the anti-code meter for the-fa;a complement of the ba,-a as a complement to the-baThen there is fa+ (-FA) = 0xFF (1111 1111)so if the complement of negative numbers is anti-code +1Then there is ba+ (-ba) = fa+ (-fa + 1) = 0xFF +1 = 0x00so the values represented by the complement can be calculated directly

Original code anti-code complement

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.