Eight-bit binary number why is the range ( -128~~+127) understood

Source: Internet
Author: User

  • There are three methods for the representation of the signed number of the computer: the original code, the inverse code and the complement 8-bit original code and the inverse code can represent the number range is -127~127 8-bit complement can represent the number of the range is -128~ 127 so since the range is -128~127, it must be expressed in the complement. 10000000-11111111 means 128 to-1, 00000000-01111111 means 0-127 complement 1111 1111 is converted to the original code is 1000 0001, that is, 1. Complement is a method of binary representation of negative numbers
  • Introduced the concept of complement. The complement of negative numbers is to add one to the inverse code, and the positive number of the original code is the same. In the complement (-128) instead of (-0), so the complement of the expression range is: ( -128~0~127) a total of 256.
  • Note:(-128) does not correspond to the original code and the inverse code, (-128) = (10000000)
  • The so-called original code is the binary fixed-point notation, that is, the highest bit is the sign bit, "0" is positive, "1" is negative, the remaining bits represent the size of the value.
  • The inverse code notation stipulates that the inverse code of a positive number is the same as its original code, and the inverse of a negative number is a bitwise negation of its original code, except for the sign bit.
  • The complement notation stipulates that the complement of positive numbers is the same as the original code, and that the complement of negative numbers is added to the minus 1 of the inverse code.

Eight-bit binary number why is the range ( -128~~+127) understood

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.