Why is the eight-bit binary number in the range (-128 ~~ + 127) Understanding,-128127

Source: Internet
Author: User

Why is the eight-bit binary number in the range (-128 ~~ + 127) Understanding,-128127

  • There are three methods for a computer to express the number of symbols: the original code, the reverse code, and the complement code.
  • 8-digitOriginal and reverse codeThe value range is-127 ~ 127.
  • 8-digitComplementThe value range is-128 ~ 127.
  • The value range is-128 ~ 127, it must be indicated by a supplementary code. 2017000-11111111 indicates-128 to-1, and 2017-12-01111111 indicates that the 127 1111 of the 0-1111 complement code is converted to the 1000 0001, that is,-1. The complement code is a binary method that represents a negative number.
  • The concept of complement code is introduced: the complement code of a negative number is to add one to the anticode, while the positive number remains unchanged, and the source code of a positive number is the same. (-0) is replaced by (-128) in the complement code, so the range of the complement code is: (-128 ~ 0 ~ 127) a total of 256.
  • Note:(-128) there is no corresponding source code and reverse Code, (-128) = (10000000 ).
  • The so-called original code is the Binary Fixed-point representation, that is, the highest bit is the symbol bit, "0" indicates positive, "1" indicates negative, and the remaining bit indicates the value size.
  • Anti-code Notation:A positive number is the same as its original code. A negative number is used to reverse the original code by bit, except for the symbol bit.
  • Supplementary Code Notation:The positive complement is the same as the original one. The negative complement is added with 1 at the end of the reverse code.

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.