Wednesday, 7 September 2011

Multiplicative Inverses in Zn - the program

The logic for the multiplicative inverses program was discussed previously. Here is the logic converted into a program for the fx-50F:-

?→A:?→B:2→X:Lbl 0:B→C:While C<AX:C+B→C:WhileEnd:AX-C+B=1=>X▲X+1→X:X<B=>Goto 0:

This is pretty much how the program looks when keyed into the calculator in edit mode. Special Program Commands (? → => : Lbl While WhileEnd = < ▲ Goto) are input using the [SHIFT] [P-CMD] keys. The cursor key (marked Replay) is used to switch between various screens of commands. Memory variables A, B, C, and X are input using [ALPHA] [A], [B] etc keys. The ":" Separator Code command is used frequently and can be alternatively input using the [EXE] key.

This program is 57 steps in length.

No comments:

Post a Comment