When I do hexadecimal subtraction say, 2A-324 on a casio calculator or any calculator in general, i get the result as FFFFFD06

Why do i get so many F's ?? dosnt F stand for 15 in hex. In any general arithmetic, how many digits should i consider for the final answer, say in a subtraction operation in which the bigger number is negetive (324 in my example).

Is my answer only D06?

  • $\begingroup$ Measure theory and number theory are not appropriate tags for this question. $\endgroup$ – Spencer Jan 29 '16 at 12:17
  • $\begingroup$ As you say, F stands for fifteen in hexadecimal. However negative integers in binary form will have leading ones, and for a smallish negative integers this results in a string of F's when converted to hexadecimal. $\endgroup$ – hardmath Jan 29 '16 at 12:27

You get this result because the calculator uses only 32 bit arithmetic in this case, i.e. it actually computes $\mod 2^{32}.$ $$2A_{16}-324_{16}= -2FA_{16}$$ $$2A_{16}-324_{16}+ 2^{32}= FFFFFD06_{16}$$

  • $\begingroup$ what do you mean? pls can you tell without mod use? pls i have a test tommorow!! So whats the result do we have to just take the maximum number of digits in the operands? like 324 has the maximum number of digits, so we take the last three digits? $\endgroup$ – Shubham Chawla Jan 29 '16 at 12:20
  • $\begingroup$ You cannot omit the mod, that's the way calculators compute. You may say that you use only 32 bit registers and forget the bits from overflow, but that is only another way to express the mod operation. $\endgroup$ – gammatester Jan 29 '16 at 12:22
  • $\begingroup$ so we only take the same number of digits from the end of answer as the maximum digits in the operand? $\endgroup$ – Shubham Chawla Jan 29 '16 at 12:25
  • $\begingroup$ No! Since 324 is greater than 2A the difference 2A-324 is negative and the leading FFFFF are showing this fact and cannot be omitted, see e.g. en.wikipedia.org/wiki/Hexadecimal#Signs $\endgroup$ – gammatester Jan 29 '16 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.