Current location - Education and Training Encyclopedia - University ranking - University computer problem solving
University computer problem solving
Sorry, the correct answer is as follows.

First of all, it should be understood that when calculating the addition of negative numbers, the computer first converts them into binary.

Perform further operation on the transformed number to get the result.

A few nouns:

Source code: a series of numbers obtained by converting numbers into binary.

Inverse code: a series of numbers obtained by reversing the original code.

Complement: A series of numbers obtained by adding 1 to the complement.

The calculation process of this problem;

-50

Original code:10110010

Inverse code:1100110/.

Supplement:1100110

- 100

Original code:11100100.

Inverse code:1001101.

Complement:10011100

Supplementary result: 01101010.

Complement of the result: 01101010.

Results The original code: 011010.

The result is converted to decimal: 106.

Obviously, the result is incorrect. The correct result is-150.

Cause of error: The eight-bit binary number represents the decimal number, and the first bit represents the number symbol.

Then, the smallest negative number that a computer can represent in this problem is111111,that is-127.

The correct result in the question should be-150, which means the computer won't.

Express it (academic words become overflow).

Ps: Now computers can calculate the results correctly.