

The relationship between the complement of negative numbers and the original code
Existing relationship: 1. The complement of a negative number is the inversion of all bits of the original code except the sign bit, and then the lowest bit is added by 1; 2. The complement of a positive number is the same as its original code; 3. Negative numbers The complement of can be obtained by using the positive original code 1.
There is the following relationship between the complement of a negative number and the original code:
- The complement of a negative number is the division sign of its original code Invert all other bits, then add 1 to the lowest bit.
- The complement of a positive number is the same as its original code.
- The complement of a negative number can be obtained by using the original code of a positive number 1.
For example, find the complement of -5: The positive number corresponding to
- -5 is 5.
- Invert 5 bitwise to get 0101.
- Add 1 to the end of 0101 to get 01011, which is the complement of -5.
Therefore, the relationship between the complement of a negative number and the original code is: the complement of a negative number is the inversion of all bits of the original code except the sign bit, and then adding 1 to the lowest bit.
The above is the detailed content of The relationship between the complement of negative numbers and the original code. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

