Process and system for adding or subtracting symbols in any base without converting to a common base
AssigneeInternational Business Machines Corporation
InventorsEdward E. Kelley, Norman J. Dauerer, Franco Motika, Aziz M. Ahsan
Life of this patent
Estimating the term…
Abstract
A process and system for effecting addition and/or subtraction any two symbols having any number of characters and in any base with full precision and without first converting to a common base. Regardless of the quantity of characters of each symbol, the speed of execution remains almost constant per character. The process and system of the present invention does not require the use of floating point notation. Furthermore, the process and system of the present invention does not require or use standard mathematical algorithms, addition or subtraction tables, or exponentiation.
Claims60
A data system comprising:
- a first logic circuit for receiving data defining at least two numbers in a number system having a base, each number having at least one digit, the data further defining a desired base, the logic circuit adding the digits of the numbers to produce a first interim sum, the logic circuit comparing the first interim sum to the base, the logic circuit subtracting the desired base from the first interim sum to produce a difference if the interim sum is greater than or equal to the base when the signal has the first state, the first logic circuit outputting the difference if the interim sum is greater than or equal to the desired base or the interim sum if the interim sum is less than the desired base;
- and
- a second logic circuit producing a carry signal for input to the first logic circuit for a succeeding digit-addition operation if the first interim sum is greater than or equal to the desired base, the second logic circuit producing no carry signal if the first interim sum is less than the desired base.
A data system, comprising:
- a first logic circuit for receiving data defining at least two numbers in a number system having a base, each number having a value and at least one digit, the data further defining a desired base, the first logic circuit adding the desired base to each digit of the number having the greater amount of digits or the greater value to form an interim sum, the first logic circuit subtracting the desired base from the interim sum to produce an interim difference, the logic circuit subtracting the base from the interim difference to produce a final difference when the interim difference is greater than or equal to the desired base, the first logic circuit outputting the final difference if the interim difference is greater than or equal to the desired base or the interim difference if the interim difference is less than the desired base;
- and
- a second logic circuit for producing a borrow signal for input into the first logic circuit for a successive digit subtraction operation if the interim difference is less than the desired base, the second logic circuit producing no carry signal if the interim difference is greater than or equal to the desired base.
A data system comprising:
- an input circuit for receiving data defining at least two numbers in a number system having a base, each number having at least one digit, the data further defining operation information and a desired base, the operation information determining if an addition or subtraction operation is to be performed;
- a first logic circuit for adding the desired base to a digit of one of the numbers to form a first interim sum if the operation is subtraction, the first logic circuit adding corresponding digits of the numbers to form a second interim sum if the operation is addition, the first logic circuit subtracting a digit of the other number from the first interim sum to form a first difference if the operation is subtraction, the first logic circuit including a comparator circuit for comparing the second interim sum to the desired base and outputting a control signal having a first state if the second interim sum is greater than or equal to the desired base and a second state if the second interim sum is less than the desired base;
- a second logic circuit connected to the first second logic circuit, the second logic circuit subtracting the desired base from the second interim sum to form a second difference if the operation is addition and if the control signal has the first state, the comparator circuit of the first logic circuit comparing the interim difference to the desired base, the comparator circuit control signal having the first state if the interim difference is greater than or equal to the desired base and the second state if the interim difference is less than the desired base, the second logic circuit subtracting the desired base from the interim difference if the operation is subtraction and the control signal has the first state;
- and
- a third logic circuit for generating a carry/borrow signal for input into the first logic circuit for use in a succeeding digit addition or subtraction operations, the carry/borrow signal having a first state when the operation is addition and the second interim sum is greater than or equal to the desired base or if the operation is subtraction and the interim difference is less than the desired base, the carry/borrow signal having a second state if the operation is addition and if the second interim sum is less than the desired base or if the operation is subtraction and the interim difference is greater than or equal to the desired base.
A process for performing operations on data comprising the steps of:
- a) inputting data into a storage medium, the data defining at least two numbers in a number system having a base and a desired base, each number having at least one digit;
- b) adding the digits of the numbers in an adder circuit to produce a first interim sum;
- c) determining with a comparator circuit if the first interim sum is greater than or equal to the desired base;
- d) subtracting in the desired base from the first interim sum in a subtractor circuit to produce a difference if in step (c), it is determined that the first interim sum is greater than or equal to the desired base;
- e) outputting to the storage medium the difference if in step (c), it is determined that the first interim Sum is greater than or equal to the desired base, or the first interim sum if in step (c), it is determined that the first interim sum is less than the desired base;
- and
- f) producing a carry signal with a latch connected to the comparator for input into the adder circuit for a next digit addition operation if in step (c), it is determined that the first interim sum is greater than or equal to the desired base.
A process for performing operations on data comprising the steps of:
- a) inputting data into a storage medium, the data defining numbers in a number system having a base, each number having at least one digit and a value, the data further defining a desired base;
- b) adding, in an adder circuit, the desired base to a digit of one of the numbers to produce a first interim sum;
- c) subtracting, in a subtractor circuit, a digit of the other number from the first interim sum to produce an interim difference;
- d) determining with a comparator circuit if the interim difference is greater than or equal to the desired base;
- e) subtracting, in a subtractor circuit, the desired base from the interim difference to produce a final difference if in step (c), it is determined that the interim difference is greater than or equal to the desired base;
- f) outputting to the storage medium the final difference if in step (c), it is determined that the interim difference is greater than or equal to the desired base, or the interim difference if in step (c), it is determined that the interim difference is less than the desired base;
- and
- g) producing a borrow signal, with a latch connected to the comparator, for input into the subtractor circuit for a next digit subtraction operation if in step (c), it is determined that the interim difference is greater than or equal to the desired base.
A process for performing operations on data comprising the steps of:
- a) inputting data into a storage medium, the data defining at least two numbers in a number system having a base, each number having at least one digit and a value, the data further defining operation information and a desired base, the operation information determining if an addition or subtraction operation is to be performed;
- b) adding, in an adder circuit, the desired base to a digit of one of the numbers to form a first interim sum if the operation is subtraction;
- c) adding, in adder circuit, corresponding digits of the numbers to form a second interim sum if the operation is addition;
- d) subtracting, in a subtract circuit, a digit of the other numbers from the first interim sum to form a first difference if the operation is subtraction;
- e) determining with a comparator circuit if the second interim sum is greater than or equal to the desired base if the operation is addition;
- f) subtracting, in a subtractor circuit, the desired base from the second interim sum to form a second difference if the operation is addition and if in step (e), it is determined that the second interim sum is greater than the desired base;
- g) determining with a comparator if the first difference is greater than or equal to the desired base if the operation is subtraction;
- h) subtracting, in a subtractor circuit, the desired base from the interim difference if the operation is subtraction and in step (g), it is determined that the interim difference is greater than or equal to the desired base;
- and
- (i) generating a carry/borrow signal for use in steps (c) and (d) for succeeding digit addition or subtraction operations, respectively, the carry/borrow signal having a first state when the operation is addition and step (e) determines that the second interim sum is greater than or equal to the desired base, or if the operation is subtraction and step (g) determines that the interim difference is less than the desired base, the carry/borrow signal having a second state if the operation is addition and step (e) determines that the second interim sum is less than the desired base, or if the operation is subtraction and step (g) determines that the interim difference is greater than or equal to the desired base.
The process of step 38 wherein the inputting step (a) includes the step of determining the value of each number, and in step (b), the desired base is added to the number having the greater value to produce the first interim sum, and in step (d), a digit from the number having the lesser value is subtracted from the first interim sum to produce the first difference.
A data system comprising:
- a first logic circuit for receiving data defining at least two symbols in a symbol system having a base, each symbol having at least one character, the data further defining a desired base, the logic circuit adding the characters of the symbols to produce a first interim sum, the logic circuit comparing the first interim sum to the base, the logic circuit subtracting the desired base from the first interim sum to produce a difference if the interim sum is greater than or equal to the base when the signal has the first state, the first logic circuit outputting the difference if the interim sum is greater than or equal to the desired base or the interim sum if the interim sum is less than the desired base;
- and
- a second logic circuit producing a carry signal for input to the first logic circuit for a succeeding character-addition operation if the first interim sum is greater than or equal to the desired base, the second logic circuit producing no carry signal if the first interim sum is less than the desired base.
A data system, comprising:
- a first logic circuit for receiving data defining at least two symbols in a symbol system having a base, each symbol having at least one character, the data further defining a desired base, the first logic circuit adding the desired base to each character of the symbol having the greater amount of characters or the greater value to form an interim sum, the first logic circuit subtracting the desired base from the interim sum to produce an interim difference, the logic circuit subtracting the base from the interim difference to produce a final difference when the interim difference is greater than or equal to the desired base, the first logic circuit outputting the final difference if the interim difference is greater than or equal to the desired base or the interim difference if the interim difference is less than the desired base;
- and
- a second logic circuit for producing a borrow signal for input into the first logic circuit for a successive character subtraction operation if the interim difference is less than the desired base, the second logic circuit producing no carry signal if the interim difference is greater than or equal to the desired base.
A process for handling data comprising the steps of:
- a) inputting data into a storage medium, the data defining at least two symbols in a symbol system having a base and a desired base, each symbol having at least one character;
- b) adding the characters of the symbols in an adder circuit to produce a first interim sum;
- c) determining with a comparator circuit if the first interim sum is greater than or equal to the desired base;
- d) subtracting in the desired base from the first interim sum in a subtractor circuit to produce a difference if in step (c), it is determined that the first interim sum is greater than or equal to the desired base;
- e) outputting to the storage medium the difference if in step (c), it is determined that the first interim sum is greater than or equal to the desired base, or the first interim sum if in step (c), it is determined that the first interim sum is less than the desired base;
- and
- f) producing a carry signal with a latch connected to the comparator for input into the adder circuit for a next character addition operation if in step (c), it is determined that the first interim sum is greater than or equal to the desired base.
A process for handling data comprising the steps of:
- a) inputting data into a storage medium, the data defining symbols in a symbol system having a base, each symbol having at least one character, the data further defining a desired base;
- b) adding, in an adder circuit, the desired base to a character of one of the symbols to produce a first interim sum;
- c) subtracting, in a subtractor circuit, a character of the other symbol from the first interim sum to produce an interim difference;
- d) determining with a comparator circuit if the interim difference is greater than or equal to the desired base;
- e) subtracting, in a subtractor circuit, the desired base from the interim difference to produce a final difference if in step (c), it is determined that the interim difference is greater than or equal to the desired base;
- f) outputting to the storage medium the final difference if in step (c), it is determined that the interim difference is greater than or equal to the desired base, or the interim difference if in step (c), it is determined that the interim difference is less than the desired base;
- and
- g) producing a borrow signal, with a latch connected to the comparator, for input into the subtractor circuit for a next character subtraction operation if in step (c), it is determined that the interim difference is greater than or equal to the desired base.
A process for handling data comprising the steps of:
- a) inputting data into a storage medium, the data defining at least two symbols in a symbol system having a base, each symbol having at least one character, the data further defining operation information and a desired base, the operation information determining if an addition or subtraction operation is to be performed;
- b) adding, in an adder circuit, the desired base to a character of one of the symbols to form a first interim sum if the operation is subtraction;
- c) adding, in adder circuit, corresponding characters of the symbols to form a second interim sum if the operation is addition;
- d) subtracting, in a subtract circuit, a character of the other symbol from the first interim sum to form a first difference if the operation is subtraction;
- e) determining with a comparator circuit if the second interim sum is greater than or equal to the desired base if the operation is addition;
- f) subtracting, in a subtractor circuit, the desired base from the second interim sum to form a second difference if the operation is addition and if in step (e), it is determined that the second interim sum is greater than the desired base;
- g) determining with a comparator if the first difference is greater than or equal to the desired base if the operation is subtraction;
- h) subtracting, in a subtractor circuit, the desired base from the interim difference if the operation is subtraction and in step (g), it is determined that the interim difference is greater than or equal to the desired base;
- and
- (i) generating a carry/borrow signal for use in steps (c) and (d) for succeeding character addition or subtraction operations, respectively, the carry/borrow signal having a first state when the operation is addition and step (e) determines that the second interim sum is greater than or equal to the desired base, or if the operation is subtraction and step (g) determines that the interim difference is less than the desired base, the carry/borrow signal having a second state if the operation is addition and step (e) determines that the second interim sum is less than the desired base, or if the operation is subtraction and step (g) determines that the interim difference is greater than or equal to the desired base.
Dependencies are inferred from the claim text.