JP2004342106A - Modular binary multiplier for signed and unsigned operands of variable width - Google Patents
Modular binary multiplier for signed and unsigned operands of variable width Download PDFInfo
- Publication number
- JP2004342106A JP2004342106A JP2004141968A JP2004141968A JP2004342106A JP 2004342106 A JP2004342106 A JP 2004342106A JP 2004141968 A JP2004141968 A JP 2004141968A JP 2004141968 A JP2004141968 A JP 2004141968A JP 2004342106 A JP2004342106 A JP 2004342106A
- Authority
- JP
- Japan
- Prior art keywords
- multiplier
- register
- multiplicand
- data
- bit
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/52—Multiplying; Dividing
- G06F7/523—Multiplying only
- G06F7/53—Multiplying only in parallel-parallel fashion, i.e. both operands being entered in parallel
- G06F7/5324—Multiplying only in parallel-parallel fashion, i.e. both operands being entered in parallel partitioned, i.e. using repetitively a smaller parallel parallel multiplier or using an array of such smaller multipliers
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
- G06F9/3001—Arithmetic instructions
- G06F9/30014—Arithmetic instructions with variable precision
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2207/00—Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F2207/38—Indexing scheme relating to groups G06F7/38 - G06F7/575
- G06F2207/3804—Details
- G06F2207/3808—Details concerning the type of numbers or the way they are handled
- G06F2207/3812—Devices capable of handling different types of numbers
- G06F2207/3816—Accepting numbers of variable word length
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/52—Multiplying; Dividing
- G06F7/523—Multiplying only
- G06F7/533—Reduction of the number of iteration steps or stages, e.g. using the Booth algorithm, log-sum, odd-even
- G06F7/5332—Reduction of the number of iteration steps or stages, e.g. using the Booth algorithm, log-sum, odd-even by skipping over strings of zeroes or ones, e.g. using the Booth Algorithm
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computational Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Complex Calculations (AREA)
- Executing Machine-Instructions (AREA)
- Advance Control (AREA)
Abstract
Description
本発明は、コンピュータおよびプロセッサアーキテクチャにおける算術技法および論理技法の分野に関し、詳細には、一般的なプロセッサ環境に見られる機能と共に使用する2進乗算器の設計に関する。 The present invention relates to the field of arithmetic and logic techniques in computer and processor architectures, and in particular, to the design of binary multipliers for use with features found in common processor environments.
2進乗算は、符号付きと符号なしの両方の整数のみを扱い、したがってそのオペランドと結果が完全に2進表現可能な、乗算のサブセットである。2進乗算の最も単純な方法は、人間による実行方法を模倣したもので、被乗数を乗数によって、一度に乗数一桁ずつ処理して部分積を生成し、それらの部分積を合計して最終積を生成する。人間による乗算方法を2進数に適用した一例を以下に示す。
符号なし乗算(完全結果表現について4ビット×4ビット−>8ビット)
1110 被乗数 14
0111 乗数 07
−−−− −−
1110 pp1 98
1 110 pp2 00
1 1 10 pp2 −−
000 0 pp3
−−−−−−−
01100010 積 98
Binary multiplication is a subset of multiplication that deals only with both signed and unsigned integers, so that its operands and results can be completely represented in binary. The simplest way of performing binary multiplication is to imitate a human execution method, in which the multiplicand is processed by the multiplier one digit at a time to produce a partial product, and those partial products are summed to form the final product. Generate a product. An example in which a human multiplication method is applied to a binary number is shown below.
Unsigned multiplication (4 bits x 4 bits-> 8 bits for complete result representation)
1110 Multiplicand 14
0111 Multiplier 07
−−−− −−
1110 pp1 98
1 110 pp200
1 110 pp2 ---
0000 pp3
−−−−−−−−
01100010 Product 98
この方法は、符号付き乗算にも適用される。しかし、2の補数の負の表現と符号拡張の使用により、結果の符号を処理する追加処理が不要になる。
符号付き乗算(オペランドを8に符号拡張 4ビット×4ビット−>8ビット)
1111 1110 被乗数 −2
0000 0111 乗数 +7
−−−− −−
1111 1110 pp1 −14
1111 110 pp2
1111 10 pp3
0000 0 pp4
0000 pp5
000 pp6
00 pp7
0 pp8
−−−−−
1111 0010 積 −14
This method also applies to signed multiplication. However, the use of two's complement negative representation and sign extension eliminates the need for additional processing of the resulting sign.
Signed multiplication (operand sign extension to 8 4 bits x 4 bits-> 8 bits)
1111 1110 Multiplicand -2
0000 0111 Multiplier +7
−−−− −−
1111 1110 pp1 -14
1111 110 pp2
1111 10 pp3
0000 0 pp4
0000 pp5
000 pp6
00 pp7
0 pp8
−−−−−−
1111 0010 Product -14
この乗算方法はきわめて単純で、シフタ、加算器、および積累算器を使用したハードウェアでの実施が比較的容易であるが、1乗数ビットを処理して部分積を生成するのに1サイクル要するとすれば、nビットの乗数による演算を完了するにはnサイクルも要することになる。現在の高速コンピューティングの分野でのこのような長い1命令当たりサイクル(CPI)時間は、阻害要素とみなされる。乗算命令のためのより短いCPIを実現する解決策は、部分積をグループにして一度に計算するために追加のハードウェアを使用し、それらを同時に処理するのに必要な加算器を構築することである。この問題に対してハードウェアを投入するこの強引な手法によって、CPIは短縮されるが、乗算機能専用のチップ面積を増大させることにもなる。特に加算器は、特に機能仕様に通常付随する面積とタイミングの制約の点で扱いが難しい。したがって、乗数の複数のビットを一度に処理することによって部分積を減らすことにより加算器のサイズを小さくする多くの方法が策定されている。比較的一般的な方法の1つは、ブースの記録アルゴリズムである。 This multiplication method is very simple and relatively easy to implement in hardware using shifters, adders, and accumulators, but requires one cycle to process the multiplier bits and generate the partial product. Then, it takes n cycles to complete the operation using the n-bit multiplier. Such a long cycle-per-instruction (CPI) time in the current field of high-speed computing is considered an impediment. The solution to achieve a shorter CPI for multiply instructions is to use additional hardware to group the partial products and compute them at once, and build the adders needed to process them simultaneously It is. This brute force approach to hardware entry reduces the CPI but also increases the chip area dedicated to the multiplication function. In particular, adders are difficult to handle, especially in terms of area and timing constraints usually associated with functional specifications. Therefore, many methods have been formulated to reduce the size of the adder by reducing the partial product by processing multiple bits of the multiplier at one time. One of the more common methods is the Booth recording algorithm.
ブースの記録アルゴリズムは、複数ビットを走査することによって、所与のnビット乗数から生成される部分積の数を減らす方法である。この方法は、値「1」の最下位ビットが有効値2nを持ち、1のストリングがzビット長である2進1のストリングを、2n+z−2nとも表すことができるという考え方に基づいている。たとえば、ストリング0b0111は、23−20=7と表すことができ、ストリング0b1110は24−21=14と表すことができる。 Booth's recording algorithm is a method of reducing the number of partial products generated from a given n-bit multiplier by scanning multiple bits. This method is based on the idea that a binary 1 string in which the least significant bit of the value "1" has a valid value 2n and one string is z bits long can also be represented as 2n + z - 2n. I have. For example, the string 0b0111 may be expressed as 2 3-2 0 = 7, strings 0b1110 can be represented as 2 4 -2 1 = 14.
上記の例では、各ビットの重みは2nであり、nは該当するビットの位取り値である。1のストリングの検出は、走査乗数ビットのグループを1ビットだけ重複させることによって行う。走査数値が重複ビットによる1ビット走査における乗数である乗算へのこのカウント方法の適用は、その右側の重複ビットが「0」である「1」ビットによって検出されたストリングの最後にあるビット(ストリングの最下位ビット)に、値−(2n)*(被乗数)を与え、重複ビットが「1」である位置の「0」によって検出されたストリングの最初にあるビット(zビットストリングの最上位ビット)に値(2n)*(被乗数)を与え、0または1のストリングの中央にあるビットに値ゼロを与えるという単純なものである。これを、以下の表にまとめる。この表では、左端のビットがストリングの位置nにあるビットであり、右端のビットがストリングの検出に必要な重複ビットである。「調整被乗数値」の列は、被乗数倍数値を示す。この値の重みは、該当する走査ビットの位置によって暗黙に示すことができる。 In the above example, the weight of each bit is 2n, where n is the scale value of the corresponding bit. The detection of one string is performed by overlapping the group of scanning multiplier bits by one bit. The application of this counting method to multiplication, where the scan value is a multiplier in a one-bit scan with duplicate bits, requires that the last bit of the string detected by the "1" bit to the right of the duplicate bit be "0" (string Of the string (the least significant bit of the z-bit string) given the value-(2 n ) * (multiplicand) Bit) is given the value (2 n ) * (multiplicand) and the bit at the center of the 0 or 1 string is given the value zero. This is summarized in the table below. In this table, the leftmost bit is the bit at position n of the string, and the rightmost bit is the duplicate bit required to detect the string. The column of “adjusted multiplicand value” indicates a multiplicand value. The weight of this value can be implicitly indicated by the position of the corresponding scan bit.
ブースの記録方法を有利に実施する鍵は、1グループとして走査するビット数を増やし、それによって乗数の必要な走査全体を減らすとともに、部分積の数と、部分積を結合するのに必要なハードウェアを少なくすることである。一般的な走査グループサイズは3ビットであり、2走査ビットと、最下位位置にある重複ビットとから成る。これが普及している理由は、記録を実現するのに必要な被乗数倍数が、単に0x、±1x、および±2xであり、シフタ、インバータ、および2の補数の方法を使用してすべての可能な倍数を実現することにより、すべて比較的容易に実現されるのに対し、より大きな走査グループサイズでは±3xなどのより高い倍数を実現する加算器が必要になることによる。 The key to advantageously implementing Booth's recording method is to increase the number of bits scanned as a group, thereby reducing the overall scan required for the multiplier, as well as the number of partial products and the hardware required to combine the partial products. It is to reduce wear. A typical scan group size is 3 bits, consisting of 2 scan bits and the least significant bit at the bottom. The reason that this is so popular is that the multiplicand multiples required to achieve the recording are simply 0x, ± 1x, and ± 2x, and all possible using shifter, inverter, and two's complement methods Implementing multiples is all relatively easy, while larger scan group sizes require adders that implement higher multiples, such as ± 3x.
本明細書において一実施例で開示する2進乗算の方法は、被乗数を入手するステップと、乗数を入手するステップと、該乗数が選択された長さを超える場合、該乗数を複数の乗数サブグループに区分化するステップと、該被乗数が選択された長さを超える場合、該被乗数を複数の被乗数サブグループに区分化し、該被乗数サブグループの不使用ビットをゼロ設定することと該被乗数サブグループのより小さい部分を符号拡張することとのうちの少なくとも一方を行うステップとを含む。また、この方法は、該複数の被乗数サブグループのうちの選択された被乗数サブグループと該被乗数とのうちの少なくとも一方に基づいて、複数の被乗数倍数を設定するステップと、該複数の乗数サブグループの各該乗数サブグループに基づいて、該複数の被乗数倍数のうちの1つまたは複数の該被乗数倍数を選択するステップと、該選択方法に基づいてモジュラ積を生成するステップとを含む。 The method of binary multiplication disclosed in one embodiment herein includes the steps of obtaining a multiplicand, obtaining a multiplier, and, if the multiplier exceeds a selected length, dividing the multiplier by a plurality of sub-multiples. Partitioning into groups; partitioning the multiplicand into a plurality of multiplicand subgroups if the multiplicand exceeds a selected length, zeroing unused bits of the multiplicand subgroup; Sign extending a smaller portion of. The method also includes setting a plurality of multiplicand multiples based on at least one of the selected multiplicand subgroup of the plurality of multiplicand subgroups and the multiplicand. Selecting one or more of the plurality of multiplicand multiples based on each of the multiplier subgroups of. And generating a modular product based on the selection method.
本明細書において他の実施例で開示するスーパースケーラ・プロセッサのための2進乗算器は、mビットが、該プロセッサのレジスタの全幅と選択された2進乗算命令のオペランド・データの最大幅とのうちの少なくとも一方を含む、最大mビット長の被乗数データを含む第1のオペランドを受け取るように構成された第1のレジスタ入力と、乗数値と、nビット長の該乗数値の一区分を含む乗数値サブグループとのうちの一方を含む第2のオペランドを受け取るように構成され、nが選択された2進乗算命令のオペランド・データの最大幅以下である第2のレジスタ入力とを含む。また、この乗算器は、該乗算器が該被乗数データ入力から該当ビットを選択して有効な被乗数を生成し、該被乗数データ入力の不使用ビットをゼロ設定することができるようにする、前記被乗数データのサイズを示す第1の制御信号を受け取るように構成された制御信号入力と、該被乗数演算が符号付きであるか符号なしであるかを示す第2の制御信号を受け取るように構成され、該乗算器が該有効被乗数の符号拡張を行えるようにするように構成された第2の制御信号入力とを含む。 The binary multiplier for a superscalar processor disclosed in another embodiment herein has m bits, where m is the full width of the register of the processor and the maximum width of the operand data of the selected binary multiply instruction. A first register input configured to receive a first operand including multiplicand data of at most m bits, including at least one of the following: a multiplier value; and a portion of the multiplier value of n bits length. And a second register input configured to receive a second operand including one of the multiplier value subgroups, wherein n is less than or equal to a maximum width of operand data of the selected binary multiply instruction. . The multiplicand further comprises: a multiplier configured to select a corresponding bit from the multiplicand data input to generate a valid multiplicand and to set unused bits of the multiplicand data input to zero. A control signal input configured to receive a first control signal indicative of a size of data and a second control signal configured to receive whether the multiplicand operation is signed or unsigned; A second control signal input configured to enable the multiplier to perform sign extension of the effective multiplicand.
本明細書においてさらなる他の実施例でさらに開示するスーパースケーラ・プロセッサにおける2進乗算のためのシステムは、2進乗算器と、該2進乗算器と動作可能に通信し、乗数データと被乗数データをシフトさせて、選択されたサブグループが該2進乗算器に確実に送られるようにすると共に、モジュラ積を他の1つのモジュラ積と累積モジュラ積のうちの少なくとも一方と適切に結合するために確実に桁合わせされるようにするデータ幅シフタと、該シフタと動作可能に通信し、該乗数データと該被乗数データを該シフタに入力するために保持するレジスタと、該レジスタと動作可能に通信し、モジュラ積を、他のモジュラ積と累算モジュラ積とのうちの少なくとも一方と累算する加算器と、該加算器と動作可能に通信し、該モジュラ積および該累算モジュラ積を該加算器への入力のためと、該累算モジュラ積の出力とのために保持する複数のレジスタとを含む。 A system for binary multiplication in a superscalar processor, further disclosed herein in yet another embodiment, includes a binary multiplier, and in operable communication with the binary multiplier, multiplier data and multiplicand data. To ensure that the selected subgroup is sent to the binary multiplier and to properly combine the modular product with at least one of the other modular product and the cumulative modular product. A data width shifter for ensuring digit alignment, a register operably communicating with the shifter, and holding the multiplier data and the multiplicand data for input to the shifter; and a register operable with the register. An adder for communicating and accumulating a modular product with at least one of another modular product and an accumulating modular product; and operably communicating with the adder, Includes for the product and 該累 calculation modular product of the input to the adder, and a plurality of registers for holding for the output of 該累 calculation modular product.
本明細書においてさらなる他の実施例でさらに開示するスーパースケーラ・プロセッサにおける2進乗算のためのシステムは、第1のレジスタと、第2のレジスタと、第3のレジスタと、該第1のレジスタ、該第2のレジスタ、および第1のマルチプレクサと動作可能に通信するビット論理ユニットおよび2進加算器を含む実行ユニットであって、該第1のマルチプレクサが該第3のレジスタとも動作可能に通信する実行ユニットと、該第1のレジスタおよび該実行ユニットと動作可能に通信する第1のローテータと、該実行ユニットおよび該第2のレジスタと動作可能に通信する先行ゼロ検出レジスタとを含む第1のパイプラインとを含む。また、このシステムは、第4のレジスタと、第5のレジスタと、第6のレジスタと、該第4のレジスタ、該第5のレジスタ、および第2のマルチプレクサと動作可能に通信する他のビット論理ユニットおよび他の2進加算器を含む第2の実行ユニットであって、該第2のマルチプレクサが該第6のレジスタとも動作可能に通信する第2の実行ユニットと、該第4のレジスタおよび該実行ユニットと動作可能に通信するローテータと、該第2の実行ユニットおよび該第5のレジスタと動作可能に通信する先行ゼロ検出レジスタとを含む第2のパイプラインとを含む。また、このシステムは、第7のレジスタと、第8のレジスタと、第9のレジスタと、該第7のレジスタおよび該第8のレジスタと動作可能に通信する乗算器とを含む第3のパイプラインと、データの格納と取出しのための汎用レジスタと、第1のオペランドと第2のオペランドとを入手するオペランド・バッファと、該第1のパイプラインと該第2のパイプラインと該第3のパイプラインと該汎用レジスタと該オペランド・バッファとのうちの少なくとも2者の間の通信のための通信バスとを含む。 A system for binary multiplication in a superscalar processor, further disclosed herein in yet another embodiment, includes a first register, a second register, a third register, and the first register. , An execution unit including a bit logic unit and a binary adder operably communicating with the second register and a first multiplexer, the first multiplexer operably communicating also with the third register. A first rotator in operable communication with the first register and the execution unit; and a leading zero detection register in operable communication with the execution unit and the second register. Including the pipeline. The system also includes a fourth register, a fifth register, a sixth register, and other bits in operable communication with the fourth register, the fifth register, and the second multiplexer. A second execution unit including a logic unit and another binary adder, wherein the second multiplexer is in operable communication with the sixth register; and A rotator in operable communication with the execution unit, and a second pipeline including a leading zero detect register in operable communication with the second execution unit and the fifth register. The system also includes a third pipe including a seventh register, an eighth register, a ninth register, and a multiplier operably communicating with the seventh register and the eighth register. A general register for storing and retrieving data, an operand buffer for obtaining a first operand and a second operand, the first pipeline, the second pipeline, and the third pipeline. And a communication bus for communication between at least two of the general purpose registers and the operand buffer.
上記およびその他の改善点は、以下の詳細な説明で述べる。本発明をその利点および特徴とともによりよく理解することができるように、以下の説明および図面を参照されたい。 These and other improvements are described in the detailed description below. For a better understanding of the invention with advantages and features, refer to the description and to the drawings.
本発明について、例を用い、添付図面を参照しながら以下に説明する。いくつかの図では、同様の要素は同様の番号を付して示す。 The invention will be described below by way of example and with reference to the accompanying drawings. In some figures, similar elements are indicated by similar numbers.
図面を参照しながら、本発明の実施例について、利点および特徴を示しながら例として説明する。 Embodiments of the present invention will be described by way of example with reference to the drawings, showing advantages and features.
本明細書では、そのモジュール性によって様々なサポート算術論理演算装置(ALU)ハードウエアと共に使用するのに適合する特殊スーパーブース乗算器を使用して、有損失または無損失結果を有する符号付きまたは符号なしオペランドである様々な長さの2進数を乗算する方法およびシステム・アーキテクチャを開示する。このアーキテクチャのモジュール性は、より大きなオペランドを効率的に扱うことができる、より小型の乗算器の必要性により促されたものである。したがって、このアーキテクチャは、算術関数および論理関数と、ほとんどのプロセッサ環境に見られる資源と共に機能するように設計されている。このアーキテクチャは、乗数オペランドとして、全データ幅未満のサイズの入力を含み、さらに、被乗数として、全データ幅ではないとしても、全データ幅未満の入力を含むことができる。また、このアーキテクチャは、乗算のサブグループを、最終的に結合して最終的な正しい積を生成することができるように互いに結合する手段となる重複ビット信号も含む。また、このアーキテクチャは、たとえば符号付きまたは符号なしなどの演算のタイプを反映するように入来被乗算データを制御し、変更を加え、モジュラ積とも呼ぶ出力を、他の可能なモジュラ積と桁合わせし、組み合わせるように作成するためのいくつかの追加の信号も使用する。 As used herein, signed or signed with lossy or lossless results using special superbooth multipliers that are adapted for use with various supporting arithmetic and logic unit (ALU) hardware due to their modularity. Disclosed is a method and system architecture for multiplying various lengths of binary numbers that are none operands. The modularity of this architecture is driven by the need for smaller multipliers that can handle larger operands efficiently. Thus, this architecture is designed to work with arithmetic and logic functions and the resources found in most processor environments. The architecture may include an input of a size less than the full data width as a multiplier operand, and may further include an input of less than a full data width, if not a full data width, as a multiplicand. The architecture also includes a duplicate bit signal that provides a means for combining the subgroups of multiplications together so that they can be finally combined to produce the final correct product. This architecture also controls the incoming multiplicand data to reflect the type of operation, e.g., signed or unsigned, modifies and modulates the output, also referred to as a modular product, with other possible modular products. Some additional signals to combine and create to combine are also used.
また、本明細書では、乗算器の実施例と共に使用するこのようなサポート・ハードウェアを、このような環境内での乗算を実現するために作成された、付随するアルゴリズムと共に示す。 Also, herein, such support hardware for use with the multiplier embodiment is shown, along with the associated algorithms that have been created to implement multiplication in such an environment.
一実施例では、乗算器とサポート・ハードウェアのためのハードウェア・アーキテクチャを開示する。他の実施例では、そのハードウェア・アーキテクチャを使用して処理するための乗算アルゴリズムを開示する。モジュラ2進乗算器のアーキテクチャを、図1に示す。 In one embodiment, a hardware architecture for the multiplier and supporting hardware is disclosed. In another embodiment, a multiplication algorithm for processing using the hardware architecture is disclosed. The architecture of a modular binary multiplier is shown in FIG.
モジュラ2進乗算器
このモジュラ2進乗算器10は、6個の一次入力を含むが、6個には限定されない。すなわち、第1のオペランドは1として示されている被乗数として使用される64ビットデータであり、第2のオペランドは、2として示されている乗数または乗数サブグループとして使用される15ビットデータである。3として示され、Z_BITとも呼ぶ乗数サブグループ間の重複ビットは、1つの乗数サブグループから次の乗数サブグループへの連続性をもたせ、ブースの記録アルゴリズムを使用する際に必要なストリング検出に使用される。4として示され、MCAND_64とも呼ぶ演算制御信号は、演算で32ビットと64ビットのいずれの被乗数1を使用するかを2進乗算器10に示し、UNSIGNEDとも表記する「符号なし」制御信号5は、2進乗算器10を符号付きまたは符号なし演算用に準備するために使用され、MTERM_SHIFT信号6は、2進乗算器10のモジュラ積出力を、他のモジュラ積と適切に桁合わせする追加のサイクルを必要としないようにシフトするために使用される。表2に、2つの制御信号MCAND_64 4およびUNSIGNED5のデコード論理の概略を示す。
Modular Binary Multiplier This modular
[0,0]は、32ビットの被乗数を使用した符号付き演算を示す。ロウワードである、オペランド・データのビット32ないし63は変更されないままであるのに対し、ハイワードであるビット0ないし31は、32ビットの被乗数データから符号拡張される。 [0,0] indicates a signed operation using a 32-bit multiplicand. Bits 32-63 of the operand data, the low word, remain unchanged, while bits 0-31, the high word, are sign-extended from the 32-bit multiplicand data.
[0,1]は、符号なし32ビット演算を示す。該当するロウワードとともにごみデータが入力された場合、被乗数データのロウワードは保持されるのに対し、ハイワードはゼロ設定される。 [0,1] indicates an unsigned 32-bit operation. When the garbage data is input together with the corresponding low word, the low word of the multiplicand data is retained, while the high word is set to zero.
[1,0]は、符号付き64ビット演算を示す。これは、2進乗算器10のこのハードウェア・アーキテクチャでは無効な構成として扱われる。その理由は、被乗数1の入力と加算器のデータ幅が64ビットであり、符号拡張が不可能であり、そのために、モジュラ積が不適切に表現される可能性があるためである。
[1,0] indicates a signed 64-bit operation. This is treated as an invalid configuration in this hardware architecture of the
[1,1]は、符号なし64ビットのオペランドを示し、したがって、オペランド・データのハイワードは、被乗数のハイワードとして使用されることになる。 [1,1] indicates an unsigned 64-bit operand, so the high word of the operand data will be used as the high word of the multiplicand.
MCAND_64およびUNSIGNEDのデコード・論理と、被乗数1のハイワードに加える、必要な変更を、被乗数ハイワード変換モジュール11に示す。被乗数ハイワード変換モジュールの結果は、マージ12でオペランド・データの未変更ロウワードとマージされ、2進乗算器10で使用される、1Aで示された演算被乗数データを生成する。一実施例では、2走査ビットとグループ間の重複ビットとから成る3ビット走査を使用した、基数4形式のブース・アルゴリズムを使用する。この形式のブース・アルゴリズムを使用するのは、必要な被乗数の倍数0x、±1x、および±2xの形成が比較的容易であるためである。必要な乗数が+1xの場合、積を生成するための被乗数データの変更は不要であることを理解されたい。したがって、演算被乗数データ1Aが+1xの場合、選択論理17に直接供給されるように図示されている。
The decode and logic of MCAND_64 and UNSIGNED and the necessary changes to make to the high word of the
さらに図1の説明を続けると、左シフタ13が、被乗数データの上位63ビットを入力として受け取り、右に「0」bを付加してそのデータを1ビット左シフトしたデータ、または一般に知られているように、被乗数データの+2x倍数を生成し、これも選択論理17に送られる。シフタ13の出力は、1の補数モジュール15にも供給され、ビット・フリップを実行し、それによって、演算被乗数データ1Aの1の補数形式の+2x乗数を形成し、選択論理17において「ホット1」を付加して演算被乗数1Aの−2x乗数の生成を完了するだけで済む。この「ホット1」の追加は、有効乗数グループのビットの記録に基づく演算被乗数1Aのどの倍数を使用するかの選択と共に、選択論理17で扱われる。同様に、ビット単位反転によって、演算被乗数データ1Aの全64ビットを使用して演算被乗数データ1Aの1の補数を形成し、2進1を追加して、演算被乗数データ1Aの2の補数、または−1x乗数を形成するだけでよい。この場合も、選択論理17で「ホット1」を追加する。
Continuing with the description of FIG. 1, the
図1の説明を続けると、基数4ブース記録論理機能16は、一度に16ビットの乗数を使用し、8回の同時・重複3ビット走査を行って、8個の部分積を生成する。表3に、32ビット乗数を、完全に処理するために必要な16の走査の構成を示すために、2つのグループに分け、積み重ねた分解図を示す。この表で、Zは、この走査アルゴリズムに必要な17ビットのシーケンスを完結させ、16ビットより大きい倍数に対応可能にする、前述の重複ビット3(Z_BITとも示す)を示す。Z_BIT3を適切に設定することによって、ハードウェアは16ビットから成る任意のグループを、乗数2の全体を含むか一部を含むかを問わず、同様に扱うことができる。
Continuing with FIG. 1, the radix-4 booth
各3ビット走査の結果、3ビットの内部信号が生成される。ブースのデコードによって決まる、SXおよびS2Xで示す2つの変数が、各乗数の絶対係数を示す。すなわち、SXがアクティブの場合、1x乗数を使用し、特別な処置は必要としない。S2Xがアクティブの場合、演算被乗数1Aを左に一桁シフトし、LSBを埋めるためにゼロを挿入する。SXおよびS2Xは同時にアクティブになることができないことを理解されたい。さらに、SXとS2Xの両方が同時にアクティブでない状態は、選択論理17の0x乗数を示す。第3の内部制御信号SINVは、各走査ごとにブース・デコードによって決まる倍数の符号と等しい。正の倍数が生成される場合、SINVはゼロに設定され、特別な処置は不要である。負の倍数の場合、SINVは「1」に設定され、被乗数1Aの1の補数形式の1xおよび2x倍数が選択される。2の補数を完結させるために、アクティブなSINVは、現行部分積のLSBとして同じ列またはビット位置の次の部分積(すなわち、部分積配列内の次の行)に入れられる前述の「ホット1」として使用される。表4に、ブースのデコードの真理値表を示す。この実施態様は、負のゼロを実施しないことを理解されたい。すなわち、「111」bという3ビット走査によって、「000」bという同じ真のゼロデコードが生成される。真のゼロの効果は、部分積がゼロのシーケンスとなり、当然ながら、次意の積の「ホット1」がクリアされることである。
As a result of each 3-bit scan, a 3-bit internal signal is generated. Two variables, SX and S2X, determined by Booth decoding indicate the absolute coefficients of each multiplier. That is, when SX is active, a 1x multiplier is used and no special action is required. When S2X is active, the
被乗数倍数生成論理(たとえば12、13、14、および15)からの入力と、ブース記録論理16とを使用して選択論理機能17で生成された部分積配列の右端のドット表現を、表5に示す。この表から、15を超える入力(部分積ビットに桁上げを加えた入力)を必要とする圧縮構造を使用する列はないことがわかる。さらに、8回のみの走査では、8回の走査による「ホット1」から成る行9(部分積9、すなわちpp9)の列49を除けば、基本的に多くとも8個の部分積しかないことに留意されたい。都合のよいことに、その右側の列には積項が7個しかなく、これは、列50から列49に伝播する桁上げが1つ少ないことを示している。したがって、下位からの桁上げ(carry-in)が7個ある8:2の圧縮構造を使用する加算器18を使用し、pp9のホット1を、加算器18への桁上げとしてではなく9番目の入力として使用することによって、6個の桁上げのある9:2の圧縮構造を容易に形成することができる。言い換えると、前述の構造は両方とも、部分積ビットと桁上である厳密に15の入力を必要とし、合計ビットと上位への桁上げ(carry-out)である厳密に9個の出力を生成する。
Table 5 shows the input from the multiplicand multiple generation logic (eg, 12, 13, 14, and 15) and the rightmost dot representation of the partial product array generated by
一実施例では、結果としての合計と桁上げの結果を、任意選択によりレジスタ19および20にラッチしてから、桁上げ伝播加算器21で結合して、1つの最終モジュラ積を生成する。このモジュラ積とその16ビットの左シフト形式はマルチプレクサ22に送られる。マルチプレクサ22は、入力信号MTERM_SHIFTによって制御されて、現行演算のアルゴリズムに従ってモジュラ積を桁合わせのために左シフトする必要があるか否かを決定する。2進乗算器10の最終積出力を、本明細書ではMP_OUTで示す。
In one embodiment, the resulting sum and carry results are optionally latched in
サポート・ハードウェア
図2に、一実施例による3パイプライン・スーパースケーラ固定小数点プロセッサ・アーキテクチャ200の略ブロック図とデータの流れを示す。3本のパイプライン50は、それぞれXパイプ50a、Yパイプ50b、およびZパイプ50cとも呼ぶ。3本のパイプ50a、50b、および50cはそれぞれ、バスとインタフェースし、少なくとも2個の64ビット・オペランド・レジスタを含む。Xパイプ50aのオペランド・レジスタをA1およびB1(51および52)、Yパイプ50bのオペランド・レジスタをA2およびB2(53および54)、Zパイプ50cのオペランド・レジスタをA3およびB3(55および56)で示す。Xパイプ50aとYパイプ50bは両方ともそれぞれ、マルチプレクサ60および62を介してデータが供給される出力Cレジスタを有し、それぞれC157およびC258で示す。この2つの出力レジスタC157およびC258は、それぞれ、汎用レジスタ・ファイル90にデータを書き込むために使用される。汎用レジスタ・ファイル90は、REGISTER_DATAバスを介してオペランドレジスタにデータを供給する。オペランド・レジスタには、STORAGE_DATAバスによってオペランド・バッファ92を介してメモリからもデータを供給することができる。レジスタ・ファイルからは1回のサイクルで2つの値を書き込むことができ、4つの値を読み取ることができる。先行ゼロの検出や有効データの検査などのデータ処理を行うために、図示されていない追加の論理を組み込むこともできる。マルチプレクサ60および62にはそれぞれ、X50aおよびY50bパイプの、Bin164およびBin266で示す2進加算器ユニットと、Blu172およびBlu274で示すビット論理ユニットから、データが供給される。ビット論理ユニットBlu172およびBlu274には、それぞれrot176およびrot278で示すローテータからデータが供給される。ローテータrot176およびrot278は、ビット論理ユニットBlu172およびBlu274と共に使用し、マスキングを効果的に使用して、シフト操作にも使用される。説明を簡単・簡潔にするために、本明細書では、ビット論理ユニットあるいはBlu172またはBlu274と言う場合、ローテータrot176およびrot278と、ビット論理ユニットBlu172およびBlu274を含むものとみなすことがある。レジスタB152およびB254の内容は、それぞれ、Xパイプ50aおよびYパイプ50bの先行ゼロ検出論理82および84ともインタフェースし、早期終了のためにこの実施例のハードウェア・アーキテクチャ200で実施される一部の命令で使用される。
Supported Hardware FIG. 2 shows a simplified block diagram and data flow of a three-pipeline superscaler fixed-
Zパイプ50cは、一部の命令が情報を後で使用するために保持するために使用する、E59で示す第3の作業用レジスタを含む。一実施例では、図1に詳細に示す2進乗算器10が、固定小数点スーパースケーラ・アーキテクチャ200のZパイプ50c内に存在する。2進乗算器10には、A355で示す完全64ビット・レジスタから入力されるとともに、B3レジスタ56の最下位16ビットからも入力される。MP_OUTで示す乗算器の出力は、バッファ86でトライステート化され、Xパイプ50aの2進加算器Bin164の出力によって、C157レジスタに入力するマルチプレクサへの追加の入力が不要になる。
Z-
AレジスタおよびBレジスタ51〜56は、一部はREGISTER_DATAバスを介してレジスタ・ファイル90によって、STORAGE_DATAバスを介してオペランド・バッファ92によって、また、命令テキストの即値フィールドから取り出されたデータを受け取るIMMEDIATE_DATAバスを介して命令自体に含まれているデータによってデータ供給されるバス網から入力を入手する。STORAGE_DATAとIMMEDIATE_DATAは事前桁合わせされているため、オペランドが作業レジスタAおよびB(51〜56)に到着した後は、それらのオペランドはデータの供給源にかかわらずすべて同じに扱われることを理解することが重要である。
The A and B registers 51-56 receive data retrieved, in part, by the
本明細書では、乗算器10と共に動作するプロセッサ・アーキテクチャ200の一実施態様について述べることを理解されたい。いくつかの重要な機能を備える限り、その他の構成も可能である。そのような機能の1つは、必ずしも同時である必要はないが乗数2と被乗数1を回転させて、適切なサブグループを適切なサブグループ処理のための適切な場所に配置することができる機能である。他の機能は、モジュラ積を累算して1つの最終項とすることができる機能である。
It should be understood that this specification describes one embodiment of a
乗算方法
上述の乗算のモジュラ的性質のため、特定のアーキテクチャおよび環境において選択された演算を実施するために多くのアルゴリズムを考えることができることがわかるであろう。本明細書では、前述の固定小数点スーパースケーラ・プロセッサの環境において実施される演算に関する方法について説明する。この方法は、乗算器10の使用の特定の利点と、図2に示すサポート・ハードウェアにおいて利用可能な機能を明確に示す。
Multiplication Method It will be appreciated that, due to the modular nature of multiplication described above, many algorithms can be envisaged to perform selected operations in a particular architecture and environment. Described herein are methods relating to operations performed in the context of the aforementioned fixed-point superscalar processor. This method clearly illustrates the particular advantages of using
図3を参照すると、一実施例による乗算プロセス200の高水準概要図が示されている。このプロセスは、どの特定の乗算を実行するかを示す命令情報と、その演算の被乗数および乗数として使用される2オペランド・データとを、入力として受け取る。この命令情報は、ここでは制御論理と呼ぶ、論理のグループに送られ、異なるタイプの乗算命令の実施のために使用されるアルゴリズムに基づいて、データフロー・ハードウェアを制御して、1サイクルごとに必要な機能を実行するのに必要な場所にデータをルーティングし、最終積を求める。この実施態様では、MCAND_64、UNSIGNED、およびMTERM_SHIFTの各制御信号が生成される。命令情報は、プロセス210を制御して、オペランド・データを適切に回転またはシフトさせ、サイクル別または命令別に適切な被乗数1サブグループまたは乗数2サブグループあるいはその両方を得ると同時に、1のストリングの検出に必要な、連続性を持たせるために乗算器と共に使用される適切なZ_BITを獲得する。この特定の実施態様は、一部の乗算命令のために制御論理に早期終了情報を提供するための、乗数データ2で使用する先行ゼロおよび先行1検出機能も備える。
Referring to FIG. 3, a high-level schematic diagram of a
図3の乗算器10は、被乗数データ1と乗数データ2とを入力として受け取る。乗数データ2は、Z_BIT3で示す入力重複ビットと共に、プロセス・ブロック214で走査グループに区分化される。この実施例では、Z_BITと共に16ビットの乗数データをそれぞれ3ビットの8個の重複走査グループに区分化するが、適切なサポート、すなわち、被乗数倍数の設定、記録、倍数のための選択論理などを使用して、他の乗数および走査グループ幅も可能である。プロセス・ブロック218で、乗数データ2は、基数4ブース・アルゴリズムに従って記録される。次に、被乗数1に移って説明すると、プロセス・ブロック212で、制御信号MCAND_64 4およびUNSIGNED5がデコードされ、この2進乗算が符号付きか符号なしかを判断するか、あるいは、この実施例では、被乗数1が32ビットか64ビットかを判断する。プロセス・ブロック214で、被乗数1の選択された倍数、たとえば0x、±1x、および±2xを生成する。
The
図3の説明を続けると、プロセス・ブロック220で、前述のようにSX、S2X、およびSINVの8個のグループに区分化された乗数2とZ_BIT3のプロセス・ブロック218でのブース記録の結果に基づいて、プロセス・ブロック218から被乗数1の所望の倍数を選択し、ゼロを適切に右付加して、部分積を生成する。プロセス・ブロック222で、これらの部分積を合計して1個のモジュラ積を生成する。最後に、プロセス・ブロック224で、制御信号MTERM_SHIFT6に基づいて必要/可能な場合は、モジュラ積出力をシフトし、それによって、プロセス・ブロック250において他のモジュラ積と結合するために、当該モジュラ積を適切に桁合わせする必要をなくす。このブロックでは、加算ハードウェア、シフト/回転ハードウェア、ホールド・パス、フィードバック・パス、および作業レジスタを使用し、制御論理ブロック210で制御し、モジュラ積を適切に結合して最終の正しい積を生成する。この方法では、このブロックの異なる構成を使用してモジュラ積を処理することもできる。
Continuing with FIG. 3, at
本発明のこの実施例で実施したいくつかの乗算命令について、以下に詳述する。図4、図5、および図6を参照すると、図2に示す前述のハードウェアと、実行プロセス200と、乗算器ハードウェア10とを使用した乗算演算および関連する実行アルゴリズムを示す略図が示されている。この乗算アルゴリズムは、サイズの異なるオペランドを含む様々なタイプの乗算を扱うように構成されている。
Some of the multiply instructions implemented in this embodiment of the present invention are detailed below. Referring to FIGS. 4, 5 and 6, there is shown a schematic diagram illustrating the multiplication operation and associated execution algorithm using the hardware described above, the
異なるサイズの被乗数による演算
図4を参照すると、様々なサイズの被乗数1を使用した一実施態様を示す例が図示されている。一実施例では、乗算器10は、16ビット×64ビットの有損失2進乗算を処理して、可能な80ビットの下位64ビットを生成するように構成されている。これによって、ハードウェア・アーキテクチャ200は、積の下位32ビットが生成される16ビット×32ビットの演算と、積の下位64ビットが生成される16ビット×64ビットの演算とを同じサイクル数で処理することができる。MCAND_64を32ビット演算の場合はゼロに設定し、64ビット演算の場合には1に設定することによって、同じアルゴリズムを使用して両方のタイプの乗算演算を容易に行うことができる。必要な追加の変更は、結果を記憶しておくことだけである。制御は、最初の演算、たとえば16ビット×32ビット乗算については32ビット・ワードに設定し、後の演算、たとえば16ビット×64ビット乗算については完全長に設定する。
Operation with Multiplicands of Different Sizes Referring to FIG. 4, an example is shown illustrating one
たとえば図4で、1つのプロセッサのための一群の命令、たとえば、被乗数にハーフワードを乗じる乗算のために使用されるMH、MHI、およびMGHIは、前述の特徴を十分に活用する。命令MHおよびMHIは両方とも、32ビットの積を生成し、それぞれ、その被乗数を汎用レジスタ(GPR)90から入手する。しかし、MHIは、その乗数データを、命令テキストの一部である即値フィールドとして入手するのに対し、MHはその乗数を、GPR90から入手する。同様に、命令MGHIは、その64ビットの被乗数データをGPR90から受け取り、その乗数データを命令テキストの即値フィールドから受け取る。乗算ハーフワード即値ファミリは、乗数入力として即値データを保持する命令テキストの16ビット・フィールドをとる有損失命令のセットである。図には、乗数を1つのサブグループに含めることができ、被乗数も、結果が有損失性であるため、1つのサブグループに含めることができ、その結果、乗算ハードウェアによる1回の反復実行で済む様子が示されている。以下の表6に、乗数データ2および被乗数データ1に対する1サイクル・プロセスの例と、Xパイプ50A、Yパイプ50B、Zパイプ50c、および乗算器10との相互作用を示す。サイクル1で、表中でM1で示されている乗数データ2と、表中でm1で示されている被乗数データ1が、それぞれZパイプ50cのA355およびB356レジスタに入力される。1サイクルの待ち時間後に、この例では最終積でもある、mp1で示すモジュラ積が、この演算の最終サイクルとみなされる2回目のサイクルで乗数MP_OUTの出力として示され、次のサイクルで記憶域に入れられる。表中で使用されている構文に注目されたい。レジスタが、被乗数1および乗数2オペランド値をそれぞれ指定する「mcand」値または「mplier」値を受け取るという場合、これらの値がデータ・バスから入来することを意味する。この実施態様の場合も、乗数入力はレジスタB356の最下位16ビットから入力される。適切な乗数サブグループを入手するのに、必要なサブグループが最下位ハーフワード位置になるように乗数データを回転またはシフトするだけでよい。
For example, in FIG. 4, a group of instructions for one processor, such as MH, MHI, and MGHI used for multiplication of a multiplicand by a halfword, take full advantage of the foregoing features. Instructions MH and MHI both produce a 32-bit product, each of which obtains its multiplicand from general purpose register (GPR) 90. However, the MHI obtains its multiplier data as an immediate field that is part of the instruction text, while the MH obtains its multiplier from the
サイクルe1で、レジスタA355およびB356にラッチされたオペランド・データ(それぞれmcandおよびmplier)が、2進乗算器10に渡され、A3レジスタ55からのデータを使用して、被乗数データ1が生成され、B3レジスタ56からのデータを使用して乗数データ2が生成される。M1として示されているA3レジスタ55からのデータは、制御信号MCAND_64およびunsigned5に従って変更され、有効被乗数が生成される。次に、図1について前述したように、この有効被乗数をシフトし、補数をとって処理し、±1xおよび±2x被乗数倍数を生成する。一方、この実施例では、B3レジスタ56の右端の16ビットからの乗数データ1と、右に付加された重複ビットZ_BIT3から成る第1のサブグループにも何らかの処理が施される。重複ビットは、この場合、これが最下位(かつ唯一の)サブグループであるため、ゼロである。この17ビット・ストリングが、図1のブース記録論理によって8個の3ビット・グループ(2ビット+1重複ビット)に分解され、各3ビット走査グループについて被乗数の1x倍数と2x倍数のいずれを選択するかを示す8個の2ビット信号(前述のSXおよびS2X信号)が生成され、当該グループの部分積のために負の倍数を選択するか否かを示すとともに、負の倍数の場合は、被乗数の負の倍数を生成するために使用される(数値の補数をとる処理と「1」を加える処理を含む)2の補数をとる処理を完結させるために、入力された「ホット1」を次の走査グループの部分積に供給する、8個の1ビットSINV信号から成るもう一つのグループが生成される。同じサイクルで、8個の部分積と、8個の3ビット走査グループのブース記録の結果としての8番目のグループからの1個の「ホット1」入力とが、加算器18(図1)で結合されて、2つの冗長64ビット合計および桁上げ項に圧縮され、図1の構造20および19である合計レジスタおよび桁上げレジスタにラッチされる。
At cycle e1, the operand data (mcand and mplier, respectively) latched in registers A355 and B356 are passed to
サイクル2で、前記の合計レジスタおよび桁上げレジスタ20および19からのそれぞれのデータが加算器21によって1つにされる。この出力と、その16ビット左シフトされた形式とが、図1のマルチプレクサ22に入力され、入力制御信号MTERM_SHIFT6を使用して、2つのうちのいずれか選択される。このサイクルの最初のモジュラ積mp1である乗算器の出力MP_OUTが、図2の2進加算器64の出力でトライステート・バッファ86の出力として選択され、マルチプレクサ60を通してC1レジスタ57にラッチされる。これは、演算の最終結果に達したため、この命令の最終実行サイクルとみなされる。
In
乗算ハードウェアを複数幅の被乗数を処理するように実施することによって、わずかな制御上の変更を加えた実質的に同じアルゴリズムを使用して、入来オペランド・データを事前フォーマットする必要なしに、異なる被乗数幅の乗算が処理される。被乗数データ1のフォーマットは、2進乗算器10の内部で適切に処理され、単に2つの信号のみによって制御される。この信号の一方は、被乗数の長さを示す信号、たとえばMCAND_64であり、他方はオペランドが符号付きであるか符号なしであるかを示す信号、たとえばUNSIGNED5であり、この特定の実施例では前者の信号を示した。
By implementing the multiplication hardware to handle multi-width multiplicands, it is possible to use substantially the same algorithm with minor control changes, without having to preformat the incoming operand data. Multiplications of different multiplicand widths are processed. The format of the
1命令当たりサイクル数の削減
本開示の各実施態様の柔軟性を示す他の例は、MSGおよびMSGRアルゴリズムの実施態様に基づくものである。両者は、64ビットの有損失積を生成する64×64演算であり、相違点は、MSGRがその乗数データ2を汎用レジスタ、たとえばレジスタ・ファイル90から入手するのに対し、MSGはそのデータを、この実施態様では、オペランド・バッファ92を介してメモリから入手することである。有損失64ビット結果を得るために、制御信号MCAND_64 4が1に設定される。このアルゴリズムのサイクルごとの動作を、以下の表7に示し、命令サブグループ処理順序を図5に示す。この図には、乗数が4個の乗数サブグループに分割されている様子が示されており、この演算は有損失演算であるため、完全な最初のオペランドが64ビット被乗数データとして保持される。
Reducing Cycles per Instruction Another example that illustrates the flexibility of embodiments of the present disclosure is based on implementations of the MSG and MSGR algorithms. Both are 64 × 64 operations that generate a 64-bit lossy product, with the difference that MSGR obtains its
図1および図2を再度参照すると、サイクル1(e1で示す)で、MSG/MSGRは、64ビット×64ビット命令であるため、完全被乗数データ1が、この場合は唯一のグループである、有効被乗数サブグループM1を形成する。2進乗算器10への乗数データ入力2は、被乗数1よりも短く、この場合もB3レジスタ56から16ビットの最下位乗数データを入手して、ここではm1とも呼ぶ第1の乗数サブグループを生成する。被乗数「サブグループ」M1と乗数サブグループm1は、前述の例と同様にして2進乗算器10によって処理され、このサイクルの終わりに冗長合計および桁上げ項が、合計レジスタ20および桁上げレジスタ19にそれぞれラッチされる。同時に、Xパイプ50Aでは、A1レジスタに事前に入力されていた完全乗数が、ビット論理ユニット72に入れられ、回転されて、第2の乗数サブグループ(以下、m2と呼ぶ)、たとえば元の乗数のビット32ないし47が、データ・フィールドの右端の位置(ビット48ないし63)に配置される。次に、BLU172の出力は、次のサイクルで使用するために、このサイクルの終わりにレジスタA253およびB354にラッチされる。
Referring again to FIGS. 1 and 2, in cycle 1 (denoted by e1), the MSG / MSGR is a 64-bit × 64-bit instruction, so
サイクル2では、前のサイクルでのM1とm1の乗算の結果を保持する合計レジスタ20および桁上げレジスタ19が結合されて、2進乗算器10の第1の出力としてモジュラ積mp1が生成される。このモジュラ積mp1も、次のサイクルで使用するためにこのサイクルの終わりにB2レジスタ54に入力としてラッチされる。一方、乗算器は、サブグループM1*m2を処理しており、その結果を、やはり合計レジスタ20および桁上げレジスタ19に入れる。Yパイプ50Bで、A2レジスタ53に保持されているm2乗数がやはり回転され、第3の乗数サブグループm3がデータ経路の最下位位置に配置される。この場合も、この新しい乗数サブグループm3は、次のサイクルで使用するためにB3レジスタ56に入力される。
In
サイクル3では、それぞれ前のサイクルでのM1とm2の乗算の結果を保持する合計レジスタ20および桁上げレジスタ19が結合され、次のモジュラ積(以下mp2と呼ぶ)が生成され、16ビット左にシフトされ、モジュラ積mp1との結合に備えて桁合わせされる。シフトされたモジュラ積mp2は、次のサイクルで使用するためにレジスタA2にラッチされる。一方、2進乗算器10は、サブグループM1*m3を処理し、その結果の積を合計レジスタ20および桁上げレジスタ19に入れる。Yパイプ50Bで、前のサイクルでB3レジスタ56から入力されたm2乗数が、m4で示す第4の乗数サブグループ(たとえば元の乗数値のビット0ないし15)が、データの最下位16ビット位置にくるように回転される。その結果は、次のサイクルで使用するためにB3レジスタ56に入力される。
In
サイクル4では、前のサイクルでのM1とM3の乗算の結果を保持する合計レジスタ20および桁上げレジスタ19が結合され、モジュラ積mp3が2進乗算器10の第3の出力として生成され、シフトせずにマルチプレクサ22に通され、次のサイクルで使用するためにB2レジスタ54にラッチされる。一方、モジュラ積mp1およびmp2をそれぞれ保持するA2レジスタ53およびB2レジスタ54が、BIN266で加算され、累算モジュラ積mp1:2が生成されて、Eレジスタ59に入力され、後で使用するために保持される。
In
サイクル5では、前のサイクルでのM1とm4の乗算の結果を保持する合計レジスタ20および桁上げレジスタ19が結合されて、これらの命令の第4かつ最終のモジュラ積である、mp4で示すもう一つのモジュラ積が生成され、モジュラ積mp3との結合での桁合わせのために、左シフトされてマルチプレクサ22から出力される。シフトされたモジュラ積mp4は、次のサイクルで使用するためにA2レジスタ53の入力に入力される。
In
サイクル6では、A2レジスタ53とB2レジスタ54のそれぞれの内容である、mp3と左シフトされたmp4とが、Yパイプ50Bの2進加算器Bin266で加算され、累算mp3:4項が生成される。これはその後、次のサイクルで使用するためにA2レジスタ53に入力される。一方、Eレジスタ59に保持されているmp1:2項が、後で使用するためにB2レジスタ54に入力される。
In
サイクル7では、A2レジスタの内容、たとえば累算モジュラ積mp3:4が32ビット左にシフトされ、図4に示すようにmp1:2項との加算に備えて桁合わせされる。この桁合わせは、ビット論理ユニットBLU274で行われ、mp3:4がBLU274を通されて、シフトされ、シフトされた結果(mp3:4)が、次のサイクルで使用するためにA2レジスタ53にフィードバックされる。 In cycle 7, the contents of the A2 register, e.g., the accumulated modular product mp3: 4, are shifted 32 bits to the left and aligned as shown in FIG. 4 in preparation for addition with the mp1: 2 term. This alignment is performed in bit logic unit BLU 274, where mp3: 4 is shifted through BLU 274 and the shifted result (mp3: 4) is fed back to A2 register 53 for use in the next cycle. Is done.
最後に、サイクル8で、それぞれA2レジスタ53およびB2レジスタ54の内容である、32ビットシフトされた累算モジュラ積(mp3:4)とmp1:2が、2進加算器BIN266で結合されて、この最後の実行サイクルでの最終積mp1:4が生成される。この最終結果の積は、次のサイクルに取っておくためにC258レジスタに入力される。
Finally, in cycle 8, the 32-bit shifted accumulated modular product (mp3: 4) and mp1: 2, the contents of
具体的に(mp1,mp2)および(mp3,mp4)として示すモジュラ積の対の場合、図1の乗算器10の最後でマルチプレクサ22とシフタ6を使用してモジュラ積を16ビット左にシフトすることによって、処理サイクルが節約されるので有利であることが表7から容易にわかる。このようにしない場合、シフトされていないモジュラ積(mp2またはmp4)は、Xパイプ50AまたはYパイプ80Bに戻し、シフトし、次に、それを他のモジュラ積(それぞれmp1およびmp3)と結合することになり、これは、シフトに必要な1処理サイクルではなく2処理サイクル使用することになる。
Specifically, in the case of a pair of modular products shown as (mp1, mp2) and (mp3, mp4), the modular product is shifted left by 16 bits using the
図2に示すサポート・ハードウェアのこの特定の実施態様の既存の機能を、乗算器ハードウェア10およびプロセス200と共に使用したことによって、処理サイクルが節約され、具体的には、既存の先行ゼロ検出機能、たとえば82および84(図2)を使用せずに済む。大きなオペランドを使用するが実際の乗数値の絶対値が小さい乗算の場合の早期終了論理を完全にサポートするために、先行1検出をサポートするように先行ゼロ検出機能82および84にわずかな変更を加えることができる。
The use of the existing features of this particular embodiment of the support hardware shown in FIG. 2 in conjunction with the
一例として、1回乗算(64ビット)命令に戻ると、この命令対は、乗数サイズに関して早期終了に最適であることが容易にわかるであろう。乗数データは右から左に処理されるため、このアルゴリズムを、乗数データのサイズに対応する有利な箇所で終了させることができる。たとえば、乗数データが(0x000ないし0x7fff)、または(0xFFFFffffFFFF8000)ないし(0xFFFFffffFFFFffff)の範囲である場合、乗数データは本質的に、m1によって表現可能であり、サイクルe3の後で実行を終了することができ、その時点で、B2レジスタ54に保持されているモジュラ積mp1を最終出力としてC2レジスタ58にルーティングすることができ、これによって、図の全8サイクルではなく有効サイクル数3で乗算を完了することができる。同様に、このような手っ取り早い方法は、異なる有効長の乗数データを使用して容易に実施することができ、有効長15、31、32、47、および48ビットの乗数(すなわち絶対値をこれらのビット数で完全に表現することができる)の場合、それぞれ3、4、5、6、および7サイクルという実行サイクル数が可能になる。最初の2つの早期終了の場合の実行表を、表8と表9にそれぞれ、示す。ここには、乗算器処理サイクル毎のレジスタの内容が、示されている。
Returning to a single multiply (64 bit) instruction as an example, it will be readily apparent that this instruction pair is optimal for early termination with respect to multiplier size. Since the multiplier data is processed from right to left, the algorithm can be terminated at an advantageous point corresponding to the size of the multiplier data. For example, if the multiplier data is in the range (0x000 to 0x7fff), or (0xFFFFffffFFFF8000) to (0xFFFFffffFFFFffffff), the multiplier data can be essentially represented by m1, and execution may be terminated after cycle e3. At that point, the modular product mp1 held in the
ブースのアルゴリズムを使用して符号なし乗算を行う場合、部分積を減らす方法がストリング検出に基づいているために付加する必要がある、本明細書でモジュラ積補正(mpc)項と呼ぶ補正項がある場合がある。ストリングの終わり(最上位ビット)に来ることは、計算の終わりを意味しない。符号なし乗算では、常に、MSBを超える、1または複数の「0」b値の暗黙的ビットが存在する。乗数のMSBが0の場合、MSBの左側のこのような暗黙ビットは、ゼロの連続ストリングを示し、何の処置も行われない。しかし、左にゼロが付加された「1」bのMSBは、ストリングの終わりに達したことを示し、3ビット走査の場合、これらのビットは「001」bであり、補正のLSBが乗数のMSBの左の1ビットになるように、結果に付加して桁合わせしなければならない+1x被乗数倍数を表す(図6参照)。32ビットで完全に表現可能な乗数による演算が、最終積に補正を組み込む必要があるために31ビットで完全に表現可能な乗数による演算よりも1サイクル多く要する理由である。命令の実施形態および資源に応じて、このmpc項の追加をアルゴリズムに組み込んでも組み込まなくてもよい。 When performing unsigned multiplication using the Booth algorithm, a correction term, referred to herein as a modular product correction (mpc) term, which must be added because the method of reducing partial products is based on string detection. There may be. Coming to the end of the string (most significant bit) does not mean the end of the computation. In unsigned multiplication, there will always be one or more implicit bits of the "0" b value that exceed the MSB. If the MSB of the multiplier is 0, such implicit bits to the left of the MSB indicate a continuous string of zeros and no action is taken. However, the MSB of "1" b with zeros added to the left indicates that the end of the string has been reached, and for a 3-bit scan these bits are "001" b and the LSB of the correction is the multiplier LSB. Represents a + 1x multiplicand multiple that must be added to the result and aligned to be one bit to the left of the MSB (see FIG. 6). This is why an operation with a multiplier that can be completely represented by 32 bits requires one cycle more than an operation with a multiplier that can be completely represented by 31 bits because it is necessary to incorporate correction into the final product. Depending on the embodiment and resources of the instruction, this additional mpc term may or may not be incorporated into the algorithm.
実施例の利点および柔軟性の他の例は、128ビットの結果を生成する論理64ビット×64ビット無損失(たとえば桁上げを考慮に入れ、対処する場合)乗算命令の使用に基づく。図6を参照すると、積の無損失性のために、制御信号MCAND_644をゼロに設定して、生成されたすべてのモジュラ積も無損失として設定されるようにする必要がある。図6では、乗数は4個の乗数サブグループに分割されているが、64ビットの被乗数データは2個のサブグループに分割されて、16ビット×32ビット乗算が作成され、有損失結果を回避する様子が図示されている。表10に、本発明の一実施例におけるMLG/MLGRの実施態様におけるハードウェアの使用を示す。表10には、乗算器処理サイクル毎のレジスタの内容が示されている。 Another example of the benefits and flexibility of the embodiment is based on the use of a logical 64-bit x 64-bit lossless (eg, taking into account and taking into account carry) multiply instruction that produces a 128-bit result. Referring to FIG. 6, for lossless product, the control signal MCAND_644 must be set to zero so that all generated modular products are also set as lossless. In FIG. 6, the multiplier is divided into four multiplier subgroups, but the 64-bit multiplicand data is divided into two subgroups and a 16-bit × 32-bit multiplication is created to avoid lossy results Is illustrated. Table 10 shows the use of hardware in an MLG / MLGR implementation in one embodiment of the present invention. Table 10 shows the contents of the registers for each multiplier processing cycle.
サイクルe1で、2進乗算器10は、Xパイプ50Aにある間にサブグループM1*m1を処理し、ビット論理ユニットBLU172が乗数データ2を回転させて、第2の乗数サブグループm2を生成する。この乗数サブグループm2は、次のサイクルで使用するためにA2レジスタ53およびB3レジスタ54にラッチされる。
At cycle e1,
サイクル2で、2進乗算器10は乗数サブグループM1*m2を処理し、M1*m1の結果をモジュラ積項mp1に圧縮し終わり、次のサイクルで使用するためにB2レジスタ54に入力する。Yパイプ50Bで、(前のサイクルからの)A2レジスタ53の内容m2をBLU274で回転して、乗数サブグループm4を生成し、後で使用するためにEレジスタ59にラッチされる。レジスタA253は、次のサイクルで使用するためにバスから被乗数データmcandを入力する。
In
サイクル3で、2進乗算器10は、M1*m2の結果を圧縮し終わり、結果を16ビット左にシフトして、モジュラ積項mp2を後でmp1と結合するために桁合わせし、それを次のサイクルで使用するためにA2レジスタ53に入力する。レジスタB356は、そのm2データを後で使用するために保持する。一方、Yパイプ50Bで、ビット論理ユニットBLU274が、被乗数データを回転させて、第2の被乗数サブグループM2を生成し、次のサイクルで使用するためにレジスタA355に入力する。
At
サイクル4で、2進乗算器10は、サブグループM2*m2を処理する。Eレジスタ59の内容m4が、次のサイクルで使用するためにB3レジスタ56に供給され、A3レジスタ55がバスから被乗数データを入手し、次のサイクルでマルチプレクサで使用するためにサブグループM1を生成する。
In
サイクル5で、2進乗算器10は、サブグループM1*m4を処理し、M2*m2の結果の圧縮を終え、それを16ビット左にシフトしてモジュラ積mp3を生成し、それを後で使用するためにB2レジスタ53に入力する。Yパイプ50Bにおいて、レジスタA253とレジスタB254の内容を加算して結合モジュラ積mp1:2を生成し、後で使用するためにZパイプ50CのEレジスタ59に入力する。
At
サイクル6で、2進乗算器10は、M1*m4の結果の圧縮を終え、その結果を16ビット左にシフトしてモジュラ積mp4を生成し、その結果を、次のサイクルで使用するためにレジスタA253に入力する。Xパイプ50AのレジスタA151が、次のサイクルで使用するためにバスから被乗数値を入力する。
At
サイクル7で、BIN266が、前にレジスタA253に入力したmp4データと前にB254に保持したmp3データとを加算して、結合モジュラ積mp3:4を生成し、後で使用するためにA253に入力する。一方、Xパイプ50Aで、BLU172が、レジスタA151からmcandデータを入手し、それを回転して第2の被乗数サブグループM2を生成し、次のサイクルで使用するためにA355に入力する。レジスタA151が、次のサイクルで使用するために、バスから乗数を入力する。レジスタB356も、次のサイクルで第1のサブグループm1を使用するために、バスから乗数値をラッチする。 At cycle 7, BIN 266 adds the mp4 data previously input to register A253 and the mp3 data previously stored in B254 to generate a combined modular product mp3: 4, which is input to A253 for later use. I do. On the other hand, at X pipe 50A, BLU 172 obtains mcand data from register A151, rotates it to generate a second multiplicand subgroup M2, and inputs it to A355 for use in the next cycle. Register A 151 receives a multiplier from the bus for use in the next cycle. Register B356 also latches a multiplier value from the bus to use the first subgroup m1 in the next cycle.
サイクル8で、乗算器は、サブグループM2*m1を処理し、次のサイクルで第1の被乗数サブグループM1を使用するために被乗数をA3レジスタ55にラッチする。Xパイプ50Aで、A1レジスタ51に保持されている乗数を回転させて、第3の乗数サブグループm3を生成し、次のサイクルで使用するためにレジスタB356にラッチする。
At cycle 8, the multiplier processes the subgroup M2 * m1 and latches the multiplicand into the
サイクル9で、乗算器は、サブグループM1*m3を処理し、M2*m1の結果の処理を終えてモジュラ積mp5を生成し、次のサイクルで使用するためにB2レジスタ54にラッチする。レジスタB356は、後で使用するためにそのm3値を保持する。
At cycle 9, the multiplier processes the subgroup M1 * m3, finishes processing the result of M2 * m1, generates a modular product mp5, and latches it in the
サイクル10で、乗算器は、M1*m3の処理を終えてモジュラ積mp6を生成し、次のサイクルで使用するためにB2レジスタ54にラッチする。一方、Yパイプ50Bでは、2進加算器BIN266がA2レジスタ53とB2レジスタ54のそれぞれの内容であるmp3:4とmp5を加算して、結合モジュラ積3:5を生成している。Xパイプ50Aで、A1レジスタ51が、次のサイクルで使用するためにバスから被乗数をラッチする。
At
サイクル11では、Yパイプ50Bにおいて、BIN266がレジスタA253とレジスタB254の内容を加算して結合モジュラ積3:6を生成する。Xパイプ50Aでは、BLU172が、レジスタA151内の乗数データを処理して第2の被乗数サブグループM2を生成し、後で使用するためにレジスタA355に入力する。
In
サイクル12では、Zパイプ50Cにおいて、値M2およびm3が、次のサイクルで使用するためにA3レジスタ55とB3レジスタ56に保持される。一方、Yパイプ50Bでは、前のサイクルでBIN266から入力されたレジスタA253内のmp3:6データがBLU274で回転され、それによって、ロウ32ビットワードがハイ32ビットワードと交換され、他のモジュラ積と桁合わせして結合し、128ビットの最終結果を生成するのに必要な回転モジュラ積rmp3:6が生成される。B2レジスタ54は、Eレジスタ59からのmp1:2データを次のサイクルで使用するためにラッチする。Xパイプ50Aでは、次のサイクルで使用される可能性に備えて、被乗数がA1レジスタ53に入力される。
In
サイクル13で、乗算器は、サブグループM2*m3を処理する。Yパイプ50Bで、回転されたモジュラ積rmp3:6が、そのロウワードがゼロ設定されて、mp1:2と結合され、結果のクワッドワードの最下位ダブルワードが生成される。これは、次のサイクルに取っておくためにレジスタC258にラッチされる。レジスタA253は、次のサイクルで使用するために乗数データをバスから入力する。一方、Xパイプ50Aでは、乗数データの最上位ビットがたまたま「1」ビットである場合という条件付きで、被乗数データが、回転されたモジュラ積rmp3:6のロウワードに加えられ、補正されたモジュラ積cmp3:6が生成される。この結果は、後で使用するためにB2レジスタ54に入力される。
At
サイクル14で、2進乗算器10は、M2*m3の結果を圧縮し終わってモジュラ積mp7を生成し、次のサイクルで使用するためにレジスタB254に入力される。Zパイプ50CのA3レジスタ55が、次のサイクルで使用するためにそのM2値を保持する。レジスタA253内にある乗数データがBLU274を通され、第4の乗数サブグループm4が生成され、次のサイクルで使用するためにレジスタB356にラッチされる。
At cycle 14,
サイクル15で、2進乗算器10はサブグループM2*m4を処理する。Yパイプ50Bで、BIN266は、A2レジスタ53内のモジュラ積mp7と、補正されたモジュラ積cmp3:6とを結合してmp3:7を生成し、これは、次のサイクルで使用するためにA2レジスタ53にラッチされる。
At cycle 15,
サイクル16で、2進乗算器10は、M2*m4の結果の圧縮を終え、その結果を16ビット左にシフトし、モジュラ積mp8を生成し、これは次のサイクルで使用するためにレジスタA151に入力される。レジスタA252内のmp3:7データがBIN266を通され、次のサイクルで使用するためにレジスタB254に入力される。
At
実行の最終サイクルであるサイクル17で、レジスタA151内のデータとレジスタB152内のデータが結合され、補正がすでに加えられた最終結果の最上位ダブルワードが生成される。これは、次のサイクルにとっておくためにレジスタC157にラッチされる。
At
上記の例では、ハードウェアを無損失乗算でどのように使用することができるかを示した。 The above example has shown how hardware can be used in lossless multiplication.
有利には、無損失命令を使用する上記の実施例は、乗数2と被乗数1が実際のハードウェア・データ経路よりもはるかに大きい場合のデータを処理するように、実施例の乗算器10を容易に設定することができることを示している。図6は、モジュラ積を異なる組合せで計算することもできることを示している。図示されている特定の順序は、これらの演算を実施する多くの方法の1つに過ぎないことがわかるであろう。たとえば、ハードウェアが即時シフト・アウトと、最終積を計算したら直ちに格納する機能とをサポートしている場合、それを行うために、mp5:mp6の順序をmp3:mp4と交換することもできる。あるいは、MSG/MSGRなどの命令の実施に関して前述した実施例と同様に、特定の演算の早期終了をサポートするには、乗数2を右から左に処理するように順序を調整することができる。乗算サブグループのこのような「アウト・オブ・オーダー」処理により、最終的には、たとえば、柔軟性のある、高性能な中規模乗算ハードウェアが実現される。
Advantageously, the above embodiment using lossless instructions allows the
本開示の発明は、コンピュータ、制御装置、またはプロセッサ100実施方法およびそのような方法を実行する装置の形態で実施することができる。また、本発明は、フロッピィ(R)・ディスケット、CD−ROM、ハード・ドライブ、まはその他の任意のコンピュータ可読記憶媒体など、有形な媒体102に実現された命令を含むコンピュータ・プログラム・コードの形態で実施することもでき、該コンピュータ・プログラム・コードが、コンピュータ、制御装置、またはプロセッサ100にロードされ、実行されると、該コンピュータ、制御装置、またはプロセッサ100が、本発明を実施する装置となる。また、本発明は、たとえば、記憶媒体に記憶され、コンピュータ、制御装置、またはプロセッサ100にロードまたは実行されるか、あるいは、電子配線またはケーブル、光ファイバ、電磁放射などの何らかの伝送媒体を介して伝送されるかを問わず、データ信号103としてのコンピュータ・プログラム・コードの形態で実施することもでき、その場合、該コンピュータ・プログラム・コードがコンピュータにロードされて実行されると、該コンピュータは本発明を実施する装置になる。汎用プロセッサ100上で実施した場合、コンピュータ・プログラム・コード・セグメントは、特定の論理回路を構築するようにプロセッサを設定する。
The invention of this disclosure may be embodied in the form of a computer, a controller, or a method of implementing
類似の要素を示すための第1、第2、またはその他の同様の表記は、別段の明記がない限り、特定の序列を規定または含意するものではないことを理解されたい。 It should be understood that first, second, or other similar designations for indicating similar elements do not define or imply a particular order, unless explicitly stated otherwise.
以上、本発明について実施例を参照しながら説明したが、本発明の範囲から逸脱することなく、様々な変更を加えることができ、その各要素の代わりに同等物を使用することもできることが、当業者ならわかるであろう。さらに、本発明の基本的な範囲から逸脱することなく、特定の状況または材料を本発明の教示に適合させるために、多くの修正を加えることができる。したがって、本発明は、本発明を実施するために企図された最良の形態として開示した特定の実施態様には限定されず、本発明は、特許請求の範囲に含まれるすべての実施態様を含む。 As described above, the present invention has been described with reference to the embodiments. However, various modifications can be made without departing from the scope of the present invention, and equivalents can be used instead of the respective elements. Those skilled in the art will understand. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the invention without departing from the essential scope thereof. Accordingly, the invention is not limited to the specific embodiments disclosed as the best mode contemplated for carrying out the invention, but the invention includes all embodiments falling within the scope of the appended claims.
1 被乗数
2 乗数
3 重複ビット
4 MCAND_64制御信号
5 UNSIGNED制御信号
6 MTERM_SHIFT制御信号
10 乗算器
11 被乗数ハイワード変換
12 被乗数入力マージ(被乗数倍数生成論理)
13 左シフタ(被乗数倍数生成論理)
14 1の補数モジュール(被乗数倍数生成論理)
15 1の補数モジュール(被乗数倍数生成論理)
12 被乗数倍数生成論理
13 被乗数倍数生成論理
14 被乗数倍数生成論理
15 被乗数倍数生成論理
16 ブース記録論理
17 選択論理
18 加算器
19 桁上げレジスタ
20 合計レジスタ
21 桁上げ伝播加算器
22 マルチプレクサ
50a パイプライン
50b パイプライン
50c パイプライン
51 オペランド・レジスタ
52 オペランド・レジスタ
53 オペランド・レジスタ
54 オペランド・レジスタ
55 オペランド・レジスタ
56 オペランド・レジスタ
57 出力レジスタ
58 出力レジスタ
59 作業用レジスタ
60 マルチプレクサ
62 マルチプレクサ
64 2進加算器ユニット
66 2進加算器ユニット
72 ビット論理ユニット
74 ビット論理ユニット
76 ローテータ
78 ローテータ
82 先行ゼロ検出論理
84 先行ゼロ検出論理
86 バッファ
90 汎用レジスタ・ファイル
92 オペランド・バッファ
100 プロセッサ
102 媒体
103 データ信号
200 3パイプライン・スーパースケーラ固定小数点プロセッサ
DESCRIPTION OF
13 Left shifter (multiplicand multiple generation logic)
14 1's complement module (multiplicand multiple generation logic)
15 One's complement module (multiplicand multiple generation logic)
12 Multiplicand
Claims (30)
mビットが、前記プロセッサのレジスタの全幅と選択された2進乗算命令のオペランド・データの最大幅とのうちの少なくとも一方を含み、最大mビット長の被乗数データを含む第1のオペランドを受け取るように構成された第1のレジスタ入力と、
乗数値と、nビット長の前記乗数値の一区分を含む乗数値サブグループとのうちの一方を含む第2のオペランドを受け取るように構成され、nが選択された2進乗算命令のオペランド・データの最大幅以下である、第2のレジスタ入力と、
前記乗算器が前記被乗数データ入力から該当ビットを選択して有効な被乗数を生成し、前記被乗数データ入力の不使用ビットをゼロ設定することができるようにする、前記被乗数データのサイズを示す第1の制御信号を受け取るように構成された制御信号入力と、
前記被乗数演算が符号付きであるか符号なしであるかを示す第2の制御信号を受け取るように構成され、前記乗算器が前記有効被乗数の符号拡張を行えるようにするように構成された第2の制御信号入力とを含む2進乗算器。 A binary multiplier for a superscalar processor, comprising:
m bits include at least one of a full width of the processor's register and a maximum width of operand data of a selected binary multiply instruction, and receive a first operand including a maximum m-bit long multiplicand data. A first register input configured as
A second operand comprising one of a multiplier value and a multiplier value subgroup comprising a section of the multiplier value having a length of n bits, wherein n is the operand of the selected binary multiply instruction. A second register input that is less than or equal to the maximum width of the data;
A first indication of the size of the multiplicand data, wherein the multiplier selects a corresponding bit from the multiplicand data input to generate a valid multiplicand and allows unused bits of the multiplicand data input to be set to zero; A control signal input configured to receive a control signal of
A second control signal configured to receive a second control signal indicating whether the multiplicand operation is signed or unsigned, the second control signal configured to enable the multiplier to perform sign extension of the effective multiplicand; And a control signal input.
2進乗算器と、
前記2進乗算器と動作可能に通信し、乗数データと被乗数データをシフトさせて、選択されたサブグループが前記2進乗算器に確実に送られるようにすると共に、モジュラ積を他の1つのモジュラ積と累積モジュラ積のうちの少なくとも一方と適切に結合するために確実に桁合わせされるようにするデータ幅シフタと、
前記シフタと動作可能に通信し、前記乗数データと前記被乗数データを前記シフタに入力するために保持するレジスタと、
前記レジスタと動作可能に通信し、モジュラ積を、他のモジュラ積と累算モジュラ積とのうちの少なくとも一方と累算する加算器と、
前記加算器と動作可能に通信し、前記モジュラ積および前記累算モジュラ積を前記加算器への入力のためと、前記累算モジュラ積の出力とのために保持する複数のレジスタとを含むシステム。 A system for binary multiplication in a superscalar processor, comprising:
A binary multiplier;
It is in operable communication with the binary multiplier to shift multiplier data and multiplicand data to ensure that selected subgroups are sent to the binary multiplier and to combine the modular product with another one. A data width shifter that ensures that the digit is aligned to properly combine with at least one of the modular product and the cumulative modular product;
A register operably communicating with the shifter and holding the multiplier data and the multiplicand data for input to the shifter;
An adder operatively communicating with the register and accumulating a modular product with at least one of another modular product and an accumulating modular product;
A system operatively communicating with the adder and including a plurality of registers for holding the modular product and the accumulated modular product for input to the adder and for output of the accumulated modular product. .
第1のレジスタと、第2のレジスタと、第3のレジスタと、前記第1のレジスタ、前記第2のレジスタ、および第1のマルチプレクサと動作可能に通信するビット論理ユニットおよび2進加算器を含む実行ユニットであって、前記第1のマルチプレクサが前記第3のレジスタとも動作可能に通信する実行ユニットと、前記第1のレジスタおよび前記実行ユニットと動作可能に通信する第1のローテータと、前記実行ユニットおよび前記第2のレジスタと動作可能に通信する先行ゼロ検出レジスタとを含む第1のパイプラインと、
第4のレジスタと、第5のレジスタと、第6のレジスタと、前記第4のレジスタ、前記第5のレジスタ、および第2のマルチプレクサと動作可能に通信する他のビット論理ユニットおよび他の2進加算器を含む第2の実行ユニットであって、前記第2のマルチプレクサが前記第6のレジスタとも動作可能に通信する第2の実行ユニットと、前記第4のレジスタおよび前記実行ユニットと動作可能に通信するローテータと、前記第2の実行ユニットおよび前記第5のレジスタと動作可能に通信する先行ゼロ検出レジスタとを含む第2のパイプラインと、
第7のレジスタと、第8のレジスタと、第9のレジスタと、前記第7のレジスタおよび前記弟8のレジスタと動作可能に通信する乗算器とを含む第3のパイプラインと、
データの格納と取出しのための汎用レジスタと、
第1のオペランドと第2のオペランドとを入手するオペランド・バッファと、
前記第1のパイプラインと前記第2のパイプラインと前記第3のパイプラインと前記汎用レジスタと前記オペランド・バッファとのうちの少なくとも2者の間の通信のための通信バスとを含むシステム。 A system for binary multiplication in a superscalar processor, comprising:
A first register, a second register, a third register, a bit logic unit and a binary adder operably communicating with the first register, the second register, and the first multiplexer. An execution unit, wherein the first multiplexer is in operative communication with the third register; a first rotator is in operable communication with the first register and the execution unit; A first pipeline including an execution unit and a leading zero detect register in operable communication with the second register;
A fourth register, a fifth register, a sixth register, another bit logic unit and another two operably communicating with the fourth register, the fifth register, and the second multiplexer. A second execution unit including a binary adder, wherein the second multiplexer is in operable communication with the sixth register, and is operable with the fourth register and the execution unit. A second pipeline including a rotator communicating with the second execution unit and a leading zero detection register operably communicating with the second execution unit and the fifth register;
A third pipeline including a seventh register, an eighth register, a ninth register, and a multiplier operably communicating with the seventh register and the second register;
General purpose registers for storing and retrieving data,
An operand buffer for obtaining a first operand and a second operand;
A system including a communication bus for communication between at least two of the first pipeline, the second pipeline, the third pipeline, the general purpose register, and the operand buffer.
被乗数を入手するステップと、
乗数を入手するステップと、
前記乗数が選択された長さを超える場合、前記乗数を複数の乗数サブグループに区分化するステップと、
前記被乗数が選択された長さを超える場合、前記被乗数を複数の被乗数サブグループに区分化し、前記被乗数サブグループの符号なしビットをゼロ設定することと前記被乗数サブグループのより小さい部分を符号拡張することとのうちの少なくとも一方を行うステップと、
前記複数の被乗数サブグループのうちの選択された被乗数サブグループと、前記被乗数とのうちの少なくとも一方に基づいて、複数の被乗数倍数を設定するステップと、
前記複数の乗数サブグループの各前記乗数サブグループに基づいて、前記複数の被乗数倍数のうちの1つまたは複数の前記被乗数倍数を選択するステップと、
前記選択方法に基づいてモジュラ積を生成するステップとを含む方法。 A method of binary multiplication,
Obtaining a multiplicand;
Obtaining a multiplier;
Partitioning the multiplier into a plurality of multiplier subgroups if the multiplier exceeds a selected length;
If the multiplicand exceeds a selected length, partition the multiplicand into a plurality of multiplicand subgroups, zero out unsigned bits in the multiplicand subgroup, and sign extend a smaller part of the multiplicand subgroup. Doing at least one of
Setting a plurality of multiplicand multiples based on at least one of the selected multiplicand subgroup of the plurality of multiplicand subgroups and the multiplicand;
Selecting one or more of the multiplicands of the plurality of multiplicands based on each of the multiplier subgroups of the plurality of multipliers subgroups;
Generating a modular product based on the selection method.
前記モジュラ積と前記他のモジュラ積とを桁合わせし、結合して結果積を生成するステップとをさらに含む、請求項23に記載の方法。 Generating another modular product based on the selection method;
24. The method of claim 23, further comprising: matching and combining the modular product with the other modular product to produce a resulting product.
前記記録に基づいて、前記複数の被乗数倍数のうちの1つまたは複数の被乗数倍数を選択するステップとをさらに含み、
前記被乗数倍数も前記記録に基づく、請求項23に記載の方法。 Recording the plurality of multiplier subgroups using a recording algorithm;
Selecting one or more multiplicand multiples of the plurality of multiplicand multiples based on the record.
24. The method of claim 23, wherein the multiplicand multiple is also based on the record.
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US10/435,976 US7266580B2 (en) | 2003-05-12 | 2003-05-12 | Modular binary multiplier for signed and unsigned operands of variable widths |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2004342106A true JP2004342106A (en) | 2004-12-02 |
| JP3891997B2 JP3891997B2 (en) | 2007-03-14 |
Family
ID=33417058
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2004141968A Expired - Fee Related JP3891997B2 (en) | 2003-05-12 | 2004-05-12 | Modular binary multiplier for variable width signed and unsigned operands |
Country Status (2)
| Country | Link |
|---|---|
| US (3) | US7266580B2 (en) |
| JP (1) | JP3891997B2 (en) |
Families Citing this family (27)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100458031B1 (en) * | 2003-03-14 | 2004-11-26 | 삼성전자주식회사 | Apparatus and method for performing a montgomery type modular multiplication |
| US20060059221A1 (en) * | 2004-09-10 | 2006-03-16 | Cavium Networks | Multiply instructions for modular exponentiation |
| US20060242219A1 (en) * | 2005-04-20 | 2006-10-26 | Chin-Yung Chen | Asynchronous multiplier |
| US20070100924A1 (en) * | 2005-10-31 | 2007-05-03 | Chin-Yung Chen | Asynchronous signed multiplier and algorithm thereof |
| US8073892B2 (en) * | 2005-12-30 | 2011-12-06 | Intel Corporation | Cryptographic system, method and multiplier |
| JP4790791B2 (en) * | 2006-02-15 | 2011-10-12 | パナソニック株式会社 | Multiplier, digital filter, signal processing device, synthesis device, synthesis program, and synthesis program recording medium |
| US20080077647A1 (en) * | 2006-09-06 | 2008-03-27 | Fam Adly T | Parameterized VLSI Architecture And Method For Binary Multipliers |
| US8321489B2 (en) | 2006-09-15 | 2012-11-27 | National Semiconductor Corporation | Software reconfigurable digital phase lock loop architecture |
| US20080140753A1 (en) * | 2006-12-08 | 2008-06-12 | Vinodh Gopal | Multiplier |
| US8667046B2 (en) * | 2008-02-21 | 2014-03-04 | Ecole Polytechnique Federale De Lausanne/Service Des Relations Industrielles | Generalized programmable counter arrays |
| US20090292756A1 (en) * | 2008-05-23 | 2009-11-26 | Elliot Gibson D | Large-factor multiplication in an array of processors |
| US8577952B2 (en) * | 2008-12-08 | 2013-11-05 | International Business Machines Corporation | Combined binary/decimal fixed-point multiplier and method |
| US8495125B2 (en) * | 2009-05-27 | 2013-07-23 | Microchip Technology Incorporated | DSP engine with implicit mixed sign operands |
| US8566385B2 (en) * | 2009-12-02 | 2013-10-22 | International Business Machines Corporation | Decimal floating point multiplier and design structure |
| FR2974202B1 (en) * | 2011-04-18 | 2013-04-12 | Inside Secure | METHOD FOR MULTIPLICATION OF MONTGOMERY |
| US9069624B1 (en) * | 2012-07-23 | 2015-06-30 | Altera Corporation | Systems and methods for DSP block enhancement |
| US9519460B1 (en) * | 2014-09-25 | 2016-12-13 | Cadence Design Systems, Inc. | Universal single instruction multiple data multiplier and wide accumulator unit |
| CN105786444B (en) * | 2014-12-26 | 2018-10-12 | 联想(北京)有限公司 | A kind of floating number mantissa leading zero detection method and device |
| US9727399B1 (en) | 2016-09-29 | 2017-08-08 | International Business Machines Corporation | Residue-based checking of a shift operation |
| CN108364065B (en) | 2018-01-19 | 2020-09-11 | 上海兆芯集成电路有限公司 | Microprocessor for booth multiplication |
| CN111090413A (en) * | 2018-10-23 | 2020-05-01 | 成都鼎桥通信技术有限公司 | Method and device for adding digital sequences |
| CN113031912B (en) * | 2019-12-24 | 2024-08-16 | 上海寒武纪信息科技有限公司 | Multiplier, data processing method, device and chip |
| CN112416294B (en) * | 2020-11-20 | 2022-09-16 | 安谋科技(中国)有限公司 | Processor, binary accumulation method thereof, and computer readable medium |
| US12147783B2 (en) | 2021-04-28 | 2024-11-19 | International Business Machines Corporation | Pipelined hardware to accelerate modular arithmetic operations |
| CN113867685A (en) * | 2021-09-27 | 2021-12-31 | 山东云海国创云计算装备产业创新中心有限公司 | A multiplier conversion method, apparatus, device and readable storage medium |
| CN115857873B (en) * | 2023-02-07 | 2023-05-09 | 兰州大学 | Multiplier, multiplication calculation method, processing system, and storage medium |
| US20260004870A1 (en) * | 2024-06-26 | 2026-01-01 | Macronix International Co., Ltd. | Repairing defective columns of compute-in-memory and near-memory computing devices |
Family Cites Families (17)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4390961A (en) | 1980-12-24 | 1983-06-28 | Honeywell Information Systems Inc. | Data processor performing a decimal multiply operation using a read only memory |
| US4484300A (en) | 1980-12-24 | 1984-11-20 | Honeywell Information Systems Inc. | Data processor having units carry and tens carry apparatus supporting a decimal multiply operation |
| US4809212A (en) * | 1985-06-19 | 1989-02-28 | Advanced Micro Devices, Inc. | High throughput extended-precision multiplier |
| US5262976A (en) | 1989-11-13 | 1993-11-16 | Harris Corporation | Plural-bit recoding multiplier |
| JP2830566B2 (en) | 1992-01-13 | 1998-12-02 | 日本電気株式会社 | Decimal multiplier |
| DE4218769A1 (en) * | 1992-06-06 | 1993-12-09 | Philips Patentverwaltung | Method and arrangement for forming the sum of a chain of products |
| US5579253A (en) * | 1994-09-02 | 1996-11-26 | Lee; Ruby B. | Computer multiply instruction with a subresult selection option |
| US5764558A (en) * | 1995-08-25 | 1998-06-09 | International Business Machines Corporation | Method and system for efficiently multiplying signed and unsigned variable width operands |
| US5684731A (en) | 1995-08-31 | 1997-11-04 | National Semiconductor Corporation | Booth multiplier using data path width adder for efficient carry save addition |
| DE19637369C2 (en) * | 1996-09-13 | 2001-11-15 | Micronas Gmbh | Digital signal processor with multiplier and method |
| KR100222032B1 (en) * | 1996-12-24 | 1999-10-01 | 윤종용 | Double precision multiplier |
| US6233597B1 (en) * | 1997-07-09 | 2001-05-15 | Matsushita Electric Industrial Co., Ltd. | Computing apparatus for double-precision multiplication |
| US6035318A (en) | 1998-03-31 | 2000-03-07 | Intel Corporation | Booth multiplier for handling variable width operands |
| US6434584B1 (en) * | 1998-06-04 | 2002-08-13 | Texas Instruments Incorporated | Flexible accumulator register file for use in high performance microprocessors |
| US6523055B1 (en) * | 1999-01-20 | 2003-02-18 | Lsi Logic Corporation | Circuit and method for multiplying and accumulating the sum of two products in a single cycle |
| US6330660B1 (en) * | 1999-10-25 | 2001-12-11 | Vxtel, Inc. | Method and apparatus for saturated multiplication and accumulation in an application specific signal processor |
| US6611856B1 (en) * | 1999-12-23 | 2003-08-26 | Intel Corporation | Processing multiply-accumulate operations in a single cycle |
-
2003
- 2003-05-12 US US10/435,976 patent/US7266580B2/en not_active Expired - Fee Related
-
2004
- 2004-05-12 JP JP2004141968A patent/JP3891997B2/en not_active Expired - Fee Related
-
2007
- 2007-05-16 US US11/749,224 patent/US7853635B2/en not_active Expired - Fee Related
- 2007-05-16 US US11/749,239 patent/US7490121B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| US20040230631A1 (en) | 2004-11-18 |
| JP3891997B2 (en) | 2007-03-14 |
| US20070233773A1 (en) | 2007-10-04 |
| US7266580B2 (en) | 2007-09-04 |
| US7853635B2 (en) | 2010-12-14 |
| US20070214205A1 (en) | 2007-09-13 |
| US7490121B2 (en) | 2009-02-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3891997B2 (en) | Modular binary multiplier for variable width signed and unsigned operands | |
| US11347511B2 (en) | Floating-point scaling operation | |
| EP3374853B1 (en) | Multiplication of first and second operands using redundant representation | |
| JP6694880B2 (en) | Effectiveness matching | |
| US7716269B2 (en) | Method and system for performing parallel integer multiply accumulate operations on packed data | |
| US5631859A (en) | Floating point arithmetic unit having logic for quad precision arithmetic | |
| US10255041B2 (en) | Unified multiply unit | |
| EP2435906B1 (en) | Dsp engine with implicit mixed operands | |
| JP4064989B2 (en) | Device for performing multiplication and addition of packed data | |
| US9733899B2 (en) | Lane position information for processing of vector | |
| US9720646B2 (en) | Redundant representation of numeric value using overlap bits | |
| JPH0414366B2 (en) | ||
| US6295597B1 (en) | Apparatus and method for improved vector processing to support extended-length integer arithmetic | |
| US6324638B1 (en) | Processor having vector processing capability and method for executing a vector instruction in a processor | |
| US20110320514A1 (en) | Decimal adder with end around carry | |
| US9928031B2 (en) | Overlap propagation operation | |
| JP5193358B2 (en) | Polynomial data processing operations | |
| EP0840207A1 (en) | A microprocessor and method of operation thereof | |
| US7412476B2 (en) | Decimal multiplication for superscaler processors | |
| US20060277247A1 (en) | Hybrid arithmetic logic unit | |
| JP3579087B2 (en) | Arithmetic unit and microprocessor | |
| GB2549153A (en) | Apparatus and method for supporting a conversion instruction | |
| US7590677B2 (en) | Processor with summation instruction using overflow counter | |
| JP2001229009A (en) | Method for realizing the multiplication and division of n bit (unlimited bit) using memory by program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060404 |
|
| RD12 | Notification of acceptance of power of sub attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7432 Effective date: 20060427 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20060427 |
|
| A601 | Written request for extension of time |
Free format text: JAPANESE INTERMEDIATE CODE: A601 Effective date: 20060626 |
|
| A602 | Written permission of extension of time |
Free format text: JAPANESE INTERMEDIATE CODE: A602 Effective date: 20060630 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20061003 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20061121 |
|
| RD14 | Notification of resignation of power of sub attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7434 Effective date: 20061121 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20061205 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 3891997 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091215 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101215 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101215 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111215 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111215 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121215 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121215 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131215 Year of fee payment: 7 |
|
| LAPS | Cancellation because of no payment of annual fees |