Arithmetic operation in a data processing system
09767073 · 2017-09-19
Assignee
Inventors
- Klaus M. Kroener (Boeblingen, DE)
- Christophe J. Layer (Grenoble, FR)
- Silvia M. Mueller (Boeblingen, DE)
- Kerstin Schelm (Boeblingen, DE)
Cpc classification
International classification
G06F7/38
PHYSICS
Abstract
An arithmetic operation in a data processing unit, preferably by iterative digit accumulations, is proposed. An approximate result of the arithmetic operation is computed iteratively. Concurrently at least two supplementary values of the approximate result of the arithmetic operation are computed, and the final result selected from one of the values of the approximate result and the at least two supplementary values of the arithmetic operation depending on the results of the last iteration step.
Claims
1. A method for performing an arithmetic operation in a data processing unit, the method comprising: the data processing unit iteratively computing an approximate result of the arithmetic operation; concurrently with the iteratively computing, the data processing unit computing at least two supplementary values of the approximate result of the arithmetic operation; and the data processing unit selecting a final result of the arithmetic operation from among a set including the approximate result and the at least two supplementary values depending on a result of a last iteration of the iteratively computing.
2. The method according to claim 1, wherein the arithmetic operation is an SRT (Sweeney, Robertson, and Tocher) computation process.
3. The method according to claim 1, wherein the arithmetic operation is a division operation.
4. The method according to claim 1, wherein the arithmetic operation is a square-root operation.
5. The method according to claim 1, wherein the arithmetic operation is one of an addition, a subtraction, or a multiplication operation.
6. The method according to claim 1, wherein: the iteratively computing the approximate result comprises iteratively computing an approximate result Q of the arithmetic operation by accumulating digit values q concatenated to a previous approximate result Q using a given radix r; computing at least two supplementary values comprises computing iteratively the at least two supplementary values of the approximate result, Q−1 and Q−2, by accumulating digit values q−1 and q−2, respectively, concatenated to previous supplementary values Q−1 and Q−2 using the given radix r; the method further comprises computing concurrently a remainder value P of the arithmetic operation; the selecting the final result comprises: in response to P being greater than or equal to zero and Q being greater than or equal to zero, selecting as the final result a value of Q for the last iteration; in response to P being less than zero and Q being greater than or equal to zero, selecting as the final result a value of Q−1 for the last iteration; in response to P being greater than or equal to zero and Q being less than zero, a negation of a value of Q−1 for the last iteration; and in response to P being less than zero and Q being less than zero, selecting as the final result a negation of a value of Q−2 for the last iteration.
7. The method according to claim 6, and further comprising selecting the digit values q from a lookup table.
8. The method according to claim 6, wherein an absolute value of the digit values q is less than the radix r.
9. The method according to claim 1, wherein selecting the final result comprises selecting the final result using a multiplexing unit having the approximate result and the at least two supplementary values as inputs.
10. The method according to claim 9, wherein the selecting the final result includes the multiplexing unit selecting the final result in response to at least two hardware lines indicating operand signs.
Description
BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS
(1) The present invention together with the above-mentioned and other objects and advantages may best be understood from the following detailed description of the embodiments, but not restricted to the embodiments, wherein is shown in:
(2)
(3)
(4)
(5)
(6)
(7)
DETAILED DESCRIPTION
(8) In the drawings, like elements are referred to with like reference numerals. The drawings are merely schematic representations, not intended to portray specific parameters of the invention. Moreover, the drawings are intended to depict only typical embodiments of the invention and therefore should not be considered as limiting the scope of the invention.
(9) In
(10) Iterative algorithms such as an SRT division process can be described according to the following formulas for iterated quotient values Q.sub.i, which are expressed for the example of a fixed-point right aligned division process as:
∀i≧0,Q.sub.i+1=r*Q.sub.i+q.sub.i+1=Σ.sub.n=0.sup.i+1q.sub.n*r.sup.i+1−n,Q.sub.0=0,q.sub.0=0 (3)
and for the example of a floating point left aligned division process:
∀i≧0,Q.sub.i+1=Q.sub.i+q.sub.i+1*r.sup.−(i+1)=Σ.sub.n=0.sup.i+1q.sub.n*r.sup.−n,Q.sub.0=0,q.sub.0=0 (4)
where i is an iteration step, r a radix (usually 4, 8, 10 or 16), P.sub.i is a partial remainder, D a constant denominator and q.sub.i a guessed quotient digit value. Equation (4) thereby corresponds to the already shown equation (2) and exhibits a more detailed description.
(11) Quotient digit values q.sub.i can be determined according:
∀i≧0,q.sub.min≦q.sub.i≦q.sub.max (5)
with usually, but not necessarily
−q.sub.min=q.sub.max<r
whereby the partial remainder value P.sub.i may be determined according already shown equation (1):
∀i≧0,P.sub.i+1=r*P.sub.i−q.sub.i+1*D (1)
(12) After having the result of the division process 34 a denormalizing process 36 delivers absolute values of the last iteration step for a quotient |Q.sub.last| and a partial remainder |P.sub.last|. A final post-processing step 38 corrects and/or negates the result according to the signs of A and B, which are transferred from the pre-processing step 30, and delivers the final results for the quotient Q and the remainder R. One advantage of the invention is that the final post-processing step 38 may be eliminated because the determination of the final results Q and R can be selected directly from the last iteration step values.
(13)
(14) An iterative value for the guessed quotient value Q, is computed according equation (3), because a fixed point right aligned division process is described here:
(15)
where the symbol ∥ characterizes a concatenation step with a left shift by log.sub.2(r) bits, e.g. for radix 4, a left shift by 2 bits.
(16) The quotient value Qi−1 is computed like this:
(17)
whereas for the quotient values Q.sub.i−2 the following formula applies:
(18)
(19) In
P.sub.last>0Q.sub.last>0,
Q=Q.sub.last
P.sub.last>0Q.sub.last≧0,
Q=(Q.sub.last−1)
P.sub.last>0Q.sub.last<0,
Q=−(Q.sub.last)=
P.sub.last>0Q.sub.last<0,
Q=−(Q.sub.last)=(Q.sub.last−1)=
(20) In case P is greater or equal to zero and Q is greater or equal zero, the last iterated value of Q will be selected. In case P is less than zero and Q is greater or equal zero, the last iterated value of Q−1 will be selected. In case P is greater or equal zero and Q is less than zero, the negated last iterated value of Q−1 will be selected; and in case P is less than zero and Q is less than zero, the negated last iterated value of Q−2 will be selected as the final result. In such a manner the final correction and/or negation steps of a usual SRT division process may be neglected, because the final result may be directly selected from already computed values Q, Q−1, or Q−2 of the last iteration step.
(21) Besides the inputs from the data lines 66 to 69 for Q, Q−1, −(Q−1), and −(Q−2), multiplexing unit 46 additionally has at least two hardware input lines 100 which feed an input signal for P.sub.last<0 and the exclusive-or input of sign(A)⊕sign(B), where A and B are the dividend and divisor of the SRT division process as defined above. The partial remainder values P are computed in a parallel process according to the formula given above. By this method the final result correction and/or negation step can be eliminated and can be replaced by a simple and fast selection step in the multiplexing unit 46.
(22) In
(23) The embodiment shown in
(24) In
Q.sub.i+1=r*Q.sub.i+q.sub.i
Q′.sub.i+1=r*Q′.sub.i+q′.sub.i
Q″.sub.i+1=r*Q″.sub.i+q″.sub.i
where q′.sub.i+1=q.sub.i+1−1 and q″.sub.i+1=q.sub.i+1−2. The columns 112, 115, 118 represent the data registers with the values of q, q′, q″, respectively, in digits (indices are omitted). Columns 113, 116, 119 show the respective values of Q, Q′, Q″ in decimal representation. As a starting point, Q value 111 and q value 112 are set to zero. Then according to the first q.sub.i+1 value 110 of 2, a new set of quotient values are computed according to equation (9). Afterwards the iteration proceeds with the next q.sub.i+1 value 110 and so on, until an appropriate accuracy is achieved. In
(25)
(26) Referring now to
(27) In data processing system 210 there is a computer system/server 212, which is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well-known computing systems, environments, and/or configurations that may be suitable for use with computer system/server 212 include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments that include any of the above systems or devices, and the like.
(28) Computer system/server 212 may be described in the general context of computer system executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, and so on that perform particular tasks or implement particular abstract data types. Computer system/server 212 may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
(29) As shown in
(30) Bus 218 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
(31) Computer system/server 212 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer system/server 212, and it includes both volatile and non-volatile media, removable and non-removable media.
(32) System memory 228 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 230 and/or cache memory 232. Computer system/server 212 may further include other removable/non-removable, volatile/non-volatile computer system storage media. By way of example only, storage system 234 can be provided for reading from and writing to a non-removable, non-volatile magnetic media (not shown and typically called a “hard drive”). Although not shown, a magnetic disk drive for reading from and writing to a removable, non-volatile magnetic disk (e.g., a “floppy disk”), and an optical disk drive for reading from or writing to a removable, non-volatile optical disk such as a CD-ROM, DVD-ROM or other optical media can be provided. In such instances, each can be connected to bus 218 by one or more data media interfaces. As will be further depicted and described below, memory 228 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
(33) Program/utility 240, having a set (at least one) of program modules 242, may be stored in memory 228 by way of example, and not limitation, as well as an operating system, one or more application programs, other program modules, and program data. Each of the operating system, one or more application programs, other program modules, and program data or some combination thereof, may include an implementation of a networking environment. Program modules 242 generally carry out the functions and/or methodologies of embodiments of the invention as described herein. Computer system/server 212 may also communicate with one or more external devices 214 such as a keyboard, a pointing device, a display 224, etc.; one or more devices that enable a user to interact with computer system/server 212; and/or any devices (e.g., network card, modem, etc.) that enable computer system/server 212 to communicate with one or more other computing devices. Such communication can occur via Input/Output (I10) interfaces 222. Still yet, computer system/server 212 can communicate with one or more networks such as a local area network (LAN), a general wide area network (WAN), and/or a public network (e.g., the Internet) via network adapter 220. As depicted, network adapter 220 communicates with the other components of computer system/server 212 via bus 218. It should be understood that although not shown, other hardware and/or software components could be used in conjunction with computer system/server 212. Examples, include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.
(34) The block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams, and combinations of blocks in the block diagrams, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.