The original code, complement and complement are interrelated. For the same data element (remember it is not a number), the three should have the same number of digits, and the actual number of digits depends on the specific data type.
For example, byte data accounts for 8 bits, so its original code, complement and complement are all 8 bits.
Font data, accounting for 16 bits, then its original code, complement and complement are all 16 bits.
Without data type, it is meaningless to talk about original code, complement and complement.
2)? Based on the first question, for the number 999, its data type must be given to determine its original code, complement and complement. Byte data has only 8 bits, which can only represent 0~255, but it is definitely not. Font data accounts for 16, which can represent 0~65535, so you can choose a font data, so its three codes are as follows:
A, font number 999 original code (binary): 0000? 00 1 1? 1 1 10? 0 1 1 1
B, the complement of font number 999 (binary):111? 1 100? 000 1? 1000
C, font number 999 complement (binary): 65536? -? 999? =? 64537 (its complement is 64537) is translated into binary111? 1 100? 000 1? 100 1
All the above three can be verified by the calc calculator program that comes with windows.
3) Explain the meaning of supplementary angle here: you can compare the supplementary angle in primary school mathematics, and the supplementary angle of 45 degrees is 135 degrees. Why not 125 or 1 15? Because complementary angles have been defined in textbooks: angles equal to 180 degrees are complementary angles. This 180 degree is a standard, which is equivalent to the norm of a data type (the data range that a data type can represent):
For example, 8 digits can represent 0 to 255 * * * 256 (remember that it is not 255, because there are still zeros to count), then the modulus of 8 digits is 256. The same,? 16 digits can represent 0 ~ 65535 * * 65536 digits, so its modulus is 65536? .
For the complement of a number, it is bold to think that it is the part that finds the "lost" module of the number:
For example, if you seek the complement of 8-bit 1, you must add 255 to it to make 1 256, so the complement of 8-bit 1 is 255. . Similarly, the complement of 16 is needed, so in order to change 1 into 65536, it must be added with 65535, so the complement of 1 6 is 65535? .
For example, to find the two's complement of 8 digits, you have to give it 254 to make 1 become 256, so the two's complement of 8 digits is 254? . Similarly, the two's complement of 16 is needed, so to get 65536 from 1, you must add 65535 to it, so the two's complement of 16 is 65535? .
According to the above method, for 8 digits, you can easily find the complement of 2,3,4 to 127. It should be noted here that the complement of the 8-digit 128 is 128, and its binary is 1000? 0000, then according to the convention of the computer, the number with the highest bit of 1 represents a negative number, so this is why the 8-bit signed number can represent-128. ~? + 127.