Class polarDust.calculator.Processor01
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class polarDust.calculator.Processor01

java.lang.Object
   |
   +----polarDust.calculator.Processor01

public class Processor01
extends Object
implements CalcCPU, CalcConstants
This class is an equivalent of a microprocessor in a calculator (minus the display logic). It executes commands and is capable of sending messages to a display unit (panel). Logic organization:
2 number registers (double): R1, R2, 1 memory register (double): RM. This class can be further broken down into:
a Command Control Unit (CCU),
an Arithmetic and Logic Unit (ALU) and
Registers

The source code.
Version:
0.9, 1996.06.04
Author:
Sorin Lazareanu

Constructor Index

 o Processor01(CalcDisplay)
Creates a new Processor01 object.

Method Index

 o acos()
R1 = arccos(R1)
 o add()
R1 = R1 + R2
 o asin()
R1 = arcsin(R1)
 o atan()
R1 = arctan(R1)
 o binary(int)
 o c()
Clear all registers.
 o ce()
Clear entry (R1 = 0).
 o cos()
R1 = cos(R1)
 o digit(int)
Performs the calculations for a digit input.
 o div()
R1 = R2 / R1
 o dot()
Inputs a decimal point.
 o e()
R1 = 2.71828...
 o equ()
Enter or result (=sign ).
 o exp()
R1 = e^R1
 o inv()
R1 = 1 / R1
 o ln()
R1 = ln(R1)
 o log()
R1 = log(R1)
 o madd()
Add to memory.
 o mc()
Memory register (RM) clear.
 o mr()
Memory read.
 o msub()
Substract from memory.
 o mul()
R1 = R1 * R2
 o opRegAssign(int)
 o pi()
R1 = 3.14156...
 o pow()
R1 = R2 ^ R1
 o prc()
Percent operator.
 o reg1Assign(double)
 o reg1AssignWithDecimals(double, int)
 o reg1Show(double)
 o reg1ShowWithDecimals(double, int)
 o regMAssign(double)
 o result(int)
 o sgn()
Toggles the sign of the current number (R1 = -R1).
 o sin()
R1 = sin(R1)
 o sqr()
R1 = R1 * R1
 o sqrt()
R1 = square_root(R1)
 o sub()
R1 = R2 - R1
 o swap()
Swap registers (R1 with R2).
 o tan()
R1 = tan(R1)
 o unary(int)

Constructors

 o Processor01
  public Processor01(CalcDisplay aDisplay)
Creates a new Processor01 object. Uses a display.
See Also:
CalcDisplay

Methods

 o digit
  public void digit(int iDigit)
Performs the calculations for a digit input.
Parameters:
iDigit - 0...9
 o dot
  public void dot()
Inputs a decimal point.
 o sgn
  public void sgn()
Toggles the sign of the current number (R1 = -R1).
 o c
  public void c()
Clear all registers.
 o mc
  public void mc()
Memory register (RM) clear.
 o equ
  public void equ()
Enter or result (=sign ).
 o prc
  public void prc()
Percent operator.

For more information see the source code method result.
 o ce
  public void ce()
Clear entry (R1 = 0).
 o mr
  public void mr()
Memory read.
 o madd
  public void madd()
Add to memory.
 o msub
  public void msub()
Substract from memory.
 o swap
  public void swap()
Swap registers (R1 with R2).
 o inv
  public void inv()
R1 = 1 / R1
 o pi
  public void pi()
R1 = 3.14156...
 o e
  public void e()
R1 = 2.71828...
 o ln
  public void ln()
R1 = ln(R1)
 o log
  public void log()
R1 = log(R1)
 o exp
  public void exp()
R1 = e^R1
 o sqrt
  public void sqrt()
R1 = square_root(R1)
 o sqr
  public void sqr()
R1 = R1 * R1
 o sin
  public void sin()
R1 = sin(R1)
 o asin
  public void asin()
R1 = arcsin(R1)
 o cos
  public void cos()
R1 = cos(R1)
 o acos
  public void acos()
R1 = arccos(R1)
 o tan
  public void tan()
R1 = tan(R1)
 o atan
  public void atan()
R1 = arctan(R1)
 o add
  public void add()
R1 = R1 + R2
 o sub
  public void sub()
R1 = R2 - R1
 o mul
  public void mul()
R1 = R1 * R2
 o div
  public void div()
R1 = R2 / R1
 o pow
  public void pow()
R1 = R2 ^ R1
 o unary
  protected void unary(int iCurrentOp)
 o binary
  protected void binary(int iNextOp)
 o result
  protected void result(int iNextOp)
 o regMAssign
  protected void regMAssign(double dArg)
 o reg1ShowWithDecimals
  protected void reg1ShowWithDecimals(double dArg,
                                      int iDecimals)
 o reg1AssignWithDecimals
  protected void reg1AssignWithDecimals(double dArg,
                                        int iDecimals)
 o reg1Show
  protected void reg1Show(double dArg)
 o reg1Assign
  protected void reg1Assign(double dArg)
 o opRegAssign
  protected void opRegAssign(int iOperator)

All Packages  Class Hierarchy  This Package  Previous  Next  Index