HP Forums
(48G) 48G, 49G & 50G: Multiplicative Inverse of a Hex String Modulo 2^(Wordsize) - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (48G) 48G, 49G & 50G: Multiplicative Inverse of a Hex String Modulo 2^(Wordsize) (/thread-4386.html)



(48G) 48G, 49G & 50G: Multiplicative Inverse of a Hex String Modulo 2^(Wordsize) - Gerald H - 07-20-2015 10:17 AM

As expected, even inputs return zero.

Code:

::
  CK1&Dispatch
  BINT11
  ::
    HXS 00001 1
    WORDSIZE
    ONE_DO
    OVER
    bit*
    SWAPDUP
    bit*
    SWAPLOOP
    SWAPDROP
  ;
;



RE: HP 48G, 49G & 50G: Multiplicative Inverse of a Hex String Modulo 2^(Wordsize) - Gerald H - 07-22-2015 05:05 AM

Carmichael

https://en.wikipedia.org/wiki/Carmichael_function

says we can simplify the algorithm to:

Code:

::
  CK1&Dispatch
  BINT11
  ::
    HXS 00001 1
    WORDSIZE
    #1-
    ONE_DO
    OVER
    bit*
    SWAPDUP
    bit*
    SWAPLOOP
    SWAPDROP
  ;
;