HP Forums
Getting Binary Division Remainder - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Getting Binary Division Remainder (/thread-17804.html)



Getting Binary Division Remainder - Arcane178 - 12-08-2021 10:10 PM

Hi everyone,

I'm trying to figure out how to get the remainder when doing binary division on the HP Prime, but I'm not having much luck. There is a picture of what I am trying to do and also here is a link that does the calculation correctly: http://www.ee.unb.ca/cgi-bin/tervo/calc.pl?num=10101010100000&den=10011&f=d&e=1&m=1 (which has another example).

When dividing it you are XOR'ing the values together and you are left with the remainder in binary. I tried converting the numbers in decimal then to binary but it's giving me the wrong answer along with MOD'ing.

Any help would be appreciated.


RE: Getting Binary Division Remainder - Claudio L. - 12-09-2021 02:16 PM

(12-08-2021 10:10 PM)Arcane178 Wrote:  Hi everyone,

I'm trying to figure out how to get the remainder when doing binary division on the HP Prime, but I'm not having much luck. There is a picture of what I am trying to do and also here is a link that does the calculation correctly: http://www.ee.unb.ca/cgi-bin/tervo/calc.pl?num=10101010100000&den=10011&f=d&e=1&m=1 (which has another example).

When dividing it you are XOR'ing the values together and you are left with the remainder in binary. I tried converting the numbers in decimal then to binary but it's giving me the wrong answer along with MOD'ing.

Any help would be appreciated.

The link you provided uses a binary Galois Field GF(2), but that's not the same as regular numbers that the HP Prime uses. The addition in this field is defined as XOR, the HP Prime is using numbers where addition is defined as regular addition.
So you can't expect the division in that field to be the same as regular division.