I am a senior high school graduate. I recently studied C language and encountered some difficulties. I hope you can give me some advice.
1. Why does binary computation have different effects if it is cited as a complement? Can the symbol bit impact be eliminated? How does it work?
2. Does the computer convert hexadecimal to binary and then hexadecimal?
3. 10 0 in C. 1 is the sum of values accurately equal to 1. Isn't it worse than the calculator?
4. Is oxfffl equal to oxffff? Why?
5. Do I need to know the original codes, the supplementary codes and the offset codes? To what extent can we learn?
The 1st questions are complicated. Here we will just give you a brief description:
The essence of the complement code is to move the origin of the number axis to half of the largest integer. Therefore, when it is all positive numbers, there is no negative number During computation.
Therefore, there is no problem with the symbol bit.
Its advantage is that addition and subtraction operations can be completed in one step.
2nd questions
A computer does not have a number concept. It only processes binary numbers.
Hexadecimal conversion is onlyProgramAAlgorithmIt can either adopt the method you mentioned or use other methods.
3rd questions
Binary 0.1 is not equal to decimal 0.1.
(Decimal) 0.1 = (Binary) 0. 11111 ...... = (decimal) 0.05 + 0.025 + 0.0125 + 0.00625 + ....! = (Decimal) 0.1
Therefore, computers cannot accurately express 0.1 (infinite precision) in mathematics. It can only ensure that its error (precision) is within a certain range.
In real life, accuracy is not infinite. There is a story that the British coastline cannot be measured, because if we use a smaller ruler to measure,
The result will become larger.
4th questions
0 xfffl (three F) is not equal to 0 xFFFF (four f ).
However, 0 xffffl = 0xffff. The reason is that computers have a habit of maintaining accuracy,
If the length (precision) of the two data is different, it will extend the smaller precision to the larger precision.
5th questions
At least, you must be able to calculate addition and subtraction, and calculate multiplication and division.
The data does not need to be larger than 32.
The number of decimal digits within 64 is converted to hexadecimal notation.
Note binary to hexadecimal conversion.