JP4193773B2 - Arithmetic control device and program - Google Patents
Arithmetic control device and program Download PDFInfo
- Publication number
- JP4193773B2 JP4193773B2 JP2004250678A JP2004250678A JP4193773B2 JP 4193773 B2 JP4193773 B2 JP 4193773B2 JP 2004250678 A JP2004250678 A JP 2004250678A JP 2004250678 A JP2004250678 A JP 2004250678A JP 4193773 B2 JP4193773 B2 JP 4193773B2
- Authority
- JP
- Japan
- Prior art keywords
- calculation
- digits
- digit
- display
- input
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Calculators And Similar Devices (AREA)
Description
本発明は、演算制御装置及びプログラムに関する。 The present invention relates to an arithmetic control device and a program.
従来より、種々の演算制御装置が存在し、四則演算・累積計算等の演算を高速に実行できるものも知られている。特に、複雑な浮動小数点演算を行わせる必要がある場合に、ユーザーはこの演算制御装置に演算を行わせることが多々ある。浮動小数点演算を行う場合の最も一般的な演算規格としては、ANSI/IEEE754−1958標準(「IEEE754」)がよく知られており、単精度(32ビット)、倍精度(64ビット)、拡張倍精度(96ビット)の3種類で浮動小数点演算を行わせることが可能である。 2. Description of the Related Art Conventionally, there are various arithmetic control devices, and those that can execute arithmetic operations such as four arithmetic operations and cumulative calculations at high speed are also known. In particular, when it is necessary to perform complicated floating-point arithmetic, the user often causes the arithmetic control device to perform arithmetic. The ANSI / IEEE 754-1958 standard (“IEEE 754”) is well known as the most common arithmetic standard for performing floating point arithmetic, and is single precision (32 bits), double precision (64 bits), and extended double. It is possible to perform floating point arithmetic with three types of precision (96 bits).
しかし、これらの精度を用いて浮動小数点演算を行わせる場合に、値の近い数値間での減算等においては、演算桁数の制約により有効桁数が極端に少なくなる所謂「桁落ち」が発生するという問題が生じる。この「桁落ち」を説明するために、減算「1.001233−1」を有効桁数8桁で行わせる場合を考える。 However, when floating-point arithmetic is performed using these precisions, so-called “digit loss” occurs, in which the number of significant digits is extremely reduced due to restrictions on the number of arithmetic digits in subtraction between numerical values that are close to each other. Problem arises. In order to explain this “digit loss”, a case where subtraction “1.00123 3 −1” is performed with 8 significant digits is considered.
先ず「1.001233」は、有効桁数8桁では「1.0036945」と求められる。よって、この値を用いると、演算結果は「1.0036945−1=0.0036945」となり、有効桁数が8桁から5桁に減少する。つまり、この例では3桁の桁落ちが発生したことになる。
First "1.00123 3" is determined as "1.0036945" a
通常、演算制御装置においては、減算等で演算結果の最上位桁の値が「0」となった場合に、ビットのシフトを行うことでこれを「0」以外の値にする正規化処理を行うことが一般的であり、上記の例においては演算結果を「3.6945000 e−3」として表現する場合が多い。このため、従来の演算システムでは、この正規化処理のために演算処理が遅延してしまうという問題があった。 Usually, in the arithmetic and control unit, when the value of the most significant digit of the operation result becomes “0” by subtraction or the like, a normalization process is performed to shift this to a value other than “0” by performing bit shift. This is generally performed, and in the above examples, the calculation result is often expressed as “3.66945000 e-3”. For this reason, the conventional arithmetic system has a problem that the arithmetic processing is delayed due to the normalization processing.
そこで、減算等の演算を実行する前に桁落ちを予測することにより、遅延無く正規化処理を行い、演算処理を高速化する演算制御装置がいろいろと考案されている(例えば、特許文献1。)。
しかし、特許文献1の演算制御装置は、桁落ちを予め予測することで遅延無く正規化処理を行い演算処理を高速化しているが、演算により求められた演算結果の正確な桁落ち桁数を検出するものではないため、誤った桁落ち予測が行われる場合もあり得る。また、桁落ちを予測した場合に、その桁落ちの発生を予測したことを知らしめる手段を具備していないために、ユーザーは求められた演算結果が、桁落ちが発生すると予測されて演算された結果なのかどうかを知ることができなかった。また、そもそも桁落ちを予測するものであるため、正確な桁落ち桁数や正確な有効桁数を知らせることはできなかった。
However, the arithmetic and control apparatus of
本発明はこのような課題に鑑みて為されたものであり、その目的とするところは、入力された演算桁数で演算を行い、求められた演算結果の正確な桁落ち桁数を検出し、その桁落ちを知らしめる演算制御装置を実現することである。 The present invention has been made in view of such a problem, and the object of the present invention is to perform an operation with the number of input arithmetic digits and detect the exact number of digits that are lost in the calculated operation result. It is to realize an arithmetic and control unit that informs of the digit loss.
本発明に係る演算制御装置は、演算桁数をユーザー操作に従って入力する演算桁数入力手段と、演算の種類をユーザー操作に従って指定する演算種類指定手段と、この演算種類指定手段により指定された種類の演算を、前記演算桁数入力手段により入力された演算桁数で実行する演算実行手段と、前記演算桁数入力手段により入力された演算桁数に所定の追加桁数を追加した追加演算桁数で演算を再実行する追加演算実行手段と、この追加演算実行手段による演算結果の各桁の値と前記演算実行手段による演算結果の各桁の値とを比較し、値が一致しない桁の数を桁落ち桁数として検出する桁落ち桁数検出手段と、前記桁落ち桁数検出手段により検出された桁落ち桁数と前記演算桁数入力手段により入力された演算桁数との和が、前記追加演算実行手段により演算された追加演算桁数以下である場合に、前記追加演算実行手段による演算結果を、前記演算桁数に丸めて表示する制御を行う表示制御手段と、を備えることを特徴とする。 The arithmetic control device according to the present invention includes an arithmetic digit input means for inputting an arithmetic digit number according to a user operation, an arithmetic type specifying means for specifying an arithmetic type according to the user operation, and a type specified by the arithmetic type specifying means. The calculation execution means for executing the above calculation with the calculation digit number input by the calculation digit number input means, and the additional calculation digit obtained by adding a predetermined additional digit number to the calculation digit number input by the calculation digit number input means Comparing the value of each digit of the calculation result by the additional calculation execution means with the value of each digit of the calculation result by the calculation execution means, A digit number detection unit that detects a number as a digit loss digit, and the sum of the number of digits that are detected by the digit detection unit and the number of digits that are input by the operation digit number input unit The additional performance If execution unit or less additional computation digits calculated by the calculation result by the additional execution unit, characterized in that it comprises a display control means for performing control to display rounded to the number of operation digits .
請求項1記載の発明によれば、検出した桁落ち桁数と入力された演算桁数との和が、当該演算桁数に所定の追加桁数を追加した追加演算桁数以下である場合に、当該追加演算桁数で演算を実行して求めた演算結果を、当該演算桁数に丸めて表示することができる。 According to the first aspect of the present invention, when the sum of the detected digit number of digits and the input calculation digit number is equal to or less than the additional calculation digit number obtained by adding a predetermined additional digit number to the calculation digit number. The calculation result obtained by executing the calculation with the additional calculation digits can be displayed rounded to the calculation digits.
以下、図1〜図13を参照して、演算制御装置の一つであるグラフ関数電卓に本発明を適用した場合の2つの実施形態について詳細に説明する。 Hereinafter, with reference to FIGS. 1 to 13, two embodiments when the present invention is applied to a graph scientific calculator which is one of arithmetic control devices will be described in detail.
まず、各実施形態に共通する全体の構成を説明する。
図1は、グラフ関数電卓1の概観図である。同図に示すように、グラフ関数電卓1は、各種操作キーを含むキー群3及びディスプレイ4を備えて構成されている。
First, the overall configuration common to the embodiments will be described.
FIG. 1 is an overview diagram of a graph
キー群3は、ユーザーがグラフ関数電卓1に数値を入力したり、演算結果の表示を指示するためのキーを備えており、例えば数字キー群3aと、方向キー3bと、EXEキー3cと、桁落ち桁数表示キー3dと、有効精度桁数表示キー3eと、桁数増加表示キー3fと、桁落ち部分識別表示キー3gとを備えている。
The
数字キー群3aは数字を入力するためのキーである。また方向キー3bは、カーソルを移動させたり、機能を選択したりする場合等に押下されるキーであり、本実施形態においては、上下左右の方向に指示入力可能に構成されている。
The number key group 3a is a key for inputting numbers. The
EXEキー3cは、グラフ関数電卓1に対し処理の実行、決定を指示するためのキーである。桁落ち桁数表示キー3dは、演算された演算結果の桁落ち桁数を表示する指示を与えるためのキーである。また、有効精度桁数表示キー3eは、有効精度桁数を表示する指示を与えるためのキーである。有効精度桁数とは、演算結果の内、桁落ち桁を除いた有効な精度の桁数であり、ユーザーにより入力された演算桁数と桁落ち桁数との差によって求められる。
The
桁数増加表示キー3fは、ユーザーにより入力された演算桁数に、所定の追加桁数を追加した追加演算桁数で演算を行わせた場合の演算結果を表示する指示を与えるためのキーである。桁落ち部分識別表示キー3gは、演算結果の内、桁落ち桁の値とそれ以外の値とを異なる表示形態で識別して表示する指示を与えるためのキーである。
The digit
ディスプレイ4は、各種キーの押下に応じたデータやグラフが表示される部分であって、LCD(Liquid Crystal Display)等により構成されており、CPU20から入力される表示信号に基づいて各種表示を行う。
The
図2は、グラフ関数電卓1の構成を示すブロック図である。同図において、グラフ関数電卓1は、CPU(Central Processing Unit)20、入力部30、表示部40、ROM(Read Only Memory)50、RAM(Random Access Memory)60、十進演算器70を備え、各部はバス80で相互にデータ通信可能に接続されて構成されている。
FIG. 2 is a block diagram showing a configuration of the graph
CPU20は、入力部30を介して入力される指示に基づいて、ROM50から所定のプログラムを読み出して当該プログラムをRAM60に一時格納し、当該プログラムを用いて十進演算器70により演算された演算結果の桁落ち桁数の検出、有効精度桁数の検出等の各種処理を実行した後、その処理結果を表示部40に出力させる。すなわちCPU20は、グラフ関数電卓1の各部を統括的に制御する役割を担っている。
The
入力部30は、数字キーや方向キー等のキー群を備えた入力装置であり、押下されたキーの信号をCPU20に出力する。この入力部30におけるキー入力により、数値の入力、演算の実行、表示処理実行の指示等の入力手段が実現される。なお、この入力部30は、図1に示すキー群3に対応するが、必ずしもキーである必要はなく、例えばタッチパネルであってもよい。
The
表示部40は、CPU20から入力される各種信号に基づいて各種画面を表示するものであり、図1に示すディスプレイ4に対応する。
The
ROM50は、電源がON状態にされた際にグラフ関数電卓1を初期状態に設定するためのプログラム及びデータの他、後述する各実施形態を実現するためのプログラム等を格納している。ROM50は、第1実施形態ではROM51とし、第2実施形態ではROM53として説明する。
The
RAM60は、CPU20の作業領域として各種データを一時的に記憶するための記憶領域である。RAM60は、第1実施形態ではRAM61とし、第2実施形態ではRAM63として説明する。
The
十進演算器70は、プログラムROM710を備え、機械語プログラムの機械語命令に従った十進演算を実行する演算装置であり、指定された任意の桁数で演算を行うことができる。プログラムROM710には、入力された任意の演算桁数で演算を行うための任意桁数演算プログラム7101と、複数演算種類7103とが格納されている。
The decimal
図3は、十進演算器70の回路構成を示すブロック図である。十進演算器70は、プログラムROM710と、プログラムカウンタ712と、ラッチ部714と、命令デコーダ716と、可変パラメータ記憶部720と、セレクタ731〜734と、アドレスカウンタ740を含むアドレス制御回路750と、レジスタ部760と、演算器770と、シフタ780とを備えている。以下、この十進演算器70の構成と機能について説明する。
FIG. 3 is a block diagram showing a circuit configuration of the decimal
プログラムROM710に格納されている任意桁数演算プログラム7101及び複数演算種類7103は、ユーザーにより入力された演算桁数及び指定された演算種類に応じて適宜選択され、機械語の命令が1つずつ読み出されてラッチ部714に保持される。
Arbitrary
ここで、機械語の1つの命令は、命令コードOPと4ビットの拡張命令コードEXTとを持つ命令部及び2ビットのデータFu、Suと4ビットのデータFl、Slとを持つオペランド部で構成される。 Here, one instruction in the machine language includes an instruction part having an instruction code OP and a 4-bit extended instruction code EXT and an operand part having 2-bit data Fu and Su and 4-bit data Fl and Sl. Is done.
レジスタ部760は、それぞれ16ワードで構成される4本のレジスタX、Y、Z、Aを備え、ユーザーにより入力された演算データがBCDコード化され、十進数で4桁毎(16ビットで1ワード)に格納される。
The
4本のレジスタX、Y、Z、Aは、オペランド部の2ビットのデータFu、Suで指定することが可能である。また、16個のワードは、図4(a)に示す通り、(1)直接アドレス方式と、(2)間接アドレス方式の2通りの方法で指定することが可能である。オペランド部の4ビットのデータFl、Slで直接ワードを指定する方法が直接アドレス方式、命令部の拡張命令コードEXTで可変パラメータ記憶部720のレジスタW、Vに格納されているデータw、vにアクセスし、この値を用いて間接的にワードを指定する方法が間接アドレス方式であって、どちらの方法によっても演算を行わせたいワードを指定することができる。
The four registers X, Y, Z, and A can be specified by 2-bit data Fu and Su in the operand part. In addition, as shown in FIG. 4A, the 16 words can be specified by two methods: (1) direct address method and (2) indirect address method. A method of directly specifying a word with 4-bit data Fl, S1 in the operand part is a direct address system, and data W, v stored in the registers W, V of the variable
また、命令は(1)1ワード命令と、(2)連続ワード命令の2つに分類される。1ワード命令は、直接又は間接アドレス方式によって1つのワードを指定し、当該ワードに対する演算を行わせるための命令である。 Instructions are classified into two types: (1) 1 word instruction and (2) continuous word instruction. The one-word instruction is an instruction for designating one word by a direct or indirect address method and performing an operation on the word.
一方、連続ワード命令は、直接又は間接アドレス方式によって開始ワード及び終了ワードを指定し、開始ワードから終了ワードまでの一連のワードを用いた演算を行わせるための命令である。 On the other hand, the continuous word instruction is an instruction for designating a start word and an end word by a direct or indirect address method and performing an operation using a series of words from the start word to the end word.
尚、間接アドレス方式にはワードを指定するワード指定と、桁を指定する桁指定とがある。ワード指定では、レジスタVに格納されているデータvにアクセスして、この値を用いてワードを指定することができるのに対し、桁指定では、レジスタIに格納されているデータiにアクセスし、この値を用いてワード内の桁を指定することができる。ワード指定では、ワード単位、即ち4桁単位での演算しか行わせることができないが、桁指定では、桁単位つまり任意の演算桁数での演算を行わせることができる。 The indirect addressing method includes a word designation for designating a word and a digit designation for designating a digit. In word designation, data v stored in register V can be accessed and a word can be designated using this value, whereas in digit designation, data i stored in register I is accessed. This value can be used to specify a digit in the word. In word designation, calculation can be performed only in word units, that is, in units of four digits, but in digit designation, calculations can be performed in units of digits, that is, an arbitrary number of calculation digits.
間接/直接アドレス方式の別及び連続ワード/1ワード命令の別は、図4(b)に示す通り、命令の4ビットの拡張命令コードEXTで設定される。拡張命令コードEXTの1ビット目のデータ(EXT[1])は連続ワード/1ワード命令の別を示し、連続ワード命令の場合には「0」、1ワード命令の場合には「1」がそれぞれ設定される。 As shown in FIG. 4B, the indirect / direct address type and the continuous word / 1 word instruction are set by the 4-bit extended instruction code EXT. The first bit data (EXT [1]) of the extended instruction code EXT indicates whether it is a continuous word / 1-word instruction, “0” for a continuous word instruction and “1” for a 1-word instruction. Each is set.
拡張命令コードEXTの2ビット目のデータ(EXT[2])及び3ビット目のデータ(EXT[3])は、間接/直接アドレス方式の別を示し、直接アドレス方式によるワード指定の場合には「00」、間接アドレス方式による桁指定の場合には「01」、間接アドレス方式によるワード指定の場合には「10」がそれぞれ設定される。 The second bit data (EXT [2]) and the third bit data (EXT [3]) of the extended instruction code EXT indicate different types of indirect / direct addressing methods. “01” is set for digit designation by the indirect address method, and “10” is set for word designation by the indirect address method.
また、拡張命令コードEXTの4ビット目のデータ(EXT[4])は間接/直接アドレス方式の別を示し、直接アドレス方式によるワード指定の場合には「0」、間接アドレス方式によるワード指定の場合には「1」がそれぞれ設定される。尚、EXT[4]で、間接アドレス方式による桁指定の設定を行うことはできない。 Further, the fourth bit data (EXT [4]) of the extended instruction code EXT indicates the indirect / direct address system, and is “0” in the case of word designation by the direct address system, and the word designation by the indirect address system. In this case, “1” is set. It should be noted that setting of digit designation by the indirect address method cannot be performed with EXT [4].
次に、命令の意味と動作について具体例を挙げて説明する。
図4(c)は、拡張命令コードEXTが取り得る12種類の値の内、4種類についての命令と、その動作内容を示す図である。同図において、命令部の「ADD」は“加算”を表す命令コードであり、「ADD」に続く4ビットのデータは拡張命令コードEXTを表している。
Next, the meaning and operation of instructions will be described with specific examples.
FIG. 4C is a diagram showing four types of commands and their operation contents among the 12 types of values that the extended instruction code EXT can take. In the figure, “ADD” in the instruction part is an instruction code representing “addition”, and 4-bit data following “ADD” represents an extended instruction code EXT.
(1)拡張命令コードEXT=「0000」
この場合、命令は連続ワード命令であり、直接アドレス方式によるワード指定で実行される。先ず、ラッチ部714には、Fu=「00(X)」、Fl=「1111(15)」、Su=「01(Y)」、Sl=「0100(4)」、OP=「ADD」、EXT=「0000」がラッチされる。
(1) Extended instruction code EXT = "0000"
In this case, the instruction is a continuous word instruction and is executed by word designation by the direct address method. First, the
セレクタ731〜734では、EXT=「0000」の各ビットのデータが選択制御信号として入力されると共に、各種データの選択・出力が行われる。この場合、セレクタ731からはFl=「1111」が選択・出力され、セレクタ732からはSl=「0100」が選択・出力される。また、アドレスカウンタ740には、セレクタ732の出力データ即ちSl=「0100」がセットされ、セレクタ733、734からは、アドレスカウンタ740の出力データ即ちSl=「0100」が共に選択・出力される。
In the
これにより、レジスタ部760のアドレス端子FadにはFu=「00」とSl=「0100」とが入力されることで、レジスタXの第4ワードに格納されている演算データが出力端子Foutから出力される。また、アドレス端子SadにはSu=「01」とSl=「0100」とが入力されることで、レジスタYの第4ワードに格納されている演算データが出力端子Soutから出力される。
As a result, Fu = “00” and S1 = “0100” are input to the address terminal Fad of the
一方、命令デコーダ716では命令コードOPの「ADD」が加算であると解読(デコード)され、加算を指示する演算制御信号が演算器770に出力される。これにより、演算器770では、レジスタ部760から出力された2つの演算データが加算され、その加算結果が入力端子Finに入力され、レジスタXの第4ワードに書き込まれる(動作:X4+Y4→X4)。
On the other hand, the
その後は、アドレスカウンタ740がカウントアップし、アドレス制御回路750により命令終了信号「1」が出力されるまでの間、第4ワードから第15ワードまでの一連のワードを用いた加算が繰り返し実行される(動作:X4〜15+Y4〜15→X4〜15)。これにより、演算桁数48(=4×(15−4+1))桁での加算が実行される。
Thereafter, until the
(2)拡張命令コードEXT=「0100」
この場合、命令は連続ワード命令であり、間接アドレス方式による桁指定で実行される。先ず、ラッチ部714には、Fu=「00(X)」、Fl=「1111(15)」、Su=「01(Y)」、Sl=「*」、OP=「ADD」、EXT=「0100」がラッチされる。
(2) Extended instruction code EXT = "0100"
In this case, the instruction is a continuous word instruction and is executed by digit designation by the indirect addressing method. First, the
セレクタ731からはFl=「1111」が選択・出力され、セレクタ732からはデータiが選択・出力される。また、アドレスカウンタ740には、データiがセットされ、セレクタ733、734からは、データiが共に選択・出力される。
Fl = “1111” is selected and output from the
これにより、レジスタ部760のアドレス端子FadにはFu=「00」とデータiとが入力されることで、レジスタXの第i桁に格納されている演算データが出力端子Foutから出力される。また、アドレス端子SadにはSu=「01」とデータiとが入力されることで、レジスタYの第i桁に格納されている演算データが出力端子Soutから出力される。
As a result, Fu = “00” and data i are input to the address terminal Fad of the
そして、演算器770では、レジスタ部760から出力された2つの演算データが加算され、その加算結果が入力端子Finに入力され、レジスタXの第i桁に書き込まれる(動作:Xi+Yi→Xi)。
Then, in the
その後は、アドレスカウンタ740がカウントアップし、アドレス制御回路750により命令終了信号「1」が出力されるまでの間、第i桁から第15ワードまでの加算が繰り返し実行される(動作:Xi〜15+Yi〜15→Xi〜15)。iの値が可変であることから、iを変化させることで任意の演算桁数での演算が可能となる。
Thereafter, the addition from the i-th digit to the 15th word is repeatedly executed until the
(3)拡張命令コードEXT=「0001」
この場合、命令は1ワード命令であり、直接アドレス方式によるワード指定で実行される。先ず、ラッチ部714には、Fu=「00(X)」、Fl=「1111(15)」、Su=「01(Y)」、Sl=「0100(4)」、OP=「ADD」、EXT=「0001」がラッチされる。
(3) Extended instruction code EXT = “0001”
In this case, the instruction is a one-word instruction and is executed by word designation by the direct address method. First, the
セレクタ731からはFl=「1111」が選択・出力され、セレクタ732からはSl=「0100」が選択・出力される。また、アドレスカウンタ740にはSl=「0100」がセットされ、セレクタ733からはFl=「1111」、セレクタ734からはSl=「0100」がそれぞれ選択・出力される。
The
これにより、レジスタ部760のアドレス端子FadにはFu=「00」とFl=「1111」とが入力されることで、レジスタXの第15ワードに格納されている演算データが出力端子Foutから出力される。また、アドレス端子SadにはSu=「01」とSl=「0100」とが入力されることで、レジスタYの第4ワードに格納されている演算データが出力端子Soutから出力される。
As a result, Fu = “00” and Fl = “1111” are input to the address terminal Fad of the
そして、演算器770では、レジスタ部760から出力された2つの演算データが加算され、その加算結果が入力端子Finに入力され、レジスタXの第15ワードに書き込まれる(動作:X15+Y4→X15)。
Then, in the
一方、EXT[1]が1であることから、アドレス制御回路750からは必ず命令終了信号「1」が出力され、命令の実行が終了する。これにより、レジスタXの第15ワードの演算データと、レジスタYの第4ワードの演算データとが加算され、演算桁数4桁での演算が実行される。
On the other hand, since EXT [1] is 1, the instruction end signal “1” is always output from the
(4)拡張命令コードEXT=「1101」
この場合、命令は1ワード命令であり、間接アドレス方式による桁指定で実行される。先ず、ラッチ部714には、Fu=「00(X)」、Fl=「*」、Su=「01(Y)」、Sl=「*」、OP=「ADD」、EXT=「1101」がラッチされる。
(4) Extended instruction code EXT = "1101"
In this case, the instruction is a one-word instruction and is executed by specifying a digit by the indirect address method. First, Fu = “00 (X)”, Fl = “*”, Su = “01 (Y)”, Sl = “*”, OP = “ADD”, EXT = “1101” are stored in the
セレクタ731からはデータwが選択・出力され、セレクタ732からはデータiが選択・出力される。また、アドレスカウンタ740にはデータiがセットされ、セレクタ733からはデータw、セレクタ734からはデータiがそれぞれ選択・出力される。
The
これにより、レジスタ部760のアドレス端子FadにはFu=「00」とデータwとが入力されることで、レジスタXの第wワードに格納されている演算データが出力端子Foutから出力される。また、アドレス端子SadにはSu=「01」とデータiとが入力されることで、レジスタYの第i桁に格納されている演算データが出力端子Soutから出力される。
As a result, Fu = “00” and data w are input to the address terminal Fad of the
そして、演算器770では、レジスタ部760から出力された2つの演算データが加算され、その加算結果が入力端子Finに入力され、レジスタXの第wワードに書き込まれる(動作:Xw+Yi→Xw)。
Then, in the
一方、EXT[1]が1であることから、アドレス制御回路750からは必ず命令終了信号「1」が出力され、命令の実行が終了する。これにより、レジスタXの第wワードの演算データと、レジスタYの第i桁の演算データとが加算される。
On the other hand, since EXT [1] is 1, the instruction end signal “1” is always output from the
以上、4種類の命令のみを例に挙げて十進演算器70の動作について説明したが、選択される機械語プログラム及び命令の種類により任意の演算桁数での演算を行うことが可能となる。
The operation of the decimal
〔第1実施形態〕
図5〜10を参照して、第1実施形態について説明する。
[First Embodiment]
The first embodiment will be described with reference to FIGS.
まず、構成を説明する。
図5(a)は、第1実施形態に係るグラフ関数電卓1が図2のROM50の代わりに備えるROM51の構成を示す図である。ROM51は、CPU20によって読み出され、第1演算表示処理(図6参照)として実行される第1演算表示プログラム511を格納している。
First, the configuration will be described.
FIG. 5A is a diagram showing a configuration of a
第1演算表示処理とは、入力された演算桁数及び指定された演算種類に応じて演算を実行すると共に、演算により求められた演算結果の桁落ち桁数及び有効精度桁数を検出し、当該演算結果と共に、各種表示指示に応じて桁落ちを知らしめる表示を行う処理である。尚、この第1演算表示処理の動作については詳細に後述する。 The first calculation display processing is to perform calculation according to the input calculation digit number and the specified calculation type, and to detect the number of lost digits and the effective precision digit of the calculation result obtained by the calculation, This is a process of performing display for notifying a digit loss in accordance with various display instructions together with the calculation result. The operation of the first calculation display process will be described later in detail.
図5(b)は、第1実施形態に係るグラフ関数電卓1が図2のRAM60の代わりに備えるRAM61の構成を示す図である。RAM61は、入力された演算桁数を格納するための演算桁数格納領域611と、指定された演算種類を格納するための演算種類格納領域613と、入力された被演算子を格納するための被演算子格納領域615と、演算による桁落ち桁数を格納するための桁落ち桁数格納領域617と、演算結果の有効精度桁数を格納するための有効精度桁数格納領域619とを備えている。ここで、演算桁数とは演算を行わせる桁数のことを指し、演算種類とは演算の対象となる関数の種類のことを指す。
FIG. 5B is a diagram illustrating a configuration of a
次に動作を説明する。
図6は、CPU20により第1演算表示プログラム511が読み出されて実行されることによりグラフ関数電卓1において実行される第1演算表示処理の流れを示すフローチャートである。
Next, the operation will be described.
FIG. 6 is a flowchart showing the flow of the first calculation display process executed in the graph
先ず、ユーザーにより演算桁数が入力部30を介して入力されると(ステップA1)、CPU20は、この入力された演算桁数を演算桁数格納領域611に格納し、続いて演算種類がユーザーにより指定されると(ステップA3)、この指定された演算種類を演算種類格納領域613に格納する。また、ユーザーにより被演算子が入力されると(ステップA5)、CPU20は、この入力された被演算子を被演算子格納領域615に格納する。
First, when the calculation digit number is input by the user via the input unit 30 (step A1), the
次に、CPU20は、入力された被演算子を用い、指定された演算種類の演算を入力された演算桁数で実行するための機械語プログラムを生成し、十進演算器70に演算(以下、「第1演算」と呼ぶ。)を実行させる(ステップA7)。また、指定された演算種類の演算を入力された演算桁数に所定の追加桁数(例えば、「4桁」)を追加した追加演算桁数で実行するための機械語プログラムを生成し、十進演算器70に演算(以下、「第2演算」と呼ぶ。)を実行させる(ステップA9)。
Next, the
次いで、CPU20は、第1演算及び第2演算で求められた演算結果(以下、それぞれ「第1演算結果」、「第2演算結果」と呼ぶ。)の最上位桁の値を0以外の値にする正規化処理を行う(ステップA11)。
Next, the
次に、CPU20は、第1演算結果と第2演算結果の各桁の値を比較し、値が一致しない桁の数を桁落ち桁数として検出して(ステップA13)、桁落ち桁数格納領域617に格納する。また、CPU20は、検出した桁落ち桁数を用いて有効精度桁数を検出し(ステップA15)、有効精度桁数格納領域619に格納する。ここで、有効精度桁数とは、第1演算結果の内、桁落ち桁を除いた有効な精度の桁数であり、入力された演算桁数と桁落ち桁数との差として検出される。
Next, the
次いで、CPU20は、第1演算結果を表示部40に表示させる(ステップA17)。そして、CPU20は、桁落ち桁数表示キー3dが押下されたかどうかを判定することで桁落ち桁数表示指示がなされたか否かを判定し(ステップA19)、なされたと判定した場合には(ステップA19;Yes)、ステップA13で検出した桁落ち桁数を表示部40に表示させる(ステップA21)。また、指示がなされなかったと判定した場合には(ステップA19;No)、ステップA23に処理を移行する。
Next, the
そして、CPU20は、有効精度桁数表示キー3eが押下されたかどうかを判定することで有効精度桁数表示指示がなされたか否かを判定し(ステップA23)、なされたと判定した場合には(ステップA23;Yes)、ステップA15で検出した有効精度桁数を表示部40に表示させ(ステップA25)、なされなかったと判定した場合には(ステップA23;No)、ステップA27へ処理を移行する。
Then, the
次いで、CPU20は、桁数増加表示キー3fが押下されたかどうかを判定することで桁数増加表示指示がなされたか否かを判定し(ステップA27)、なされたと判定した場合には(ステップA27;Yes)、第2演算結果を表示部40に表示させ(ステップA29)、なされなかったと判定した場合には(ステップA27;No)、ステップA31に処理を移行する。
Next, the
そして、CPU20は、桁落ち部分識別表示キー3gが押下されたかどうかを判定することで桁落ち部分識別表示指示がなされたか否かを判定し(ステップA31)、なされたと判定した場合には(ステップA31;Yes)、第1演算結果の桁落ち桁の値とそれ以外の値とを、異なる表示形態で識別して表示部に表示させ(ステップA33)、第1演算表示処理を終了する。
Then, the
また、ステップA31において桁落ち部分識別表示指示がなされなかったと判定した場合には(ステップA31;No)、CPU20は、第1演算表示処理を終了する。
On the other hand, when it is determined in step A31 that no digit part identification display instruction has been given (step A31; No), the
次に、これまでの処理について、表示画面例を参照しつつ、具体的に説明する。
図7(a)は、グラフ関数電卓1の表示部40に表示される表示画面の一例である表示画面401を示したものである。
Next, the processing so far will be specifically described with reference to a display screen example.
FIG. 7A shows a
表示画面401の上部には、ユーザーが演算桁数を入力するための演算桁数入力ボックス4011と、演算種類を指定するための演算種類指定ボックス4013と、被演算子を入力するための被演算子入力ボックス4015とが表示されている。尚、演算種類は、プルダウンメニューから選択・指定することが可能である。
In the upper part of the
そして、表示画面401の下部には、第1演算結果が表示される演算結果表示ボックス4017と、第2演算結果が表示される桁数増加表示ボックス4019と、桁落ち桁数が表示される桁落ち桁数表示ボックス4021と、有効精度桁数が表示される有効精度桁数表示ボックス4023とが表示されている。
At the bottom of the
また、表示画面401の最下部には、4種類の表示指示4025が表示されており、どの表示指示がなされたかがユーザーに一目でわかるようになっている。例えば、桁落ち桁数表示キー3dが押下されることで桁落ち桁数表示指示がなされた場合には、表示指示4025の内、「桁落ち桁数」と表示された部分が反転表示される。
In addition, four types of
図7(b)は、プルダウンメニューから演算種類が指定された場合の表示画面401を示したものである。演算種類指定ボックス4013のプルダウンメニューには、「x2」、「logx」・・・と複数の演算種類が表示されており、ここでは、複利計算の一種であり4013aで示される「(1+x)3−1」が指定され、反転表示されている。
FIG. 7B shows a
図8(a)は、ユーザーにより演算桁数の入力、演算種類の指定及び被演算子の入力がなされた場合の表示画面401を示したものである。演算桁数入力ボックスには、演算桁数として4011aで示される「8」が入力され(図6のステップA1)、演算種類指定ボックスでは、演算種類として4013aで示される「(1+x)3−1」が指定されている(図6のステップA3)。また、被演算子入力ボックスには、被演算子(ここでは、変数xに代入される数値。)として4015aで示される「0.00123」が入力されている(図6のステップA5)。
FIG. 8A shows a
図8(b)は、第1演算結果が表示された場合の表示画面401を示したものである。演算結果表示ボックスには、第1演算結果として4017aで示される「3.6945000 e−3」が表示されている(図6のステップA17)。尚、表示された第1演算結果の内、「3.6945000」は仮数部、「e−3」は指数部をそれぞれ表している。
FIG. 8B shows a
図9(a)は、桁落ち桁数表示指示がユーザーによりなされた場合の表示画面401を示したものである。桁落ち桁数表示指示がなされたことで(図6のステップA19;Yes)、表示画面401最下部の「桁落ち桁数」が4025aとして反転表示され、桁落ち桁数表示ボックスには、桁落ち桁数として4021aで示される「3」が表示されている(図6のステップA21)。これにより、表示された第1演算結果には、3桁の桁落ちが生じていることがわかる。
FIG. 9A shows a
図9(b)は、有効精度桁数表示指示がユーザーによりなされた場合の表示画面401を示したものである。有効精度桁数表示指示がなされたことで(図6のステップA23;Yes)、表示画面401最下部の「有効精度」が4025bとして反転表示され、有効精度桁数表示ボックスには、有効精度桁数として4023aで示される「5」が表示されている(図6のステップA25)。これにより、表示された第1演算結果の有効精度桁数は5桁であることがわかる。
FIG. 9B shows the
図10(a)は、桁数増加表示指示がユーザーによりなされた場合の表示画面401を示したものである。桁数増加表示指示がなされたことで(図6のステップA27;Yes)、表示画面401最下部の「桁増加表示」が4025cとして反転表示され、桁数増加表示ボックスには、第2演算結果として4019aで示される「3.69454056000 e−3」が表示されている(図6のステップA29)。つまり、第2演算は、入力された演算桁数8桁に追加桁数として4桁を追加した追加演算桁数12桁で実行された(図6のステップA9)ことがわかる。また、第1演算結果である4017aと第2演算結果である4019aとを比較すると、第1演算結果の下位3桁の値が、第2演算結果の対応する各桁の値と一致していないため、ユーザーは第1演算結果の下位3桁に桁落ちが生じていることを理解できる。また、追加演算桁数での演算結果により、より高精度な演算結果が得られる。
FIG. 10A shows a
図10(b)は、桁落ち部分識別表示指示がユーザーによりなされた場合の表示画面401を示したものである。桁落ち部分識別表示指示がなされたことで(図6のステップA33;Yes)、表示画面401最下部の「識別表示」が4025dとして反転表示され、演算結果表示ボックスには、第1演算結果の内、桁落ち部分である下位3桁の「0」が小文字4017bで識別されて表示されている(図6のステップA35)。これにより、表示された第1演算結果の下位3桁に桁落ちが生じていることが一目で視認できる。
FIG. 10 (b) shows a
以上の通りに、第1実施形態によれば、入力された演算桁数及び指定された演算種類に応じて演算を実行し、求められた演算結果の桁落ち桁数及び有効精度桁数を検出することで、桁落ちを知らしめる表示を行うことができる。このため、入力された演算桁数で演算を行い、求められた演算結果の正確な桁落ち桁数を検出し、桁落ちを知らしめることを可能にする演算制御装置が実現できる。 As described above, according to the first embodiment, the calculation is executed according to the input calculation digit number and the specified calculation type, and the number of lost digits and the effective precision digit of the obtained calculation result are detected. By doing so, it is possible to perform a display informing that the digits are lost. For this reason, it is possible to realize an arithmetic and control unit that performs an operation with the input number of arithmetic digits, detects the exact number of digits that are lost in the calculated result, and makes it possible to notify the user that the digits are lost.
〔変形例〕
尚、ステップA33の桁落ち部分識別表示において、桁落ち部分の値を小文字で識別することとして説明したが、識別方法はこれに限られるわけではない。例えば、桁落ち部分の値を細字で表示し、それ以外の値を太字で表示するといった、線の太さで識別することにしてもよいし、桁落ち部分の値を赤字で表示し、それ以外の部分を黒字で表示するといった、色で識別することにしても勿論よい。
[Modification]
In addition, in the digit part identification display of step A33, it demonstrated as identifying the value of a digit part by a small letter, However, The identification method is not necessarily restricted to this. For example, it may be possible to identify by the thickness of the line, such as displaying the value of the omitted part in thin characters and displaying the other values in bold, or displaying the value of the omitted part in red. Of course, other parts may be identified by color, such as displaying in black.
また、4種類の表示指示はそれぞれ独立しており、表示も個々になされるものとして説明したが、所望の表示指示が複数同時に与えられた場合に、表示を同時に行うことにしても勿論よい。例えば、桁落ち桁数表示指示と桁数増加表示指示とが同時に行われた場合に、桁落ち桁数と第2演算結果とを同時に表示することで、ユーザーは桁落ちの存在をより把握しやすくなる。 In addition, the four types of display instructions are independent of each other, and the display is performed individually. However, when a plurality of desired display instructions are given at the same time, the display may be performed simultaneously. For example, when an instruction to display the number of digits dropped and an instruction to increase the number of digits are issued at the same time, by displaying the number of digits discarded and the result of the second calculation at the same time, the user can better understand the presence of digits. It becomes easy.
〔第2実施形態〕
図11〜13を参照して、第2実施形態について説明する。
[Second Embodiment]
The second embodiment will be described with reference to FIGS.
まず、構成を説明する。
図11(a)は、第2実施形態に係るグラフ関数電卓1が図2のROM50の代わりに備えるROM53の構成を示す図である。ROM53は、CPU20によって読み出され、第2演算表示処理(図12参照)として実行される第2演算表示プログラム531を格納している。
First, the configuration will be described.
FIG. 11A is a diagram showing a configuration of a
第2演算表示処理とは、入力された演算桁数及び指定された演算種類に応じた演算を実行し、求められた演算結果の桁落ち桁数を検出すると共に、桁落ち桁の補正を施した演算結果を表示させる処理である。尚、この第2演算表示処理の動作については詳細に後述する。 The second calculation display process executes the calculation according to the number of input calculation digits and the specified calculation type, detects the number of digits that are lost in the calculated result, and corrects the digits. This is a process for displaying the calculated result. The operation of the second calculation display process will be described later in detail.
図11(b)は、第2実施形態に係るグラフ関数電卓1が図2のRAM60の代わりに備えるRAM63の構成を示す図である。RAM63は、ユーザーにより入力された演算桁数を格納するための演算桁数格納領域631と、指定された演算種類を格納するための演算種類格納領域633と、入力された被演算子を格納するための被演算子格納領域635と、演算結果の桁落ち桁数を格納するための桁落ち桁数格納領域637とを備えている。尚、演算桁数及び演算種類については第1実施形態と同様である。
FIG. 11B is a diagram illustrating a configuration of a
次に動作を説明する。
図12は、CPU20により第2演算表示プログラム531が読み出されて実行されることによりグラフ関数電卓1において実行される第2演算表示処理の流れを示すフローチャートである。
Next, the operation will be described.
FIG. 12 is a flowchart showing the flow of the second calculation display process executed in the graph
先ず、ユーザーにより演算桁数が入力部30を介して入力されると(ステップB1)、CPU20は、この入力された演算桁数を演算桁数格納領域631に格納し、続いて演算種類がユーザーにより指定されると(ステップB3)、この指定された演算種類を演算種類格納領域633に格納する。また、ユーザーにより被演算子が入力されると(ステップB5)、CPU20は、この入力された被演算子を被演算子格納領域635に格納する。
First, when the calculation digit number is input by the user via the input unit 30 (step B1), the
次に、CPU20は、入力された被演算子を用い、指定された演算種類の演算を入力された演算桁数で実行するための機械語プログラムを生成し、十進演算器70に演算(第1演算)を実行させる(ステップB7)。また、入力された演算桁数に所定の追加桁数(例えば、「4桁」)を追加した追加演算桁数で、指定された演算種類の演算を実行するための機械語プログラムを生成し、十進演算器70にその演算(第2演算)を実行させる(ステップB9)。
Next, the
次いで、CPU20は、第1演算及び第2演算で求められた演算結果の最上位桁の値を0以外の値にする正規化処理を行う(ステップB11)。
Next, the
次に、CPU20は、第1演算結果と第2演算結果の各桁の値を比較し、値が一致しない桁の数を桁落ち桁数として検出して(ステップB13)、桁落ち桁数格納領域637に格納する。
Next, the
その後、CPU20は、ステップB13において検出した桁落ち桁数と、ステップB1において入力された演算桁数との和が、ステップB9で第2演算を実行させた追加演算桁数以下であるかどうかを判定し(ステップB15)、追加演算桁数以下ではないと判定した場合には(ステップB15;No)、入力された演算桁数に、検出した桁落ち桁数と所定の追加桁数とを追加した新たな追加演算桁数で十進演算器70に第2演算を再度実行させる(ステップB17)。
Thereafter, the
そして、CPU20は、再度求められた第2演算結果の最上位桁の値を0以外の値にする正規化処理を行い(ステップB19)、正規化した第2演算結果を入力された演算桁数に丸め(ステップB21)、丸めた第2演算結果を表示部40に表示させて(ステップB23)、第2演算表示処理を終了する。また、ステップB15において、追加演算桁数以下であると判定した場合には(ステップB15;Yes)、CPU20は、ステップB21に処理を移行する。
Then, the
次に、これまでの処理について、表示画面例を参照しつつ、具体的に説明する。
図13(a)は、グラフ関数電卓1の表示部40に表示される表示画面の一例である表示画面403を示したものである。
Next, the processing so far will be specifically described with reference to a display screen example.
FIG. 13A shows a
表示画面403では、第1実施形態と同様に演算桁数として「8」桁、演算種類として「(1+x)3−1」、被演算子として「0.00123」がそれぞれ入力・指定されている(図12のステップB1〜B5)。また、本実施形態では、入力された演算桁数(ここでは、「8桁」)に丸められた第2演算結果が、演算結果表示ボックス4031に表示される。
On the
図13(b)は、第2演算結果が表示された場合の表示画面403を示したものである。演算結果表示ボックスには、入力された演算桁数8桁に丸められた第2演算結果として4031aで示される「3.6945406 e−3」が表示されている(図12のステップB21、B23)。この例では、第1演算結果に生じた桁落ちが3桁であり(図12のステップB13)、この桁落ち桁数3桁と演算桁数8桁との和11桁が、追加演算桁数以下であったために(図12のステップB15;Yes)、ステップB11において正規化された第2演算結果がそのまま8桁に丸められて表示されている(図12のステップB21、B23)。
FIG. 13B shows a
この演算結果は、入力された演算桁数8桁に所定の追加桁数4桁を追加した追加演算桁数12桁で演算を実行した演算結果を8桁に丸めたものであり、検出した桁落ち桁数が3桁であったことから、桁落ち桁が補正された正確な演算結果である。 This calculation result is obtained by rounding the calculation result obtained by performing the calculation with 12 additional calculation digits by adding the predetermined additional digit number of 4 digits to the input calculation digit number of 8 digits to the detected digit. Since the number of missing digits was 3, it is an accurate calculation result in which the lost digits were corrected.
以上の通りに、第2実施形態によれば、入力された演算桁数及び指定された演算種類に応じて演算を実行し、求められた演算結果の桁落ち桁数を検出すると共に、検出された桁落ち桁数に応じて桁落ち桁の補正を行った演算結果を表示させることができる。 As described above, according to the second embodiment, the calculation is performed according to the input number of calculation digits and the specified calculation type, and the number of digits discarded in the calculated calculation result is detected and detected. It is possible to display the calculation result obtained by correcting the digit digits depending on the number of digit digits.
尚、例えば検出した桁落ち桁数が5桁であり、桁落ち桁数5桁と演算桁数8桁との和13桁が、追加演算桁数12桁を超えたといった場合には(図12のステップB15;No)、演算桁数8桁に、桁落ち桁数5桁と所定の追加桁数4桁とを追加した新たな追加演算桁数17桁で演算が再度実行され(図12のステップB17)、この演算結果が8桁に丸められる(図12のステップB21)ことで演算結果が補正される。また、所定の追加桁数は4桁であることとして説明したが、これに限られるわけではなく、例えばユーザーにより設定されることにしてもよい。 For example, when the number of digits that have been detected is 5 and the sum of 13 digits including the number of digits to be discarded and 8 digits of calculation exceeds 12 digits of additional calculation (FIG. 12). Step B15; No), and the calculation is performed again with a new additional calculation digit number of 17 digits, which is obtained by adding 5 digits of lost digits and a predetermined additional digit number of 4 to the calculation digit number of 8 digits (FIG. 12). In step B17), this calculation result is rounded to 8 digits (step B21 in FIG. 12), thereby correcting the calculation result. In addition, although it has been described that the predetermined number of additional digits is four digits, it is not limited thereto, and may be set by a user, for example.
以上、2つの実施形態について、本発明を演算制御装置の一種であるグラフ関数電卓に適用した場合について説明したが、適用可能な製品はグラフ関数電卓に限らず、例えばグラフ描画機能を有しない電卓やパソコン、PDA(Personal Digital Assistance)等の電子機器にも適用可能である。 As described above, the case where the present invention is applied to the graph scientific calculator which is a kind of the arithmetic control device has been described in the two embodiments. However, the applicable product is not limited to the graph scientific calculator, for example, a calculator having no graph drawing function. It can also be applied to electronic devices such as personal computers, PDAs (Personal Digital Assistance).
また、十進演算器70は電子機器(上記実施形態ではグラフ関数電卓)に内蔵されているものとして説明したが、着脱自在に装着可能としてもよい。図14にその一例を示す。
Moreover, although the decimal
図14は、パソコン100と演算装置200とで構成される演算システムSを示したものである。演算装置200は、十進演算器70を内蔵したUSB(Universal Serial Bus)接続可能な小型機器であり、端子U1をPC100のUSBポートU2に差し込むことで相互にデータ通信可能となる。
FIG. 14 shows an arithmetic system S composed of the
1 グラフ関数電卓
3 キー群
3a 数字キー群
3b 方向キー
3c EXEキー
3d 桁落ち桁数表示キー
3e 有効精度桁数表示キー
3f 桁数増加表示キー
3g 桁落ち部分識別表示キー
4 ディスプレイ
20 CPU
30 入力部
40 表示部
50 ROM
511 第1演算表示プログラム
531 第2演算表示プログラム
60 RAM
611、631 演算桁数格納領域
613、633 演算種類格納領域
615、635 被演算子格納領域
617、637 桁落ち桁数格納領域
619 有効精度桁数格納領域
70 十進演算器
710 プログラムROM
712 プログラムカウンタ
714 ラッチ部
716 命令デコーダ
720 可変パラメータ記憶部
731〜734 セレクタ
740 アドレスカウンタ
750 アドレス制御回路
760 レジスタ部
770 演算器
780 シフタ
80 バス
DESCRIPTION OF
30
511 First
611, 631 Operation digit
712
Claims (2)
演算の種類をユーザー操作に従って指定する演算種類指定手段と、
この演算種類指定手段により指定された種類の演算を、前記演算桁数入力手段により入力された演算桁数で実行する演算実行手段と、
前記演算桁数入力手段により入力された演算桁数に所定の追加桁数を追加した追加演算桁数で演算を再実行する追加演算実行手段と、
この追加演算実行手段による演算結果の各桁の値と前記演算実行手段による演算結果の各桁の値とを比較し、値が一致しない桁の数を桁落ち桁数として検出する桁落ち桁数検出手段と、
前記桁落ち桁数検出手段により検出された桁落ち桁数と前記演算桁数入力手段により入力された演算桁数との和が、前記追加演算実行手段により演算された追加演算桁数以下である場合に、前記追加演算実行手段による演算結果を、前記演算桁数に丸めて表示する制御を行う表示制御手段と、
を備えることを特徴とする演算制御装置。 Calculation digit number input means for inputting the calculation digit number according to the user operation;
A calculation type specifying means for specifying a calculation type according to a user operation;
An operation executing means for executing the operation of the type specified by the operation type specifying means with the operation digit number input by the operation digit number input means;
An additional calculation execution means for re-executing the calculation with an additional calculation digit number obtained by adding a predetermined additional digit number to the calculation digit number input by the calculation digit number input means;
Compare the value of each digit of the calculation result by this additional calculation execution means with the value of each digit of the calculation result by the calculation execution means, and detect the number of digits that do not match as the number of digits to be discarded Detection means;
The sum of the number of digits discarded by the digit number detection means and the number of digits calculated by the calculation digit number input means is equal to or less than the number of additional calculation digits calculated by the additional calculation execution means. Display control means for performing control to display the calculation result by the additional calculation execution means by rounding to the number of calculation digits ;
An arithmetic and control unit comprising:
演算桁数をユーザー操作に従って入力する演算桁数入力手段と、
演算の種類をユーザー操作に従って指定する演算種類指定手段と、
この演算種類指定手段により指定された種類の演算を、前記演算桁数入力手段により入力された演算桁数で実行する演算実行手段と、
前記演算桁数入力手段により入力された演算桁数に所定の追加桁数を追加した追加演算桁数で演算を再実行する追加演算実行手段と、
この追加演算実行手段による演算結果の各桁の値と前記演算実行手段による演算結果の各桁の値とを比較し、値が一致しない桁の数を桁落ち桁数として検出する桁落ち桁数検出手段と、
前記桁落ち桁数検出手段により検出された桁落ち桁数と前記演算桁数入力手段により入力された演算桁数との和が、前記追加演算実行手段により演算された追加演算桁数以下である場合に、前記追加演算実行手段による演算結果を、前記演算桁数に丸めて表示する制御を行う表示制御手段と、
を実現させるためのプログラム。 On the computer,
Calculation digit number input means for inputting the calculation digit number according to the user operation;
A calculation type specifying means for specifying a calculation type according to a user operation;
An operation executing means for executing the operation of the type specified by the operation type specifying means with the operation digit number input by the operation digit number input means;
An additional calculation execution means for re-executing the calculation with an additional calculation digit number obtained by adding a predetermined additional digit number to the calculation digit number input by the calculation digit number input means;
Compare the value of each digit of the calculation result by this additional calculation execution means with the value of each digit of the calculation result by the calculation execution means, and detect the number of digits that do not match as the number of digits to be discarded Detection means;
The sum of the number of digits discarded by the digit number detection means and the number of digits calculated by the calculation digit number input means is equal to or less than the number of additional calculation digits calculated by the additional calculation execution means. Display control means for performing control to display the calculation result by the additional calculation execution means by rounding to the number of calculation digits ;
A program to realize
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004250678A JP4193773B2 (en) | 2004-08-30 | 2004-08-30 | Arithmetic control device and program |
US11/109,888 US7716267B2 (en) | 2004-08-30 | 2005-04-19 | Decimal computing apparatus, electronic device connectable decimal computing apparatus, arithmetic operation apparatus, arithmetic operation control apparatus, and program-recorded recording medium |
US12/428,288 US8316067B2 (en) | 2004-08-30 | 2009-04-22 | Decimal computing apparatus, electronic device connectable decimal computing apparatus, arithmetic operation apparatus, arithmetic operation control apparatus, and program-recorded recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004250678A JP4193773B2 (en) | 2004-08-30 | 2004-08-30 | Arithmetic control device and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006065789A JP2006065789A (en) | 2006-03-09 |
JP4193773B2 true JP4193773B2 (en) | 2008-12-10 |
Family
ID=36112197
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004250678A Active JP4193773B2 (en) | 2004-08-30 | 2004-08-30 | Arithmetic control device and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4193773B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4997812B2 (en) * | 2006-03-31 | 2012-08-08 | カシオ計算機株式会社 | Calculation apparatus and calculation program |
-
2004
- 2004-08-30 JP JP2004250678A patent/JP4193773B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2006065789A (en) | 2006-03-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH06202850A (en) | Data processor | |
JP5012935B2 (en) | Formula arithmetic device and program | |
US7995063B2 (en) | Figure rendering apparatus and figure rendering method | |
JP4193773B2 (en) | Arithmetic control device and program | |
JP4997812B2 (en) | Calculation apparatus and calculation program | |
US4507743A (en) | Calculation system utilizing definable keys | |
JP2009059256A (en) | Electronic device capable of drawing graph, and program | |
USRE46215E1 (en) | Computing machine with an inequality computation function | |
US8316067B2 (en) | Decimal computing apparatus, electronic device connectable decimal computing apparatus, arithmetic operation apparatus, arithmetic operation control apparatus, and program-recorded recording medium | |
JP6504128B2 (en) | Electronic device, data processing method and program | |
US9921999B2 (en) | Electronic device, display method at time of execution of verification with electronic device, and storage medium | |
JP4893340B2 (en) | Calculation apparatus and calculation program | |
CA1173164A (en) | Fraction calculator | |
JP4192868B2 (en) | Scientific calculator | |
JP5315712B2 (en) | Electronic device having arithmetic function and arithmetic processing program | |
JPS6225213B2 (en) | ||
JPH021627Y2 (en) | ||
JPH0616278B2 (en) | Calculation mode setting device for desktop computer | |
JP2700960B2 (en) | Electronic desk calculator | |
US6628293B2 (en) | Format varying computer system | |
JPS61275960A (en) | Electronic calculator with graphic display function | |
JPS6225208B2 (en) | ||
JPS5921068B2 (en) | Program step calculation method | |
JPH0335345A (en) | Compact electronic computer | |
JPH0420498B2 (en) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20070615 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080528 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080617 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080806 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20080902 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20080915 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4193773 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111003 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121003 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121003 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131003 Year of fee payment: 5 |