Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - minimips32 testing principle
minimips32 testing principle

minimips32 test principle: Because the immediate number of addi is a signed number, if the 16th bit of the original number is 1, it will become a negative number in addi, and the final result will be incorrect.

But if you want to use addi, you can also use it. Just add the 16th digit when taking the high 16th digit. If the 16th digit of the original number is 0, then it is fine to add it directly. For example, if you say 0x1025A152, it is wrong to use addi because A is 1010.

Operations with overflow will throw an exception when overflow occurs, that is, overflow exception; operations without overflow will not report when overflow occurs (HW does not report to SW). Overflow processing is arbitrary, as defined by the MIPS architecture .

Complement code is an important coding form in microcomputers:

a. After using complement code, subtraction operations can be easily converted into addition operations, and the operation process is simplified. . The complement of a positive number is the true value of the number it represents, but the numerical part of the complement of a negative number is not the true value of the number it represents. If the operation is performed using two's complement code, the result will still be one's complement code.

b. Different from the original code and the complement code, the value 0 has only one complement, that is, the complement = 00000000B.

c. If the word length is 8 bits, the range represented by the complement code is -128 ~ +127; when performing the complement code operation, it should be noted that the result should not exceed the number that the complement code can represent. scope.

?