What are the original codes for the complementary codes 1.0000 and 10000 of the principle of computer composition? To explain in detail
1.0000 and 10000 would have been the original code.
8-bit word length pure decimal, the first bit for the sign bit, the decimal point in the first bit after the last seven bits for the specific value, such as: -0.1001 original code is expressed as 1.1001, the inverse of the code is 1.0110, the complement of the code is 1.0111; -1 of the complement of the code for the 1.0000000.
If the data x is of the form of x = x0.x1x2 …xn (where x0 is the sign bit, x1 to xn are the valid part of the value, also called the mantissa, and x1 is the highest valid bit), then it is represented in a computer in the form:
In general, if the last bit, xn=1, and all the previous bits are 0, then the number has the smallest absolute value, i.e. |x|min=2^(-n). If all the digits are 1, the absolute value of the number is the largest, i.e. |x|max=1-2^(-n). So fixed-point decimals are expressed in the range 2^(-n)≤|x|≤1-2^(-n).
Because of the limitation of “the total number of bits in the code is 8”, the truth value of -128 can not be expressed by the original code, inverse code, and it seems that we can not use the above rules to solve the complementary code, but in fact, it is feasible to use the above rules to solve the complementary code. As long as it does not care about the highest bit can be operated as follows:
The 128 will be binary: 10000000, the highest bit is 1, you can only round off the highest bit of the remaining 7-bit processing can be, first of all, take the inverse of: 11111111, plus 1 to: 10000000, the highest bit of the need to discard, that is, get: 0000000, plus the sign bit to get the complement: 10000000.
Another example, when the total number of bits of the code is 4, the true value of X = +0.101 of the original code, the inverse code, the complement are: 0101. the true value of X = -0.101 of the original code, the inverse code, the complement, in turn, 1101, 1010, 1011. Similarly, the special case, the complement of the -1 is: 1000. In fixed-point decimals, the decimal point is implied between the first and second encoding.
By this rule, any decimal can be written as N=NS.N-1 N-2 …N-M. If the above decimal is represented in a computer with m+1 binary digits, the highest (leftmost) binary digit can be used to represent the sign (e.g., if 0 is used to represent a positive sign, then 1 would represent a negative sign), and the m binary digits following it can be used to represent the decimal’s value.
The decimal point does not need to be explicitly represented, as it is always fixed between the sign bit and the highest value bit, which is a given. Fixed-point decimal value range is very small, for the use of m + 1 binary digits, the value of the range:
|N|≤1-2^(-m) that is, less than 1 of the pure decimal, which is very inconvenient for the user to calculate the problem, because in the calculation of the problem, you must use the number of the number, through the appropriate “proportionality factor” into a decimal with an absolute value of less than 1, and to ensure that the middle of the operation and the final result is also less than 1, and to ensure that the absolute value of the operation is less than 1. The absolute value of the intermediate and final results are also less than 1, in the output of the real results, but also the results of the calculations according to the appropriate proportion to be expanded.
How should I find the complement of x=-0.1001 and y=-0.1101 in the principle of computer composition, and ask for details to find the complement of
Assuming that the word length is 5 digits long, and the number of points is decimal:
[x]original=1.1001b,the highest bit 1 is the sign bit which means negative number
[x]inverse=1.0110b,invert the rest of the original code except the sign bit to get the inverse code
[x]complement=1.0111b add 1 at the end of the inverse code to get the complement code
What is the original,complement and inverse of binary -0.1000?
Let the word length be 5 bits: