Digital computer for adding and subtracting
A method and apparatus for efficiently adding and subtracting multiple digit decimal numbers represented as a series of 8-bit bytes, each 8-bit byte representing one digit of a decimal number. In accordance with the present invention, numeric values are stored internally within a computer in a new f...
Gespeichert in:
Hauptverfasser: | , |
---|---|
Format: | Patent |
Sprache: | eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | A method and apparatus for efficiently adding and subtracting multiple digit decimal numbers represented as a series of 8-bit bytes, each 8-bit byte representing one digit of a decimal number. In accordance with the present invention, numeric values are stored internally within a computer in a new format, referred to as "X7B". Numeric input into the computer can be in any form, such as binary, ASCII, EBCDIC, X7B, etc. X7B values are computed by adding the 8-bit binary representation of each decimal digit to a binary value of"0111 1011" (i.e., "7B" hexadecimal). The invention adds or subtracts two X7B numbers by performing the following operations: (1) inputting first and second decimal numbers in X7B format as a concatenation of 8-bit values; (2) adding or subtracting the two X7B values; (3) logically AND'ing each byte of the sum or difference with the hexadecimal value "30"; (4) logically shifting the result of the logical AND operation 3 bits to the right; (5) subtracting the result of the shift operation from the sum or difference resulting from the first addition or subtraction operation; (6) logically AND'ing each byte of the preceding result with the hexadecimal value "0F"; and (7) outputting the value in simple binary coded decimal format (i.e., all four leading bits of each byte are "0") or in X7B format (by adding hexadecimal "7B" to each byte of the final value). |
---|