Why the range of 8-bit binary numbers is -128~127

Source: Internet
Author: User

1. There are three ways to represent a signed number in a computer: original code, inverse code, and complement
8-bit source code and inverse code can be expressed in the range of -127~127
8-bit complement can represent the range of numbers 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

The complement of 1111 1111 is converted into the original code is 1000 0001, that is-1.

In the complement (-128) instead of (-0), so the complement of the expression range is:

Note: (-128) there is no corresponding source code and anti-code, (-128) = (10000000), 10000000 is reversed plus 1 is-128.

2. The data in the computer is usually stored in the complement, because the CPU can only do the addition operation.

Why the range of 8-bit binary numbers is -128~127

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.