With the help of calculator or computer, the real number solution (accurate to 0.01) of the spherical equation 2 ^ X - X & sup2; = 0 in the interval (- 1,0) is solved by dichotomy

With the help of calculator or computer, the real number solution (accurate to 0.01) of the spherical equation 2 ^ X - X & sup2; = 0 in the interval (- 1,0) is solved by dichotomy


In general, for function f (x), if there is a real number C, when x = C, if f (c) = 0, then x = C is called the zeros of function f (x). To solve the equation, all zeros of F (x) are required. Suppose that f (x) is continuous in the interval (x, y), first find a and B belong to the interval (x, y), make f (a) and f (b) different sign, so that there must be zeros in the interval (a, b), and then find f [(a + b) / 2], now suppose that f (a) 0, a



-The complement of 1 is a fixed decimal. What does 8 digits mean


n=8
-1 original code 10000001 complement 11111111 inverse code 11111110
Complement of negative number = inverse of original code + 1
The first bit on the left indicates that 1 is a negative sign and 0 is a positive sign



If the fixed-point number of 8 bits (including 1 sign bit) is represented by complement, the complement of - 1 is represented by fixed-point decimal and fixed-point integer respectively__ And__


1.0000000 11111111



Find the complement of binary decimal (0.1011 and - 0
Why is the complement the same as the original?


1011 is a positive number, the complement is the same as the true value of the original code. It is still 0.1011
-0101 is a negative number and the complement is 1.1011
Negative complement: a simple way, the sign bit remains the same as 1, the numerical bit from the right number first 1 and its right 0 remains unchanged, the left bit is reversed
Another way is to negate the numerical bit by bit, add 1 to the last bit, and keep the sign bit unchanged
-----
Because the introduction of complement code is to solve the inconvenience of subtraction operation on the machine. The idea is to make the symbol bits participate in the operation, that is, adding a negative number represented by complement code is equivalent to subtracting the number. Adding a positive number is adding a positive number. There is no need to make any change, and its "complement code representation" naturally does not need to be changed~



What is the conversion from decimal 0.7625 to decimal 2? What is the fixed-point decimal of decimal 2 in the computer?
Thank you for the answer on the second floor, but it seems that the answer is not what you asked, which is a little far away


It's not quite right. I'll answer it again. The conversion from decimal 0.5 to decimal 2 should be 0.110. The conversion from decimal 0.25 to decimal 2 should be 0.01. The conversion from decimal 0.125 to decimal 2 should be 0.001 Therefore, 10 decimal 0.7625 into 2 decimal should be 0.1100001100110



About binary complement, can it be used to represent decimal
Can binary complement be used to represent decimal? And give me a binary complement. How can I restore it to decimal? Please give me an example


Can binary complement be used to represent decimal
Yes, but you need to deal with it yourself. The method is to enlarge the decimal several times according to the required precision and treat it as an integer
For convenience, it is usually magnified to the power of 2
In this way, you can regard the integer as a fixed-point decimal
In some data, this format is called Q format. For example, "Q8 format" is a fixed-point number with 8 decimal places
This kind of fixed-point decimal, do addition and subtraction method, need decimal point alignment, if necessary, need to do shift operation
In multiplication and division, we should also master the decimal point position. For example, the product of "Q8 format" and "Q4 format" should be regarded as the product of "Q12 format"
It should be noted that in the shift operation of C language, "right shift" can be divided into "arithmetic right shift" and "logical right shift". For "signed" numbers, "arithmetic right shift" is implemented, and for "unsigned" numbers, "logical right shift" is implemented
If you define the variable type correctly in your program, you will not make mistakes in these right shift operations
If there is a mixed use of "no sign" and "signed" in your program, or a forced type conversion, you need to pay attention to this and do not make mistakes
The difference between "arithmetic right shift" and "logic right shift"
When the logic moves to the right, the highest position will be filled with zero
When "arithmetic shift right", the highest position remains unchanged, that is: negative number makes up 1, positive number makes up zero
For example, use the format of Q4 to represent 0.75, enlarge 2 to the fourth power, and it is 12,
The machine code is one hundred million
It can be regarded as a fixed-point decimal of 0.1 billion
In addition, we use the format of Q4 to express -0.75, and enlarge it to the fourth power of 2, which is -12,
The machine code is 1110100
It can be regarded as fixed-point decimal 1110.0100
As above, according to Q4 format, 12 represents 0.75 and - 12 represents -0.75
To do (0.75) × (- 0.75), use (12) × (- 12) to multiply (- 144)
-The machine code of 144 is 1110000
Fixed point decimal 11111111.0111000 in Q8 format
It can represent -0.5625. (equal to - 144 / 256, i.e. - 9 / 16)
If you want to do other operations, you need to change the fixed-point decimal of Q8 to Q4 format. Then, you can use the operation of > > 4 to shift the number "arithmetically to the right" by 4 places, and get 111111.0111. (if you look at this number as an ordinary integer, it is - 9.)
Please note that there are four 1's in the highest position when moving right here
Give me a binary complement. How can I restore it to a decimal value
First of all, we should know the word length
If the 16 bit word length is an unsigned number, the decimal number can be expressed in the range of 0-65535;
If it is a signed number, the decimal number range that can be expressed is - 32768 - + 32767
Here 65536 is the 16th power of 2 and 32768 is the 15th power of 2
I think you should know about the binary decimal system of positive integers. For example, the decimal system of 10010000 is
((((((1×2+0)×2+0)×2+1)×2+0)×2+0)×2+0)×2+0 = 144
To give you a 16 bit binary code of signed number complement representation, temporarily change it into decimal system according to the above rules of unsigned number (that is, positive integer);
Then, check whether the sign bit (the highest binary bit) is 1:
If it's 0, it's a positive number. That's right
If it is 1, it means that it should be a negative number. Subtract 65536 from this temporary value, and the result (negative number) is what it should be
The above judgment of "see if the sign bit is 1" can also be replaced by "see if the temporary value is not less than 32768"
For example: 1110111 according to the above rules, the temporary value is 65527
Because the sign bit is 1, it should be negative: 65527 - 65536 = - 9



The principle of computer composition is that zero is represented by complement
[+ 0.0000] complement = 0.0000
[- 0.0000] complement = 2 + (- 0.0000) = 10.0000-0.0000 = 0.0000?
What's going on? 10.0000-0.0000 = 0.0000? I don't understand,


[+ 0.0000] complement = 0.0000
[- 0.0000] complement = 2 + (- 0.0000) = 10.0000 + 0.0000 = 0.0000mod2
Complement addition operation: [x] complement + [y] complement = [x + y] complement (mod 2) the characteristics of complement addition are as follows: first, the symbol bits should be taken part in the operation as part of the number; second, they should be added in the sense of module 2, that is, the carry over 2 should be discarded
You can refer to the book "digital logic"



The principle of computer composition, the definition of original code and complement code
Principles of computer composition Tang shuofei p221
When x = 0 [+ 0.0000] original = 0.0000
[- 0.0000] original = 1 - (0.0000) = 1.0000
It can be seen that [+ 0] primitive is not equal to [- 0] primitive
My question is
1. The definition of zero in the original code has two representations
Decimal hour
[x] Original = x, 1 > x > = 0 or 1-x, 0 > = x > 1
If we change the definition to [x] original = x, 1 > x > = 0 or 1-x, 0 > x > 1, there will be no two expressions?
2. Why use the definition of decimal original code for 0? There are two expressions for integer zero, or are integer zero and decimal zero the same thing?
Similarly, for complement (p223) and decimal, if x = - 1, there is [x] complement = 2 + x = 10.0000-1.0000 = 1.0000
It can be seen that - 1 does not belong to the decimal range, but there is a complement of [- 1]
If you don't understand the above description, - 1 is not a decimal, how can you use the definition of decimal complement to find the complement of x = - 1? Why do you add the definition of - 1 to the definition of decimal complement? That is, [x] complement = 2 + X, 0 > x > = - 1
Similar to the inverse of 0


Question 1: in the original code, there are two expressions of 0: 1 (sign bit) 000 and 0 (sign bit) 000. You may think that this is redundant, on the contrary, it is necessary. Therefore, the definition should emphasize [≥]



Is the complement of x minus the complement of y equal to the complement of x minus y


Not equal to



As long as x = + 1011 is in this form in the computer composition principle book, does it directly refer to the complement? That is, the complement of X is 0 1011


The original code and complement of a positive number are the same