Hexadecimal addition, subtraction, multiplication and division
Hexadecimal addition and subtraction:
Hexadecimal addition and subtraction are actually very simple. Just remember that the letters in the hexadecimal system represent the decimal numbers. Remember A(10), B(11), C(12), D(13), E(14), F(15).
However, due to habitual thinking, we often make the mistake of misreading the decimal numbers represented by letters by one digit more, such as misreading A as 11 and B as 12. Therefore, we must remember that A is 10, not 11, and the same applies to the values represented by other letters.
Next, let's officially start talking about hexadecimal addition and subtraction. The algorithms for hexadecimal addition and subtraction are the same as those for decimal. You just need to remember a few key points. Take 6AE9H+4B7CH for example. The first digit is 9+C(12)=21. If the result is ≥16, then subtract 16 from the result and then carry the previous digit over, so the result is 5. E(14)+7=21, carry the previous digit over, so the result is 22. Subtract 16 to get 6, then carry the previous digit over, A(10)+B(11)=21, the previous digit is carried over, so the result is 22. Subtract 16 to get 6, then carry the previous digit over, 6+4=A(10), carry the previous digit over, so the result is B(11), so 6AE9H+4B7CH=A665H.
The same principle applies to subtraction of hexadecimal numbers, but note that when the number is not enough to subtract, the value borrowed from the previous number is not 10, but 16. For example, if 4-9 is not enough to subtract, the value borrowed from the previous number is not 14-9, but 20-9.