ELECTRONIC CALCULATOR WITH CONSTANT UTILISATION

Abstract: The electronic computer of the invention comprises a keyboard (15) having numerical keys and others, a read only memory (ROM) (11) to store control programs, a random-access memory (RAM) (16) equipped with registers for operation (161, 162), a CPU (10) to control these devices, wherein a constant register (163) to store constants, an operator storage unit to store operators, and a flag (165) to show whether an operator is positioned before or after a constant are provided in said RAM (16), and a setting key (151) to set the entered constant and operator and a confirmation key (152) to confirm the predetermined constant and operator are provided in said keyboard (15), thereby executing an operation preliminarily set in said RAM (16) after pro­ cessing the desired operation that has been entered.

Description: BACKGROUND OF THE INVENTION This invention relates to an electronic calculator comprising a keyboard having numerical keys and others, a ROM to store control programs, a RAM equipped with registers for operation, and a CPU to control these devices. Generally, in ordinary calculations, we often calculate by using a same constant with a same operator. To compute such calculations by conventional electronic calculators having a function of constant, the operator and the constant were stored e.g. such as "÷ 3". Only e.g. "6 =" was entered in calculation thereafter to perform the operation of "6 ÷ 3 =". In the conventional calculations stated above, however, the sequence of the operator and the constant could not be changed, so that, for example, when "÷ 3" was set and "6 =" was entered, no other calculation could be carried out than the operation of "6 ÷ 3 =". But as a calculation with a constant, such a calculation as to divide a predetermined constant by a certain calculated result, using for instance "3 ÷" as a constant, was often required. It was impossible to operate such a calculation by the conventional calculator as described above. In addition, in the conventional calculator, it was impossible to confirm the predetermined operator or constant. Accordingly, when the user forgets the predetermined contents, wrong results might be obtained by doing other calculation than the desired one without knowing what was stored. It is the object of the present invention to provide an electronic calculator with constant utilization, which calculator has improved operating convenience. The electronic calcuator of the present invention comprises: a storage means (RAM) comprising registers for operating commands and data; a key board having numeral keys and others, including a constant key (151) for storing an entered numerical value and an entered allocated operator, and a start key (=) for starting a calculation based on an entered numerical value and the stored operator and constant; a ROM to store control programms; and a CPU to control these devices; whereby the the calculator is arranged and programmed to execute the following steps: checking, as soon as the constant key is pressed, whether a numerical value was entered before an operator or vice versa; storing information in a flag register indicating the examination result of the just mentioned steps; checking the content of the flag register as soon as the start key is pressed, to execute a calculation based on the just entered numerical value, the constant and the operator either in the sequence "numerical value - operator - constant", when the flag indicates that the operator was entered before the constant, or in the sequence "constant - operator - numerical value", when the operator was entered after the constant. Due to the provision of a flag which indicates, whether a constant was pressed before an operator or vice versa, it is possible to have two different operation modes concerning the way of combining an entered numerical value and an operator and a constant previously stored. In a preferred embodiment, the calculator comprises a confirmation key to display a constant and an operator, as entered previously, in the sequence as it is indicated by the state of the flag. The present invention will become more fully understood from the detailed description given hereinbelow and the accompanying drawings which are given by way of illustration only, and thus are not limitative of the present invention and wherein: Fig. 1 is a block diagram showing the configuration of calculator according to this invention, Fig. 2 is a drawing to show the action of setting a constant and an operator in the same calculator, Fig. 3 is a drawing to show the action of confirming the predetermined constant and operator, Fig. 4 and Fig. 7 are diagrams to show the action of executing a calculation using a constant, Fig. 5 is a flow chart of execution of the function of constant, and Fig. 6 is a diagram showing the printed state of the predetermined constant and operator. Referring now to the drawings, the calculator according to this invention is explained. Fig. 1 is a block diagram of a calculator showing an embodiment of this invention. Numeral 10 is a CPU to execute the processing of the data according to the control program stored in a ROM 11 which is connected through a bus line of the CPU. Numeral 13 is a display which is driven to display by a display control unit 12 connected to the CPU 10. Numeral 14 is a printer, which is connected to the CPU 10, to print by receiving codes from the CPU 10. The ROM 11 comprises a control program storage unit 111 to store the programs to control the function of constant or other systems, and a character pattern generator (CG) 112 to develop dot patterns for output from the code information of characters and symbols generated by the CPU 10. Numeral 15 is a keyboard to send coded signals with regard to the operated key to the CPU 10. The keyboard 15 comprises keys for arithmetic operations, numerical keys and keys for functions. Furthermore, as keys for setting or checking of the function of the constant, a CONST key 151 for setting and a CONFIRM key 152 for confirming the set data are provided. Numeral 16 is a ARM connected to the CPU 10 through a bus line, which composes a working area of this system for control. A B-buffer 166 is a buffer to store the content of the pressed key on the keyboard, and an X-register 161 and a Y-register 162 are the registers for operations. Arithmetic processing is executed by setting desired values for X- and Y-registers 161, 162 respectively and passing a desired program for operation, and the result if returned to the X-register 161. In order to realize the function of constant of this invention, as an area for storing the content, an M-register 163 to store constants, an S-work 164 to store operators such as +, -, /, * and an F-flag 165 to show whether the operator exists before or after the constant are provided in the RAM 16. In the function of constant according to the present invention, a constant and an operator are predetermined separately so as to be stored in the M-register 163 and the S-work 164 respectively. In the case of calculating a constant with regard to the result of the entered operation, the difference whether the operator exists before or after the constant causes such a difference as described below. For example, in the case of setting the constant as when entering an operation , the result 10 of operation 5 x 2 is divided by 100 so as to have the same meaning as 10/100, then the answer becomes 0.1. In contrast, in the case of setting the constant as when entering the same operation , 100 is divided by the result 10 of operation 5 × 2 so as to be the same meaning as 100/10, and the answer becomes thus 10. In this way, whether the operator exists before or after the constant sometimes renders different operation results, and the F-flag is therefore required. The processing in the system constructed as stated above is explained herein. At first, the setting of the function of constant is explained according to the example in Fig. 1. In this case -10 is predetermined as a constant, which is entered by key operation on the keyboard 15. Signals are delivered responding to the key input, which are processed in the CPU 10, and the digitized content is transferred to the B-buffer 166 (21). And when the key 151 on the keyboard is pressed, the CPU 10 receives this signal and examines the content of the B-buffer 166 (22). In the first place, the CPU 10 examines whether the operator exists at the beginning or at the end of the B-buffer and sends the result to the F-flag 165 (23). In the second place, the CPU 10 transfers the operator to the S-work (24). Then it calculates the part excluding the operator from the B-buffer 166, and the result is stored in the X-register 161 (25). Since the content of the X-register 161 becomes a constant, it is transferred to the M-register 163 (26). Besides, the CPU 10 displays a symbol showing that the constant is determined on the display unit 13 through the display control unit 12. This is the procedure for setting the constant. With reference to Fig. 1, the preset values are "10" in the M-register 163, "-" in the S-work 164 and "front" in the F-flag 165. Referring next to Fig. 3, the confirmation of the constant is explained below. In this example shown in Fig. 3, -10 is predetermined as a constant, and when key 152 on the keyboard 15 is pressed, an input signal is delivered. Then the CPU 10 receives the signal to start processing. In the first place, the CPU 10 clears the content of the F-register 155 (32). If the content is "before" as shown in the example, the content of the S-work 164 which is the operator is transferred to the beginning of the B-buffer 166 through the CPU (33). In addition, the content of the M-register 163 which is the constant value is sent after the operator of the B-buffer 166 (34). To the contrary, when the content of the F-register is examined to be "after", the content of the M-register 163 which is the constant value is transferred to the beginning of the B-buffer through the CPU 10, and in sequence, the content of the S-work 164 is sent to the position after the constant in the B-buffer 166. When the value in the B-buffer 166 is arranged in such a way as described above, the content of the B-buffer is first sent to the CPU 10, where the code is decomposed into CG 112 and sent to the display control unit 12, and is displayed in the display unit (35). In the example, -10 is displayed on the display unit. Now, the case of executing the operation with a constant is explained according to the example in Fig. 4; Fig. 5 is a flowchart of executions. In Fig. 4, -10 is preset as a constant, so that the set data are "10" in the M-register 163, "-" in the S-work 164 and "before" in the F-flag (41). At first, a desired value is entered by pressing the keys on the keyboard 15, and a signal is delivered responding to the input from the keyboard 15, which is processed in the CPU 10 and the content is transferred to the B-buffer 166. For instance, when is pressed, 5 + 3 is entered in the B-buffer 166 (42), and when the key on the keyboard is successively pressed, a signal is delivered to the CPU 10, where the content of the B-buffer 166 is calculated and entered in the X-register 161 (43). This step is denoted by S1 in Fig. 5. Then the CPU confirms that the constant is predetermined, and the content of the M-register 163 is sent to the Y-register 162 (44)(S2). The content of the F-register 165 is moreover examined, and if it is "after", the contents in the X-register 161 and the Y-register 162 are exchanged with each other (S3). The CPU 10 then runs the program for operation on the control program 111 of the ROM 11 and its result is entered to the X-register 161 (S4). In Fig. 4, as "-" is stored in the S-work 164, 8 - 10 is here calculated and its result "-2" is entered in the X-register 161 (45). The CPU 10 next decomposes the content of the X-register 161 into CG 112, which is transferred to the display control unit 12 and displayed at the display unit 13. In this example, -2 is displayed (46)(S5), if printing is required, the content of the B-buffer 161 is transferred to the printer 14 through the CPU 10 (S6), and a constant is confirmed to be preset and furthermore the F-flag 165 is examined. When it is found out to be "before" as shown in the example, after transferring a code for spaces to the printer 14, the codes for the operator of the S-work 164 and the constant of the M-register 163 are sent in this order to the printer through the CPU 10. In the example shown in Fig. 4, the spaces are positioned in front as -10. It is for the purpose of making the print legible by indenting to be distinguished from the entered formula. When the F-flag 165 is "after", by contrast, the codes for the constant of the M-register 163 and the S-work 164 are consequently transferred to the printer 14 after the space code in this order (S7). Finally, the operated result of the X-register 161 is sent to the printer through the CPU 10, which ends the processing. In the example, -2 is transferred and an example of the printing in this case is shown in Fig. 6. Likewise, the operation in the case of setting an operator after the constant is explained herein. Fig. 7 shows an example of setting 10- as a constant and processing 5 + 3. Assuming that 10- is set as a constant, the data in the M-register 163 becomes "10", the S-work 164 has "-", and the F-flag 165 has "after", so that the processing is quite the same as that in the case shown in Fig. 4 until the steps S1 and S2 in Fig. 7. At S3, the CPU 10 examines the F-flag 165 to be "after", and then the contents in the X-register 161 and the Y-register are exchanged with each other. In the example, the data in the X-register 161 becomes "10" and that in the Y-register 162 becomes "8" (71). When S4 is executed, which means to calculate 10 - 8, the content of the X-register 161, thus, becomes 2 (72). Then the display processing is consequently carried out in the same way as in the case of Fig. 4 to display 2 in the display unit 13 (73). As described above, the operation method of the constant part differs depending on whether the operator is located before or after the constant, so that even though executing the same operation 5 + 3, when the constant is set -10 in Fig. 4, it means (5 + 3)-10 and the result becomes -2, while the constant is set 10- in Fig. 7, it means 10-(5 + 3) and it results in 2. Accordingly, the calculation using a constant can be easily executed because the sequence of the constant and the operator can be preliminarily set, and in addition, a display or a print showing that a constant and an operator are preliminarily set can be carried out. Furthermore, if the predetermined content is forgotten, it can be easily confirmed by the display or the print with a simple key operation. As described so far, this invention can present a computer comprising a keyboard having numerical keys and others, a ROM to store control programs, a RAM equipped with registers for operations and a CPU to control these devices, wherein a constant register to store constants, an operator storage unit to store operators and a flag to show whether an operator is positioned before or after a constant are provided in said RAM, and a setting key to set the entered constant and operator and a confirmation key to confirm the predetermined constant and operator are provided in said keyboard, thereby executing an operation preliminarily set in said RAM after processing the desired operation that has been entered, and a calculation using a constant with a simple operation because the sequence of the constant and the operator can be predetermined, and furthermore, the preset content can be displayed or printed and easily confirmed by a simple key operation even when it is forgotten. In the computer of this invention, a constant and an operator should first be predetermined. To do this, a signal entered by the keyboard is stored in the RAM, the constant and the operator are stored in the constant register and the operator storage unit respectively when the preset key is pressed, whether the operator exists before or after the constant is judged by the CPU, and the flag is set or reset. To confirm the preset constant and operator, by operating the confirmation key on the keyboard, the content of the constant register is transferred to the register for operation and at the same time, the operator stored in the operator storage unit is transferred before or after the constant in the register for operation depending on the flage state. The content in the register for operation is delivered to the display or the printer. After setting the constant and the operator, to calculate by using this function of constant, a numeral or numerical formula is entered by the keyboard in the same way as in an ordinary calculation, and in the case that only a numeral is entered, the numeral and the preset constant are calculated by the set operator. While a numerical formula is entered, after calculating the entered formula, its result and the preset constant are operated in the same way.

Claims: An electronic calculator comprising a storage means (RAM 16) comprising registers (161, 162) for operating commands and data; a keyboard (15) having numeral keys and other, including a constant key (151) for storing an entered numerical value and an entered allocated operator, and a start key (=) for starting a calculation based on an entered numerical value and the stored operator and constant; a ROM (11) to store control programs; and a CPU (10) to control these devices; characterized in that the calculator is arranged and programmed to execute the following steps: checking, as soon as the constant key is pressed, whether a numerical value was entered before an operator or vice versa; storing information in a flag register (165) indicating the examination result of the just mentioned steps; checking the content of the flag register (165) as soon as the start key is pressed, to execute a calculation based on the just entered numerical value, the constant and the operator either in the sequence "numerical value - operator constant", when the flag indicates that the operator was entered before the constant, or in the sequence "constant - operator - numerical value", when the operator was entered after the constant. A calculator according to claim 1, characterized in that it comprises a confirmation key (152) and is arranged to display a constant and an operator in the sequence as indicated by the state of the flag, as soon as that confirmation key is actuated.

Inventors: INUI, KEN'ICHI, TANAKA, YASUHARU
Applicants: SHARP KABUSHIKI KAISHA
Application year: 1987
Main classification: G06F15
IPC codes: G06F15