JPH0241060B2 - PUROGURAMUTSUKIKOGATADENSHIKEISANKI - Google Patents
PUROGURAMUTSUKIKOGATADENSHIKEISANKIInfo
- Publication number
- JPH0241060B2 JPH0241060B2 JP7095681A JP7095681A JPH0241060B2 JP H0241060 B2 JPH0241060 B2 JP H0241060B2 JP 7095681 A JP7095681 A JP 7095681A JP 7095681 A JP7095681 A JP 7095681A JP H0241060 B2 JPH0241060 B2 JP H0241060B2
- Authority
- JP
- Japan
- Prior art keywords
- memory
- data
- cpu
- signal
- ans
- 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.)
- Expired - Lifetime
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/02—Digital computers in general; Data processing equipment in general manually operated with input through keyboard and computation using a built-in program, e.g. pocket calculators
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Calculators And Similar Devices (AREA)
- Digital Computer Display Output (AREA)
Description
【発明の詳細な説明】
この発明はマニユアル計算が可能なプログラム
付小型電子計算機において、演算結果が負であ
り、その結果を使つて計算式を入力した際に自動
的にその負データを括弧でくくるようにしたプロ
グラム付小型電子計算機に関する。[Detailed Description of the Invention] This invention provides a small electronic computer with a program that can perform manual calculations, and when the calculation result is negative and a calculation formula is input using the result, the negative data is automatically placed in parentheses. This invention relates to a small electronic computer with a program that can be wrapped around the computer.
近年、BASIC言語等を使用できる小型電子計
算機が実用化されているが、この種計算機では、
プログラム計算だけでなくマニユアル計算を実行
することができる。例えば、
2×3+SIN(30)EXE
の如きキー入力を行なえば計算結果「6.5」が得
られる。そして更に、得られた結果を使つて計算
式を続けることができる。例えば、上述の結果
「6.5」を表示しているときに、
6.5×π×√3EXE
の如くである。しかしながら、このような計算機
にあつては、演算結果が負数の場合、計算の種類
によつては符号が反転してしまうという欠点があ
つた。今、例えば演算結果が「−2」であつたと
すると、
−2↑2(↑はべき乗を表わす)
のような演算をした場合、その演算結果が「−
4」となり、誤つた結果となつてしまう訳であ
る。 In recent years, small electronic computers that can use BASIC languages have been put into practical use.
You can perform not only program calculations but also manual calculations. For example, if you input a key such as 2×3+SIN(30)EXE, you will get the calculation result "6.5". Furthermore, the calculation formula can be continued using the obtained result. For example, when the above result "6.5" is displayed, it is 6.5×π×√3EXE. However, such a computer has a drawback that, depending on the type of calculation, when the calculation result is a negative number, the sign may be reversed. Now, for example, if the result of the operation is "-2", if you perform an operation like -2↑2 (↑ represents a power), the result of the operation will be "-2".
4", which would lead to incorrect results.
この発明は上記の点に鑑みてなされたもので、
その目的はマニユアル計算可能なプログラム付計
算機において、演算結果が負の場合にはその数値
をカツコでくくるようにした演算結果出力を行な
うプログラム付小型電子計算機を提供することに
ある。 This invention was made in view of the above points,
The object of the present invention is to provide a small-sized electronic computer with a program that can perform manual calculations and outputs the result of calculation by enclosing the numerical value in brackets when the result of calculation is negative.
以下、図面を参照してこの発明の一実施例を説
明する。第1図は統計演算機能及びBASIC言語
によるプログラム演算機能を備えた小型電子計算
機の全体のブロツク図である。図において、11
はキーボードで置数キー、各種機能キー等を備え
ている。上記各種機能キーのうちには統計用デー
タを入力する「STAT」キー、一度入力した統
計用データを削除する「DEL」キー、動作を停
止する「STOP」キー、動作を継続する
「CONT」キー、演算の実行を開始する「EXE」
キー等が含まれている。このキーボード11と
CPU(中央処理装置)12とはバスラインで接続
されており、CPU12からはキーサンプリング
信号が入力される。そして、上記キーボード11
からはキー操作信号が上CPU12に入力される。
該CPU12の詳細な構成については後述する。
また、CPU12にはプリンタ13、表示ドライ
バ14がそれぞれ接続されている。この表示ドラ
イバ14には例えば液晶によりドツト表示を行な
う表示装置15が接続されており、前記CPU1
2から送られてくる表示データに応じて液晶を駆
動する駆動信号を上記表示装置15に送出してい
る。さらにまた、CPU12にはANSメモリ16、
ANS符号判定回路17、SD.LR判定回路18、
TX.TYレジスタを備えたメモリ19、配列判定
回路20、データメモリ21、文字メモリ22、
プログラムメモリ23、統計データ制御部24、
WAITメモリ25がそれぞれ接続されている。
上記ANSメモリ16はプログラムメモリ23に
記憶されているプログラムが実行され、そのプロ
グラム中のプリント命令(表示命令)によつてプ
リンタ13あるいは表示装置15に出力された数
値データが一時保持されるメモリでCPU12か
ら送出される読出し/書込み信号R/Wによりデ
ータの読出し、書込みが制御される。また、上記
ANSメモリ16は保持された数値データが負数
であるか否かを示すフラグ領域を有しており、数
値データが負数の場合には信号ラインaを介して
“1”信号がANS符号判定回路17に送出され
る。このANS符号判定回路17には前記CPU1
2から送られる判定要求信号bが入力される。さ
らに、ANS符号判定回路17は上記判定要求信
号bに応じて前記ANSメモリ16に保持される
数値データが負数であるか否かを示す判定信号c
をCPU12に送出する。また、ANS符号判定回
路17には内部のフリツプフロツプ(図示せず)
にセツト信号d、リセツト信号eがCPU12よ
り入力される。そして、このANS符号判定回路
17からは上記フリツプフロツプのQ出力が信号
fとして前記CPU12に送出される。また、上
記SD.LR判定回路18には前記CPU12からキ
ー入力データが入力され、キーボード11から入
力されたデータが単一入力の統計データか2入力
の統計データか否か判定される。この判定はキー
ボード11上の「STAT」キーを操作して統計
データを入力する場合、xデータとyデータとの
間にキー操作される「,」コードを検出して入力
された統計データが単一入力の統計データが2入
力の統計データを検出するものである。このSD.
LR判定回路18は「,」コードを検出すると検出
信号gを前記CPU12に送出する。また、前記
CPU12からSD.LR判定回路18にリセツト信
号hが入力される。さらに、SD.LR判定回路1
8からメモリ19には統計データが送られるもの
で、TXレジスタにはxデータがTYレジスタに
はyデータが記憶される。上記配列判定回路20
はプログラムメモリ23に記憶されるプログラム
の変数の次元を判定するもので、変数の次元を示
す信号iは前記CPU12に送出される。次に、
上記データメモリ21は変数データあるいは1次
元あるいは2次元の配列データが記憶される。 Hereinafter, one embodiment of the present invention will be described with reference to the drawings. FIG. 1 is an overall block diagram of a small electronic computer equipped with statistical calculation functions and program calculation functions written in BASIC language. In the figure, 11
is a keyboard with numeric keys and various function keys. Among the various function keys listed above, the ``STAT'' key is used to input statistical data, the ``DEL'' key is used to delete statistical data once input, the ``STOP'' key is used to stop operation, and the ``CONT'' key is used to continue operation. , "EXE" to start executing the operation
Contains keys etc. This keyboard 11
It is connected to a CPU (central processing unit) 12 via a bus line, and a key sampling signal is input from the CPU 12. And the above keyboard 11
From there, key operation signals are input to the upper CPU 12.
The detailed configuration of the CPU 12 will be described later.
Further, a printer 13 and a display driver 14 are connected to the CPU 12, respectively. A display device 15 that displays dots using a liquid crystal, for example, is connected to the display driver 14, and the CPU 1
A drive signal for driving the liquid crystal is sent to the display device 15 according to the display data sent from the display device 2. Furthermore, the CPU 12 has ANS memory 16,
ANS code determination circuit 17, SD.LR determination circuit 18,
A memory 19 equipped with a TX.TY register, an array determination circuit 20, a data memory 21, a character memory 22,
program memory 23, statistical data control unit 24,
A WAIT memory 25 is connected to each.
The ANS memory 16 is a memory in which the program stored in the program memory 23 is executed and numerical data output to the printer 13 or display device 15 according to the print command (display command) in the program is temporarily held. Reading and writing of data is controlled by a read/write signal R/W sent from the CPU 12. Also, above
The ANS memory 16 has a flag area indicating whether or not the held numerical data is a negative number, and when the numerical data is a negative number, a “1” signal is sent to the ANS sign determination circuit 17 via the signal line a. will be sent to. This ANS code determination circuit 17 includes the CPU 1
A judgment request signal b sent from 2 is input. Further, in response to the determination request signal b, the ANS sign determination circuit 17 sends a determination signal c indicating whether or not the numerical data held in the ANS memory 16 is a negative number.
is sent to the CPU 12. The ANS code determination circuit 17 also includes an internal flip-flop (not shown).
A set signal d and a reset signal e are input from the CPU 12. From this ANS code determination circuit 17, the Q output of the flip-flop is sent to the CPU 12 as a signal f. Key input data is input from the CPU 12 to the SD.LR determination circuit 18, and it is determined whether the data input from the keyboard 11 is single-input statistical data or two-input statistical data. This determination is made when inputting statistical data by operating the "STAT" key on the keyboard 11, detecting the "," code keyed between x data and y data, and indicating that the input statistical data is simple. One input of statistical data detects two inputs of statistical data. This SD.
When the LR determination circuit 18 detects the "," code, it sends a detection signal g to the CPU 12. Also, the above
A reset signal h is input from the CPU 12 to the SD.LR determination circuit 18. Furthermore, SD.LR judgment circuit 1
Statistical data is sent from 8 to memory 19, with x data stored in the TX register and y data stored in the TY register. The above arrangement determination circuit 20
is for determining the dimensions of variables of the program stored in the program memory 23, and a signal i indicating the dimensions of the variables is sent to the CPU 12. next,
The data memory 21 stores variable data or one-dimensional or two-dimensional array data.
また、上記文字メモリ22は表示出力するデー
タを記憶しているもので、その記憶できる文字数
は可変である。しかして、上記データメモリ21
に記憶可能な文字変数は各7文字であるが、この
文字メモリ22に記憶可能な文字変数の容量は例
えば30文字となつている。また、上記プログラム
メモリ23はユーザプログラムが記憶されるもの
で、そのユーザプログラムは前記CPU12に送
られて実行される。また、上記統計データ制御部
24は内部に基本統計量を記憶しているメモリを
備えており、このメモリには度数n、x総和、y
縦和、x二乗和、y二乗和、xy積和を記憶して
いる。また、統計データ制御部24内部にはタイ
マを備えており、このタイマは前記CPU12よ
り送出されるスタート信号jにより計時を開始す
るもので、例えば2秒を計時するとエンド信号k
を前記CPU12に送出する。このタイマは上記
基本統計データを順次自動的に表示させるための
ものである。また、上記WAITメモリ25はプ
ログラム実行時に前記表示装置15に表示される
データの表示を一時停止させる時間が設定される
メモリで、前記CPU12から読出し/書込み信
号lが入力されている。また、上記WAITメモ
リ25に設定されるWAIT時間はWAIT制御部
26に送出される。また、上記WAITメモリ2
5に設定されたWAIT時間が所定時間以上の場
合にはオーバフロー信号mをWAIT制御部26
に出力する。また、前記CPU12において表示
命令(PRINT)が実行されると、信号nが上記
WAIT制御部26に入力される。そして、この
WAIT制御部26は上記WAIT時間が経過する
とRESTART信号を上記CPU12に出力する。
また、前記プリンタ13はプリンタがON状態の
時にgを上記WAIT制御部26に出力する。 The character memory 22 stores data to be displayed and output, and the number of characters that can be stored is variable. However, the data memory 21
The character variables that can be stored in the character memory 22 are each seven characters, but the capacity of the character variables that can be stored in the character memory 22 is, for example, 30 characters. Further, the program memory 23 stores a user program, and the user program is sent to the CPU 12 and executed. Further, the statistical data control section 24 is provided with a memory that stores basic statistics, and this memory stores the frequency n, x total, y
It stores the vertical sum, x-squared sum, y-squared sum, and xy-product sum. Further, the statistical data control section 24 is provided with a timer, and this timer starts measuring time in response to a start signal j sent from the CPU 12. For example, when 2 seconds are counted, an end signal k is generated.
is sent to the CPU 12. This timer is for automatically displaying the basic statistical data in sequence. Further, the WAIT memory 25 is a memory in which a time for temporarily stopping the display of data displayed on the display device 15 during program execution is set, and a read/write signal l is input from the CPU 12. Further, the WAIT time set in the WAIT memory 25 is sent to the WAIT control section 26. In addition, the above WAIT memory 2
If the WAIT time set to 5 is longer than the predetermined time, the overflow signal m is sent to the WAIT control unit 26.
Output to. Furthermore, when the display command (PRINT) is executed in the CPU 12, the signal n is
It is input to the WAIT control section 26. And this
The WAIT control unit 26 outputs a RESTART signal to the CPU 12 when the WAIT time has elapsed.
Further, the printer 13 outputs g to the WAIT control section 26 when the printer is in the ON state.
第2図は第1図におけるCPU12の詳細な構
成を示すものある。図において、31は各種マイ
クロプログラムが記憶されているROM(リー
ド・オンリ・メモリ)で、このマイクロプログラ
ムは制御部32に送られてその命令が解読され
る。この制御部32はシステム全体の制御を行う
もので、各種制御命令、アドレス指定信号、チツ
プ指定信号等を出力する。制御部32と演算部3
3間には演算データ及び演算制御信号が送受さ
れ、各種演算が実行される。また、この制御部3
2には前記WAIT制御部26からRESTART信
号が入力される。このRESTART信号は停止し
ているCPU12の動作を再開させる信号である。
34はX,Y,Z,A〜Eレジスタを備えた内部
メモリで、演算データ、表示データ、置数データ
等を保持し、上記制御部32とデータ及びアドレ
ス情報から送受される。また、制御部32にはキ
ー制御部35、印字制御部36、表示制御部3
7、メモリ制御部38がそれぞれ接続される。上
記キー制御部35はキーボード11と接続され、
キーサプリング信号を送出し、キー操作信号が入
力される。また、上記印字制御部36はプリンタ
13と接続され、印字動作を制御する回路であ
る。上記表示制御部37に表示ドライバ14と接
続され、前記メモリ内の表示用Xレジスタの内容
が送られてくるもので、この表示制御部37は入
力される表示データをコード変換して表示ドライ
バ14に送出する。また、メモリ制御部38は
ANSメモリ16、データメモリ21、プログラ
ムメモリ23等のアドレス指定とデータの送受を
行なう回路である。 FIG. 2 shows a detailed configuration of the CPU 12 in FIG. 1. In the figure, numeral 31 is a ROM (read-only memory) in which various microprograms are stored, and this microprogram is sent to a control section 32 where its instructions are decoded. This control section 32 controls the entire system, and outputs various control commands, address designation signals, chip designation signals, etc. Control unit 32 and calculation unit 3
Arithmetic data and arithmetic control signals are transmitted and received between the three, and various arithmetic operations are executed. In addition, this control section 3
2 receives the RESTART signal from the WAIT control section 26. This RESTART signal is a signal for restarting the stopped operation of the CPU 12.
34 is an internal memory equipped with X, Y, Z, A to E registers, which holds calculation data, display data, set number data, etc., and is sent to and received from the control section 32 and the data and address information. The control unit 32 also includes a key control unit 35, a print control unit 36, and a display control unit 3.
7. A memory control unit 38 is connected to each. The key control unit 35 is connected to the keyboard 11,
A key sampling signal is sent and a key operation signal is input. Further, the printing control section 36 is a circuit that is connected to the printer 13 and controls printing operations. The display control unit 37 is connected to the display driver 14 and receives the contents of the display X register in the memory.The display control unit 37 converts the input display data into codes and sends them to the display driver 14. Send to. In addition, the memory control unit 38
This circuit specifies addresses of the ANS memory 16, data memory 21, program memory 23, etc. and sends and receives data.
ここで、システム全体の動作の概略を説明す
る。キーボード11から入力されたプログラム
は、CPU12を介してプログラムメモリ23に
書込まれる。この際、変数エリアはデータメモリ
21内に確保される。しかして、変数には単なる
数値変数、1次元配列、2次元配列がありそれぞ
れデータメモリ21の使い方が異なるので、配列
判定回路20によつて定義された配列を判定す
る。この判定結果を利用することによつて、2次
元配列の形で書込んだデータを1次元配列で読出
すことも可能となる。また、変数はA〜Z、AO
〜Z9及び$を文字変数として使用でき、各々最
大7文字であるが、$について最大30文字まで割
当てることができ、その変数は文字メモリ22に
記憶される。 Here, an outline of the operation of the entire system will be explained. A program input from the keyboard 11 is written into the program memory 23 via the CPU 12. At this time, a variable area is secured within the data memory 21. Since the variables include simple numerical variables, one-dimensional arrays, and two-dimensional arrays, and the usage of the data memory 21 is different for each variable, the array determining circuit 20 determines the defined array. By using this determination result, data written in a two-dimensional array can also be read out in a one-dimensional array. Also, the variables are A~Z, AO
~Z9 and $ can be used as character variables, up to 7 characters each, but up to 30 characters can be assigned for $, and the variables are stored in character memory 22.
次に、プログラム実行の際あるいはマニユアル
計算実行の際は、プログラムメモリ23及びデー
タメモリ21から読出されたデータ、あるいはキ
ーボード11から入力されたデータがCPU12
において演算されるが、演算結果は次の演算結果
が得られるまでANSメモリ16に一時保持され
る。この保持された演算結果の符号はANS符号
判定回路17によつて判定され、結果が負であり
その結果に続けて計算式が入力された場合には、
自動的にその負の数値を括弧で括つて表示する機
能を備えている。また、WAIT命令を実行した
際には、WAIT命令に付加されているコードを
WAITメモリ25に書込み、表示命令(PRINT
命令)を実行した際にWAIT制御部26が動作
して上記コードに対応する時間だけ表示を保持す
る。 Next, when executing a program or performing manual calculation, data read from the program memory 23 and data memory 21 or data input from the keyboard 11 is sent to the CPU 12.
The calculation result is temporarily held in the ANS memory 16 until the next calculation result is obtained. The sign of this retained calculation result is determined by the ANS sign determination circuit 17, and if the result is negative and a calculation formula is input following that result,
It has a function that automatically displays negative numbers in parentheses. Also, when executing the WAIT instruction, the code added to the WAIT instruction is
Write to WAIT memory 25 and display command (PRINT
When the command) is executed, the WAIT control unit 26 operates and holds the display for a period of time corresponding to the above code.
一方、統計演算を行なう際にはデータxiのみ、
あるいはデータxiとデータyiをキーボード11か
ら入力すると、メモリ19に一時保持された後、
統計データ制御部24に書込まれるが、1次デー
タが入力されたか2次データが入力されたかを
SD.LR判定回路18が自動判別する。そして、
データxのみの表示かデータx及びyの両方を表
示かの制御と、データ追加かデータ削除かの区別
表示の制御を行なう。また、統計データ制御部2
4内に基本統計データとして度数、データxの総
和、データyの総和、データxの二乗和、データ
yの二乗和、データxとyの積和を記憶している
が、これらの各データを自動的に順番に表示して
いく機能を備えている。 On the other hand, when performing statistical calculations, only the data x i ,
Alternatively, when data x i and data y i are input from the keyboard 11, they are temporarily stored in the memory 19 and then
It is written to the statistical data control unit 24, but it does not indicate whether primary data or secondary data has been input.
The SD.LR determination circuit 18 automatically determines. and,
It controls whether only data x or both data x and y are displayed, and whether data is added or deleted. In addition, the statistical data control unit 2
4 stores basic statistical data such as frequency, total sum of data x, total sum of data y, sum of squares of data x, sum of squares of data y, and sum of products of data x and y. It has a function that automatically displays them in order.
第3図は第1図におけるANSメモリ16及び
ANS符号判定回路17の詳細な構成を示す図で
ある。図において、16はANSメモリで、CPU
12より読出し/書込み信号R/Wが入力され
る。このANSメモリ16の最下位桁はフラグ領
域として用いられるもので、このANSメモリ1
6に負数データが記憶されると、信号ラインaを
介して“1”信号をフリツプフロツプ41のD端
子に出力する。このフリツプフロツプ41のクロ
ツク端子cpにはCPU12から判定要求信号bが
入力される。また、このフリツプフロツプ41の
Q出力は判定信号cをCPU12に送出する。こ
のANS符号判定回路17には他にフリツプフロ
ツプ42を有しており、ANSフラグとして用い
られる。このフリツプフロツプ42にはCPU1
2からセツト信号d、リセツト信号eが入力され
ており、そのQ出力は信号fとして上記CPU1
2に送出される。 Figure 3 shows the ANS memory 16 and
2 is a diagram showing a detailed configuration of an ANS code determination circuit 17. FIG. In the figure, 16 is ANS memory and CPU
A read/write signal R/W is input from 12. The lowest digit of this ANS memory 16 is used as a flag area, and this ANS memory 1
When negative data is stored in the flip-flop 41, a "1" signal is output to the D terminal of the flip-flop 41 via the signal line a. A determination request signal b is inputted from the CPU 12 to the clock terminal cp of the flip-flop 41. Further, the Q output of the flip-flop 41 sends a judgment signal c to the CPU 12. This ANS code determination circuit 17 also has a flip-flop 42, which is used as an ANS flag. This flip-flop 42 has a CPU 1
A set signal d and a reset signal e are input from the CPU 2, and its Q output is sent to the CPU 1 as a signal f.
2 is sent out.
次に、上記のように構成された小型電子計算機
におけるこの発明の動作を第4図及び第5図を参
照して説明する。今、例えば“1―6”の計算を
するには、キーボード11より「1」「−」「6」
「EXE」を順次キー入力する。すると被演算数
「1」、演算数「6」がCPU12に送られ、内部
メモリ34と演算部33によつて演算が行なわれ
る。そして、その演算結果「−5」はCPU12
内のXレジスタに記憶される。その後ステツプS1
において上記Xレジスタに記憶された演算結果
「−5」は表示制御部37を介して表示ドライバ
14に送られ表示装置15に第5図Aに示すよう
に表示される。また、CPU12からANSメモリ
16に書込み信号Wが出力されて上記Xレジスタ
に記憶されている演算結果「−5」がANSメモ
リ16に記憶される。次に、ステツプS2に進み、
CPU12からセツト信号dがフリツプフロツプ
42に出力され、フリツプフロツプ42がセツト
されてANSフラグがセツトされる。ここまでの
動作は通常のマニユアル計算であり、得られた
「−5」を用いて更に計算式を入力する場合、例
えば
−5↑2
という計算式を入力したい場合には、キーボード
11から□↑,□2と続けて入力する。ここでまず□↑
キーを入力する(ステツプS3)とステツプS4に進
みCPU12は上記フリツプフロツプ42からの
信号fを読取つてその内容を判定する。この例で
はフリツプフロツプ42はセツトされているた
め、「YES」と判定されてステツプS5に進む。こ
のステツプS5において上記ステツプS3で入力され
た入力データが演算キーであるか否かが判定され
る。この場合は□↑キーが操作されており、
「YES」と判定されてステツプS6に進む。しかし
て、上記ステツプS5において「NO」と判定され
た場合にはステツプS7に進みCPU12からフリ
ツプフロツプ42に対してリセツト信号が出力さ
れ、ANSフラグがリセツトされる。その後、上
記ステツプS4で「NO」と判定された場合と同様
に他の処理に移る。しかして、ステツプS6に進み
CPU12は判定要求信号bをフリツプフロツプ
41に出力する。ところで、上記ANSメモリ1
6には負数データが記憶されているためフリツプ
フロツプ41のD端子には、“1”信号が入力さ
れている。このため、ステツプS8に進み上記判定
要求信号bにより判定信号cとして“1”信号が
CPU12に送出される。そして、上記判定信号
cに基づき、上記ANSメモリ16に記憶されて
いる数値データが負数か否か判定される。この場
合は数値データは負であるため「YES」と判定
されてステツプS10に進む。このステツプS10にお
いて制御部32からXレジスタに“(”(開き括
弧)が出力される。次に、ステツプS11に進み
ANSメモリ16に読出し信号Rが出力されて
ANSメモリ16の内容がXレジスタに読み出さ
れる。そして、ステツプS12に進み再度ANSメモ
リ16に記憶されている数値データが負数か否か
判定される。この場合「YES」と判定され制御
部32からXレジスタに“)”(閉じ括弧)が出力
される。そして、ステツプS14に進みCPU12か
らリセツト信号dがフリツプフロツプ42に出力
されてANSフラグがリセツトされる。この結果、
□↑キー操作後には第5図Bに示すように表示され
る。次に、ステツプS3に戻りキー処理が行なわれ
る。そして、「2」キーを操作するとそのコード
信号はCPU12内のXレジスタに読み込まれる。
そして、ステツプS4に進みフリツプフロツプ42
がセツトされているか否か判定される。この場
合、ANSフラグはリセツトされているため
「NO」と判定されて他の処理に移る。次に、
「EXE」キーを操作すると(−5)2の演算が演算
部33に送られてその演算が行なわれ、その演算
結果がXレジスタに記憶される。従つて、第5図
Dに示すように表示される。 Next, the operation of the present invention in the small computer configured as described above will be explained with reference to FIGS. 4 and 5. Now, for example, to calculate “1-6”, use the keyboard 11 to press “1”, “-”, and “6”.
Enter "EXE" in sequence. Then, the operand "1" and the operand "6" are sent to the CPU 12, and the internal memory 34 and the calculation unit 33 perform the calculation. Then, the calculation result "-5" is CPU12
It is stored in the X register within. Then step S 1
The calculation result "-5" stored in the X register is sent to the display driver 14 via the display control section 37 and displayed on the display device 15 as shown in FIG. 5A. Further, a write signal W is outputted from the CPU 12 to the ANS memory 16, and the calculation result "-5" stored in the X register is stored in the ANS memory 16. Next, proceed to step S2 ,
A set signal d is output from the CPU 12 to the flip-flop 42, and the flip-flop 42 is set to set the ANS flag. The operation up to this point is a normal manual calculation, and if you want to input another calculation formula using the obtained "-5", for example, if you want to input the calculation formula -5↑2, use the keyboard 11 to input □↑ , □2. First here□↑
When the key is input (step S3 ), the process proceeds to step S4 , where the CPU 12 reads the signal f from the flip-flop 42 and determines its contents. In this example, since the flip-flop 42 is set, the determination is ``YES'' and the process advances to step S5 . In step S5 , it is determined whether the input data input in step S3 is a calculation key. In this case, the □↑ keys are being operated,
If the determination is "YES", proceed to step S6 . If the determination in step S5 is "NO", the process proceeds to step S7 , where the CPU 12 outputs a reset signal to the flip-flop 42, and the ANS flag is reset. Thereafter, the process moves to other processing as in the case where the determination in step S4 is "NO". Then proceed to step S6 .
The CPU 12 outputs the determination request signal b to the flip-flop 41. By the way, the above ANS memory 1
Since negative data is stored in the flip-flop 41, a "1" signal is input to the D terminal of the flip-flop 41. Therefore, the process proceeds to step S8 , and a "1" signal is output as the determination signal c due to the determination request signal b.
It is sent to the CPU 12. Then, based on the determination signal c, it is determined whether the numerical data stored in the ANS memory 16 is a negative number. In this case, since the numerical data is negative, the determination is ``YES'' and the process proceeds to step S10 . In this step S10 , "(" (open parenthesis) is output from the control unit 32 to the X register.Next, the process proceeds to step S11 .
The read signal R is output to the ANS memory 16.
The contents of ANS memory 16 are read into the X register. Then, the process proceeds to step S12 , and it is again determined whether the numerical data stored in the ANS memory 16 is a negative number. In this case, the determination is "YES", and the control unit 32 outputs ")" (close parenthesis) to the X register. Then, the process proceeds to step S14 , where the reset signal d is output from the CPU 12 to the flip-flop 42, and the ANS flag is reset. As a result,
After pressing the □↑ key, the screen shown in FIG. 5B is displayed. Next, the process returns to step S3 and key processing is performed. Then, when the "2" key is operated, the code signal is read into the X register in the CPU 12.
Then, proceed to step S4 and flip-flop 42
It is determined whether or not it is set. In this case, since the ANS flag has been reset, the determination is "NO" and the process moves on to other processing. next,
When the "EXE" key is operated, the calculation of (-5) 2 is sent to the calculation section 33, the calculation is performed, and the calculation result is stored in the X register. Therefore, the screen is displayed as shown in FIG. 5D.
しかして、演算結果が正数の場合にはステツプ
S9及びS12において「NO」と判定されるため、
括弧は付加されない。 Therefore, if the operation result is a positive number, the step
Since the determination is “NO” in S 9 and S 12 ,
No parentheses are added.
なお、上記実施例では演算結果の表示例につい
て説明したが、印字についても適用することがで
きる。印字の際は、例えば第5図Aの演算結果が
得られた後□↑,□2,EXEと操作すると、「−
5」と印字した次の行に“(−5)↑2”、更に次
の行に“25”と印字すれば良い。 In the above embodiment, an example of displaying calculation results has been described, but the present invention can also be applied to printing. When printing, for example, after obtaining the calculation result in Figure 5A, operate □↑, □2, EXE, and you will see "-
Just print "(-5)↑2" on the next line after printing "5", and then print "25" on the next line.
以上詳述したようにこの発明によればマニユア
ル計算可能なプログラム付計算機において、演算
結果が負の場合に、負の演算結果を括弧で括るよ
うにしたので、演算結果の正負にかかわらずその
数値自体(符号を含めた)を用いた演算を行なう
ことができ、誤つた答を得ることがない。また、
演算結果が印字された場合、印字リストが見やす
いという効果を奏するものである。 As detailed above, according to the present invention, in a computer with a program that can perform manual calculations, when the calculation result is negative, the negative calculation result is enclosed in parentheses. It is possible to perform calculations using itself (including the sign) without getting an incorrect answer. Also,
When the calculation results are printed, the print list is easy to see.
図面はこの発明の一実施例を示すもので、第1
図は小型電子計算機の全体のブロツク図、第2図
は第1図におけるCPUの詳細な構成を示す図、
第3図は第1図におけるANSメモリ及びANS符
号判定回路の詳細な構成を示す図、第4図は動作
を示すフローチヤート、第5図AないしDは表示
状態を示す図である。
11…キーボード、12…CPU、16…ANS
メモリ、17…ANS符号判定回路、41,42
…フリツプフロツプ。
The drawings show one embodiment of the invention.
The figure is an overall block diagram of a small computer, and Figure 2 is a diagram showing the detailed configuration of the CPU in Figure 1.
FIG. 3 is a diagram showing the detailed configuration of the ANS memory and ANS code determination circuit in FIG. 1, FIG. 4 is a flowchart showing the operation, and FIGS. 5A to 5D are diagrams showing display states. 11...Keyboard, 12...CPU, 16...ANS
Memory, 17...ANS sign determination circuit, 41, 42
…flipflop.
Claims (1)
を入力することのできるプログラム付小型電子計
算機において、演算結果を一時記憶するメモリ
と、このメモリに記憶された演算結果が負数であ
るか否かを検出する負数検出手段と、この負数検
出手段により演算結果が負数であることが検出さ
れた場合に演算結果を括弧で括つて出力する括弧
付加手段とを備えたことを特徴とするプログラム
付小型電子計算機。1. In a small electronic computer with a program that uses the calculation result and can input a calculation formula following the calculation result, there is a memory for temporarily storing the calculation result, and whether or not the calculation result stored in this memory is a negative number. and a parenthesis adding means that encloses the calculation result in parentheses and outputs it when the negative number detection means detects that the calculation result is a negative number. A small electronic computer.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7095681A JPH0241060B2 (en) | 1981-05-12 | 1981-05-12 | PUROGURAMUTSUKIKOGATADENSHIKEISANKI |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7095681A JPH0241060B2 (en) | 1981-05-12 | 1981-05-12 | PUROGURAMUTSUKIKOGATADENSHIKEISANKI |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS57185560A JPS57185560A (en) | 1982-11-15 |
| JPH0241060B2 true JPH0241060B2 (en) | 1990-09-14 |
Family
ID=13446469
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP7095681A Expired - Lifetime JPH0241060B2 (en) | 1981-05-12 | 1981-05-12 | PUROGURAMUTSUKIKOGATADENSHIKEISANKI |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0241060B2 (en) |
-
1981
- 1981-05-12 JP JP7095681A patent/JPH0241060B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS57185560A (en) | 1982-11-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH0241060B2 (en) | PUROGURAMUTSUKIKOGATADENSHIKEISANKI | |
| JPH0516455A (en) | Printer | |
| JPH0241061B2 (en) | TOKEIENZANKINOOSONAETAKOGATADENSHIKEISANKI | |
| JPH0321939B2 (en) | ||
| JPH0327944B2 (en) | ||
| US4447889A (en) | Method for controlling display of output of a programmable device | |
| EP0200222A2 (en) | Word processor with automatic typewriter mode | |
| JPH0245210B2 (en) | PUROGURAMUTSUKIKOGATADENSHIKEISANKI | |
| JPS5938870A (en) | Electronic computer | |
| JPH0616278B2 (en) | Calculation mode setting device for desktop computer | |
| JPH0555248U (en) | Small electronic calculator | |
| JPS6336529B2 (en) | ||
| JPS6227930Y2 (en) | ||
| KR950010489B1 (en) | The method extending debuging orders for electronic exchanger | |
| JPS6148741B2 (en) | ||
| JPH0363103B2 (en) | ||
| JPH03161828A (en) | printer control device | |
| JP2625972B2 (en) | Information processing device | |
| JPH045207B2 (en) | ||
| JPH0610434Y2 (en) | Small electronic calculator | |
| JPS6357821B2 (en) | ||
| JPH0548492B2 (en) | ||
| JPS642180Y2 (en) | ||
| JPH021627Y2 (en) | ||
| JPH0420217B2 (en) |