Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What is the boundary number of complement?
What is the boundary number of complement?
The number of boundaries of complement means that it can only represent 127 and-128 at most.

Given the complement of a number, the operation of finding the original code is actually to find the complement again:

1. If the sign bit of the complement is "0", it means that it is a positive number, and its original code is the complement.

2. If the sign bit of complement is "1", which means negative number, then finding the given complement is the required original code.

Example: If a complement is known as1111,the original code is 1000 1 1 (-7).

Because the sign bit is "1", that is to say, it is a negative number, so this bit remains unchanged and is still "1".

Other seven digits1111001are 000010; Add 1, so it is1000011.

Extended data:

There are three representations of signed numbers in computers, namely, original code, complement and complement. These three representations have two parts: sign bit and digital bit. The sign bit is "positive" of 0 and "negative" of 1, while the digital bit has different representations.

In computer systems, numerical values are always represented and stored by complement. The reason is that with the complement, the sign bit and numerical field can be handled uniformly; At the same time, addition and subtraction can also be handled in a unified way.

The complement of a positive integer is its binary representation, just like the original code. Example: The complement of +9 is 0000 100 1.

Note: This +9' s complement is represented by 8-bit binary, and there are many representations, including 16' s complement, 32' s complement and 64' s complement. Each complement representation can only represent a finite number.

Find the complement of a negative integer, invert all the bits of its original code except the sign bit (0 changes 1, 1 changes to 0, and the sign bit remains 1 unchanged) and then add 1.

The same number is different in different complement representations. For example, the complement of-15 is1110001in the 8-bit binary representation, but it is11655 in the 6-bit binary representation. All the following are expressed in 8-bit binary.