DEC2BIN 1.0 Copyright (C) 1996 H kon Stordahl E-mail : stordahl@usa.net Homepage: http://stordahl.home.ml.org/ Date : 14.11.96 Model : CASIO CFX-9850G Calculator Notes -------------------------------------------------------------------------------- This program will convert a decimal integer (whole number) to a binary number. A function that converts decimals to binaries does allredy exist on the calculator (in RUN mode, press [SHIFT] [MENU] and change the Mode setting to appropriate value). However, this function can only handle small numbers. This program can convert larger numbers, only limited by screen size and the range of the numbers used in the calculator. Symbol: Description: Key(s): -------------------------------------------------------------------------------- -> Assginment operator Above [AC/ON] * Multiplication Below [DEL] / Division Below [AC/ON] (-) Unary minus Below [+] = Equal to [SHIFT] [.] <> Not equal to [SHIFT] [VARS] [F6] [F3] [F2] >= Greater than or equal to [SHIFT] [VARS] [F6] [F3] [F5] <= Less than or equal to [SHIFT] [VARS] [F6] [F3] [F6] => If-Then [SHIFT] [VARS] [F3] [F3] \sqrt Square root [SHIFT] [X^2] \slash / (slash) [F6] [F5] \{i} \sqrt(-1) [OPTN] [F3] [F1] Frac Returns fractional part of argument [OPTN] [F6] [F4] [F3] ClrText Clear the text screen [SHIFT] [VARS] [F6] [F1] [F1] Getkey Determine keypress [SHIFT] [VARS] [F6] [F4] [F2] Locate Display variable at the given coords [SHIFT] [VARS] [F6] [F4] [F1] { Left brace [SHIFT] [*] } Right brace [SHIFT] [/] [ Left bracket [SHIFT] [+] ] Right bracket [SHIFT] [-] List List-variable [OPTN] [F1] [F1] Sum The sum of all entries in the list [OPTN] [F1] [F6] [F6] [F1] And Logical And operator [OPTN] [F6] [F6] [F4] [F1] Or Logical Or operator [OPTN] [F6] [F6] [F4] [F2] Not Logical Not operator [OPTN] [F6] [F6] [F4] [F3] File name: DEC2BIN Variables: D, I, J, X, Y -------------------------------------------------------------------------------- \ClrText "ENTER NUMBER: "?\->D \Locate 1,3,"BINARY: " \If D=0 \Then \Locate 9,3,0 \Else 0\->I 8\->X 3\->Y \While 2^(I+1)\<=D I+1\->I \WhileEnd \For 0\->J \To I \If X=21 \Then 0\->X Y+1\->Y \IfEnd X+1\->X \If \Int (D/2^(I-J))=1 \Then \Locate X,Y,1 \Else \Locate X,Y,0 \IfEnd \Frac (D/2^(I-J))*(2^(I-J))\->D \Next \IfEnd \Locate X,Y,"" --------------------------------------------------------------------------------