CN1598757A - Design method of number mixed multipler for supporting single-instruction multiple-operated - Google Patents

Design method of number mixed multipler for supporting single-instruction multiple-operated Download PDF

Info

Publication number
CN1598757A
CN1598757A CN 200410046718 CN200410046718A CN1598757A CN 1598757 A CN1598757 A CN 1598757A CN 200410046718 CN200410046718 CN 200410046718 CN 200410046718 A CN200410046718 A CN 200410046718A CN 1598757 A CN1598757 A CN 1598757A
Authority
CN
China
Prior art keywords
product
partial
multiplier
operand
generator
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
Application number
CN 200410046718
Other languages
Chinese (zh)
Other versions
CN100356315C (en
Inventor
李振涛
陈书明
胡春媚
何肇雄
马剑武
郭阳
万江华
郭敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by National University of Defense Technology filed Critical National University of Defense Technology
Priority to CNB2004100467180A priority Critical patent/CN100356315C/en
Publication of CN1598757A publication Critical patent/CN1598757A/en
Application granted granted Critical
Publication of CN100356315C publication Critical patent/CN100356315C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Complex Calculations (AREA)

Abstract

本发明公开了一种支持单指令多操作数的混合乘法器的设计方法,目的是使乘法器既可工作在普通模式,又可工作在SIMD模式。技术方案是设计一种新的混合乘法器结构,由操作数扩展部件、译码器、两个部分积产生器、修正值产生部件、部分积压缩部件和加法器组成。译码器判断工作模式和操作数类型,操作数扩展部件对操作数进行扩展,两个部分积产生器各产生n/2+1个部分积送至部分积压缩部件。修正值产生部件产生SIMD模式时对高位乘积的修正值。部分积压缩部件将部分积和修正值压缩成两个4n位的数,加法器对它们相加得到一个4n位乘积。在普通模式下,它是两个2n位操作数的乘积;在SIMD模式下,低2n位是低n位乘法的乘积,高2n位是高n位乘法的乘积。

Figure 200410046718

The invention discloses a design method of a mixed multiplier supporting single instruction and multiple operands, aiming to make the multiplier work in both common mode and SIMD mode. The technical solution is to design a new hybrid multiplier structure, which is composed of an operand expansion unit, a decoder, two partial product generators, a correction value generation unit, a partial product compression unit and an adder. The decoder judges the working mode and the operand type, the operand expansion unit expands the operand, and the two partial product generators each generate n/2+1 partial products and send them to the partial product compression unit. The correction value generation component is a correction value for the high-order product when generating SIMD mode. The partial product compression unit compresses the partial product and the correction value into two 4n-bit numbers, and the adder adds them to obtain a 4n-bit product. In normal mode, it is the product of two 2n-bit operands; in SIMD mode, the lower 2n bits are the product of the lower n-bit multiplication, and the upper 2n bits are the product of the upper n-bit multiplication.

Figure 200410046718

Description

一种支持单指令多操作数的混合乘法器的设计方法A Design Method of Hybrid Multiplier Supporting Single Instruction Multiple Operands

技术领域:本发明涉及数字信号处理器(DSP)和高性能微处理器中乘法器的设计方法,尤其是支持单指令多操作数(SIMD)的乘法器的设计方法。Technical field: the present invention relates to the design method of the multiplier in digital signal processor (DSP) and high-performance microprocessor, especially the design method of the multiplier that supports single instruction multiple operand (SIMD).

背景技术:乘法器是DSP和微处理器中的一个重要部件,在科学计算和数字信号处理等领域中,乘法操作被大量使用。传统乘法器一般由操作数扩展部件、译码器、部分积产生部件、部分积压缩部件和一个传播进位的加法器(CPL)组成。在高性能乘法器的设计中,部分积产生是一项关键技术。2位Booth编码电路由于设计简单,产生的部分积数目少,目前在乘法器设计中被广泛采用。随着信息技术的发展,视频、音频等多媒体数据的处理已经成为数字信号处理的重要应用领域。多媒体数据处理的一个显著特点是对多个小的数据项进行同样的运算,为了提高多媒体数据处理的能力,许多处理器都增加了SIMD指令,使处理器执行一条指令能够完成多个短数据运算。SIMD指令的实现有两种方式,一种是设置专门的SIMD部件,该部件仅能执行SIMD操作,如Pentium II处理器中的MMX部件;另一种是对传统的标量运算器进行改进,使其既保持标量运算能力,又具备执行SIMD操作的能力,如IntelXScaleTM。后一种实现方法不需要对体系结构进行大的改动就可使其多媒体数据处理能力提高数倍,因此在DSP等嵌入式微处理器设计中得到了广泛的应用,如TI(德州仪器)公司和AD(模拟器件)公司最新的DSP乘法器的设计均采用了这种方法。这种既支持一个长数据乘法操作又支持多个短数据乘法操作的乘法器被称为混合乘法器。考虑到计算机中操作数表示的特点和设计复杂度,混合乘法器一般只支持两个短数据同时进行乘法操作,设计这种混合乘法器的一种非常直接的方法是设置多个乘法器,缺点是硬件开销大;另一种方法是采用流水技术,如IntelXScaleTM,它的缺点是提高了CPI,即单条指令执行的节拍数。因此,高性能、低功耗微处理器设计迫切需要一种新的高效的混合乘法器设计方法。Background Art: The multiplier is an important part in DSP and microprocessor, and multiplication operation is widely used in fields such as scientific calculation and digital signal processing. Traditional multipliers are generally composed of operand expansion units, decoders, partial product generation units, partial product compression units, and a propagated carry adder (CPL). Partial product generation is a key technology in the design of high-performance multipliers. The 2-bit Booth encoding circuit is widely used in multiplier design because of its simple design and few partial products. With the development of information technology, the processing of multimedia data such as video and audio has become an important application field of digital signal processing. A notable feature of multimedia data processing is to perform the same operation on multiple small data items. In order to improve the ability of multimedia data processing, many processors have added SIMD instructions, so that the processor can execute multiple short data operations by executing one instruction. . There are two ways to implement SIMD instructions, one is to set a special SIMD unit, which can only perform SIMD operations, such as the MMX unit in the Pentium II processor; the other is to improve the traditional scalar arithmetic unit, so that It not only maintains scalar computing capability, but also has the capability to perform SIMD operations, such as Intel(R) XScale (TM) . The latter implementation method can increase its multimedia data processing ability several times without making major changes to the architecture, so it has been widely used in the design of embedded microprocessors such as DSP, such as TI (Texas Instruments) and AD (Analog Devices) The design of the company's latest DSP multiplier has adopted this method. Such a multiplier that supports both one long data multiplication operation and multiple short data multiplication operations is called a hybrid multiplier. Considering the characteristics of operand representation and design complexity in computers, hybrid multipliers generally only support two short data multiplication operations at the same time. A very straightforward way to design this hybrid multiplier is to set multiple multipliers. The disadvantages The hardware overhead is high; another method is to use pipelining technology, such as Intel® XScale TM , which has the disadvantage of increasing CPI, that is, the number of beats executed by a single instruction. Therefore, there is an urgent need for a new and efficient hybrid multiplier design method for high-performance, low-power microprocessor design.

发明内容:本发明要解决的技术问题是提供一种新的混合乘法器设计方法,使得在仅增加少量硬件开销的情况下,乘法器既可以工作在普通模式,又可以工作在SIMD模式。技术方案是设计一种新的混合乘法器结构,由控制信号指示乘法器当前的工作模式,只要对部分积进行累加求和就可得到普通模式和SIMD模式对应的乘积。假定操作数1和操作数2分别是被乘数和乘数,它们的字长是2n位,本发明设计的混合乘法器在普通模式下,可以完成一个2n×2n乘法操作;当工作在SIMD模式下,它把每个2n位的操作数都看作是两个n位的短操作数,这时可以同时完成两个n×n乘法操作。Summary of the invention: The technical problem to be solved by the present invention is to provide a new hybrid multiplier design method, so that the multiplier can work in both normal mode and SIMD mode with only a small increase in hardware overhead. The technical solution is to design a new hybrid multiplier structure, the current working mode of the multiplier is indicated by the control signal, and the product corresponding to the normal mode and the SIMD mode can be obtained only by accumulating and summing the partial products. Assuming that operand 1 and operand 2 are multiplicand and multiplier respectively, and their word length is 2n bits, the mixed multiplier designed by the present invention can complete a 2n * 2n multiplication operation in normal mode; when working in SIMD In mode, it regards each 2n-bit operand as two n-bit short operands, and at this time, two n×n multiplication operations can be completed simultaneously.

本发明具体技术方案是:混合乘法器由操作数扩展部件、译码器、部分积产生器1、部分积产生器2、修正值产生部件、部分积压缩部件和加法器组成。译码器根据输入的控制信号判断工作模式和操作数的类型,控制操作数扩展部件和修正值产生部件工作。操作数扩展部件在译码器的控制下,对操作数进行扩展,扩展后的被乘数1和乘数1送到部分积产生器1,被乘数2和乘数2送到部分积产生器2。两个部分积产生器各产生(n/2+1)个部分积,送至部分积压缩部件。修正值产生部件在译码器的控制下产生SIMD模式时对高位乘积的修正值。部分积压缩部件将(n+2)个部分积和从修正值产生部件输入的修正值压缩成两个4n位的数。加法器对从部分积压缩部件输入的两个4n位的数相加,得到一个4n位的乘积。The specific technical solution of the present invention is: the hybrid multiplier is composed of an operand expansion unit, a decoder, a partial product generator 1, a partial product generator 2, a correction value generation unit, a partial product compression unit and an adder. The decoder judges the working mode and the type of the operand according to the input control signal, and controls the operation of the operand expansion unit and the correction value generation unit. The operand expansion unit expands the operand under the control of the decoder, and the expanded multiplicand 1 and multiplier 1 are sent to the partial product generator 1, and the multiplicand 2 and multiplier 2 are sent to the partial product to generate Device 2. Each of the two partial product generators generates (n/2+1) partial products, which are sent to the partial product compression unit. The correction value generating unit generates the correction value for the high bit product in SIMD mode under the control of the decoder. The partial product compression section compresses (n+2) partial products and the correction value input from the correction value generation section into two 4n-bit numbers. The adder adds two 4n-bit numbers input from the partial product compression part to obtain a 4n-bit product.

本发明混合乘法器的操作数扩展部件对操作数1和操作数2进行扩展,分别产生两个被乘数和两个乘数送至两个部分积产生器。被乘数1和被乘数2的长度为2n+2位,在普通模式下,被乘数1和被乘数2的低2n位等于操作数1,同时把高两位扩展成操作数1的符号位;在SIMD模式下,被乘数1的低n位等于操作数1的低n位,被乘数1的第n至第2n+1位全部扩展成操作数1的低n位的符号位;被乘数2的低n位置为0,第n至第2n-1位等于操作数1的高n位,最高两位即第2n和2n+1位扩展为操作数1的高n位的符号位;乘数1和乘数2的长度都为n+3位,乘数1主要来自于操作数2的低n位,乘数2主要来自于操作数2的高n位,操作数扩展部件还要在乘数1和乘数2的前面和后面各扩展1位前缀和2位符号位,乘数1的前缀为0,乘数2的符号位与操作数2高n位的符号位一致,乘数1的符号位和乘数2的前缀在不同的工作模式下为不同的配置。。The operand expansion part of the hybrid multiplier of the present invention expands the operand 1 and the operand 2, respectively generates two multiplicands and two multipliers and sends them to two partial product generators. The length of multiplicand 1 and multiplicand 2 is 2n+2 bits. In normal mode, the lower 2n bits of multiplicand 1 and multiplicand 2 are equal to operand 1, and the upper two bits are expanded to operand 1 The sign bit; in SIMD mode, the lower n bits of the multiplicand 1 are equal to the lower n bits of the operand 1, and the nth to 2n+1th bits of the multiplicand 1 are all extended to the lower n bits of the operand 1 Sign bit; the low n position of the multiplicand 2 is 0, the nth to 2n-1 bits are equal to the high n bits of the operand 1, and the highest two bits, namely the 2n and 2n+1 bits, are extended to the high n of the operand 1 The sign bit of the bit; the length of the multiplier 1 and the multiplier 2 are both n+3 bits, the multiplier 1 mainly comes from the lower n bits of the operand 2, and the multiplier 2 mainly comes from the upper n bits of the operand 2, the operation The number extension part also needs to extend 1 prefix and 2 sign bits respectively in front of and behind the multiplier 1 and the multiplier 2, the prefix of the multiplier 1 is 0, the sign bit of the multiplier 2 is the same as the upper n bits of the operand 2 The sign bit is the same, the sign bit of multiplier 1 and the prefix of multiplier 2 are configured differently in different working modes. .

本发明也采用二位Booth乘法产生部分积。本发明混合乘法器部分积的产生分成两部分,分别由部分积产生器1和部分积产生器2完成,它们分别相当于一个2n×n乘法器的部分积产生器,分别产生低位和高位的(n/2+1)个部分积。在SIMD模式下,低位乘积的符号位为1时会对高位乘积产生影响,本发明设计了一个修正值产生部件产生高位乘积修正值对乘积的高2n位进行修正,使得低位乘积的符号位为0。采用二位Booth乘法产生部分积的方法是:The present invention also uses two-bit Booth multiplication to generate partial products. The generation of the partial product of the hybrid multiplier of the present invention is divided into two parts, which are respectively completed by a partial product generator 1 and a partial product generator 2, which are respectively equivalent to a partial product generator of a 2n×n multiplier, and generate low and high bits respectively. (n/2+1) partial products. In SIMD mode, when the sign bit of the low-order product is 1, it will affect the high-order product. The present invention designs a correction value generating component to generate a high-order product correction value to correct the high 2n bits of the product, so that the sign bit of the low-order product is 0. The method of using two-bit Booth multiplication to generate partial products is:

一个部分积由被乘数在乘数中相邻的3位二进制数控制下经过移位和取反得到。当被乘数确定后,乘数中相邻的3位二进制数的不同组合会产生不同的部分积。假设b是乘数;bk是乘数的第k位。在普通二位Booth乘法器中,一个2n×2n的乘法需要产生n+1个部分积。第1个部分积由[b1,b0,0]控制产生,第k(1<k<n+1)个部分积由[b2k-1,b2(k-1),b2k-3]控制产生,第n+1个部分积是由[s,s,b2n-1]控制产生的,其中b2n-1是乘数的最高位,s为符号位,当乘数是有符号数时,s=b2n-1,当乘数是无符号数时,s=0。假设部分积的权q为累加时部分积需要向右移动(向高位方向移位)的位数,则第k个部分积的权qk=2(k-1)。A partial product is obtained by shifting and inverting the multiplicand under the control of adjacent 3-bit binary numbers in the multiplier. When the multiplicand is determined, different combinations of adjacent 3-bit binary numbers in the multiplier will produce different partial products. Suppose b is the multiplier; b k is the kth bit of the multiplier. In an ordinary two-bit Booth multiplier, a 2n×2n multiplication needs to generate n+1 partial products. The first partial product is generated by [b 1 , b 0 , 0], and the kth (1<k<n+1) partial product is generated by [b 2k-1 , b 2(k-1) , b 2k- 3 ] control generation, the n+1th partial product is generated by [s, s, b 2n-1 ] control, where b 2n-1 is the highest bit of the multiplier, s is the sign bit, when the multiplier is When the multiplier is a signed number, s=b 2n-1 , and when the multiplier is an unsigned number, s=0. Assuming that the weight q of the partial product is the number of digits that the partial product needs to be shifted to the right (to the higher order) during accumulation, then the weight q k of the kth partial product = 2(k-1).

本发明部分积产生部件由部分积产生器1和部分积产生器2组成。部分积产生器1的输入是被乘数1和乘数1,部分积产生器2的输入是被乘数2和乘数2。部分积产生器1产生低位的(n/2+1)个部分积,部分积产生器2产生高位的(n/2+1)个部分积。部分积产生器2根据工作模式确定它的第一个部分积最高三个符号位的值。The partial product generation unit of the present invention is composed of a partial product generator 1 and a partial product generator 2 . The input of the partial product generator 1 is the multiplicand 1 and the multiplier 1, and the input of the partial product generator 2 is the multiplicand 2 and the multiplier 2. Partial product generator 1 generates low-order (n/2+1) partial products, and partial product generator 2 generates high-order (n/2+1) partial products. Partial product generator 2 determines the value of the first three sign bits of its first partial product according to the mode of operation.

当混合乘法器工作在普通模式时,部分积产生器1的第1至第n/2个部分积与普通乘法器的第1至第n/2个部分积的产生方法和权分别相同;部分积产生器1的第(n/2+1)个部分积为0。部分积产生器2的第1至第(n/2+1)个部分积与普通乘法器的第(n/2+1)至第(n+1)个部分积的产生方法和权分别相同。因此在普通模式时,混合乘法器与普通乘法器的部分积完全一样,对混合乘法器的(n+2)个部分积累加即得到一个2n×2n乘法的乘积。这时,乘数1的符号位和乘数2的前缀都置为bn-1When the hybrid multiplier works in the common mode, the 1st to the n/2th partial product of the partial product generator 1 and the generation method and weight of the 1st to the n/2th partial product of the common multiplier are respectively the same; The (n/2+1)th partial product of product generator 1 is 0. The 1st to (n/2+1) partial products of the partial product generator 2 are the same as the generation methods and weights of the (n/2+1) to (n+1) partial products of the common multiplier . Therefore, in the normal mode, the partial products of the hybrid multiplier and the common multiplier are exactly the same, and the (n+2) parts of the hybrid multiplier are accumulated and added to obtain a product of 2n×2n multiplication. At this time, both the sign bit of the multiplier 1 and the prefix of the multiplier 2 are set to b n-1 .

当混合乘法器工作在SIMD模式时,部分积产生器1的被乘数1的高n位扩展为操作数1低n位的符号,乘数1的两个符号位扩展为操作数2低n位的符号位;产生第1至第n/2个部分积的控制码与普通模式时相同;第1至第n/2个部分积的权与普通模式时相同;第(n/2+1)个部分积由[s,s,bn-1]控制产生,其中bn-1是低n位乘数的最高位,s为符号位,当低位乘数是有符号数时,s=bn-1,当低位乘数是无符号数时,s=0;第(n/2+1)个部分积的权为n。在SIMD模式下,部分积产生器2的被乘数2的低n位被置为0,高n位保持不变,乘数2的前缀为0;部分积产生器2的产生第1个部分积的控制码由[bn+1,bn,bn-1]变为[bn+1,bn,0];部分积产生器2的其余部分积与普通模式时相同;部分积产生器2所有部分积的权保持不变。实际上,在SIMD模式下,每一个部分积产生器都相当于一个2n×n的乘法器的部分积产生器。低n位操作数乘法的有效部分积位于部分积产生器1的部分积的低位部分;高n位操作数乘法的有效部分积位于部分积产生器2的部分积的高位部分。When the hybrid multiplier works in SIMD mode, the upper n bits of the multiplicand 1 of the partial product generator 1 are extended to the sign of the lower n bits of the operand 1, and the two sign bits of the multiplier 1 are extended to the lower n bits of the operand 2. The sign bit of the bit; the control code to generate the 1st to n/2th partial product is the same as in the normal mode; the weight of the 1st to n/2th partial product is the same as in the normal mode; the (n/2+1 ) partial products are generated under the control of [s, s, b n-1 ], where b n-1 is the highest bit of the low n-bit multiplier, s is the sign bit, and when the low-bit multiplier is a signed number, s= b n-1 , when the low-order multiplier is an unsigned number, s=0; the weight of the (n/2+1)th partial product is n. In SIMD mode, the lower n bits of the multiplicand 2 of the partial product generator 2 are set to 0, the upper n bits remain unchanged, and the prefix of the multiplier 2 is 0; the first part of the partial product generator 2 is generated The control code of the product changes from [b n+1 , b n , b n-1 ] to [b n+1 , b n , 0]; the rest of the partial product generator 2 is the same as in the normal mode; the partial product The weights of all partial products of Generator 2 remain the same. Actually, in SIMD mode, each partial product generator is equivalent to a partial product generator of a 2n×n multiplier. The effective partial product of the multiplication of the low n-bit operands is located in the low order part of the partial product of the partial product generator 1; the effective partial product of the multiplication of the high n-bit operands is located in the high order part of the partial product of the partial product generator 2.

由于部分积产生器2的部分积的低n位为0,即使是权最小的第1个部分积在累加时都要向右移动n位,因此部分积产生器2的部分积不会对低2n位的结果产生影响,累加后的结果的低2n位就是低位n×n乘法的乘积。虽然高位乘法的部分积不会对低位乘积产生影响,但在累加时低位乘法部分积的符号位会向高位乘积产生进位。因此,为了得到正确的结果,必须对高2n位的结果加上一个修正值,消除低位乘积的符号位对高位乘积的影响。低位乘积的符号位要么全为0,要么全为1。如果能够使低位乘积的符号位扩展到高位乘积的最高位,当低位乘积的符号位为0时,低位乘积不会对高位乘积产生影响,此时在高位乘积的最低位加上一个0;当低位乘积的符号位为1时,只要在高位乘积的最低位加上一个1,就可以使低位乘积的在高位乘积处的符号变为0,也不会对高位乘积产生影响。为了使低位乘法的符号位扩展到高位乘积的最高位,本发明在高位乘积的最高的(n-1)位加上(2n-1-1)。因此,本发明SIMD模式下的修正值由两部分组成,加在高位乘积的最低位的0或者1和加在高(n-1)位上的(2n-1-1),这个修正值由修正值产生部件在译码器的控制下产生。Since the lower n bits of the partial product of the partial product generator 2 are 0, even the first partial product with the smallest weight will be moved to the right by n bits when accumulating, so the partial product of the partial product generator 2 will not The result of 2n bits has an impact, and the lower 2n bits of the accumulated result are the product of the lower n×n multiplication. Although the partial product of the high-order multiplication will not affect the low-order product, the sign bit of the partial product of the low-order multiplication will generate a carry to the high-order product during accumulation. Therefore, in order to obtain the correct result, a correction value must be added to the result of the upper 2n bits to eliminate the influence of the sign bit of the low-order product on the high-order product. The sign bits of the low-order product are either all 0s or all 1s. If the sign bit of the low-order product can be extended to the highest bit of the high-order product, when the sign bit of the low-order product is 0, the low-order product will not affect the high-order product, and a 0 is added to the lowest bit of the high-order product; When the sign bit of the low-order product is 1, as long as a 1 is added to the lowest bit of the high-order product, the sign of the low-order product at the high-order product can be changed to 0, and the high-order product will not be affected. In order to extend the sign bit of the low-order multiplication to the highest bit of the high-order product, the present invention adds (2 n-1 -1) to the highest (n-1) bit of the high-order product. Therefore, the correction value in the SIMD mode of the present invention consists of two parts, 0 or 1 added to the lowest bit of the high-order product and (2 n-1 -1) added to the high (n-1) bit, this correction value Generated by the correction value generation unit under the control of the decoder.

部分积压缩部件把两个部分积产生器产生的(n+2)个部分积和高位结果的修正值(在普通模式下,这个修正值是全0)压缩成两个4n位的数。由传播进位加法器把这两个数相加,最终得到一个4n位的乘积。在普通模式下,它就是两个2n位操作数的乘积;在SIMD模式下,低2n位是低n位乘法的乘积,高2n位是高n位乘法的乘积。The partial product compression part compresses (n+2) partial products generated by two partial product generators and correction values of high-order results (in normal mode, this correction value is all 0) into two 4n-bit numbers. These two numbers are added by the propagation carry adder, and finally a 4n-bit product is obtained. In normal mode, it is the product of two 2n-bit operands; in SIMD mode, the lower 2n bits are the product of the lower n-bit multiplication, and the upper 2n bits are the product of the upper n-bit multiplication.

采用本发明能产生以下技术效果:Adopt the present invention to produce following technical effect:

1.本发明充分利用了乘法器中的硬件资源,以较小的硬件开销,将部分积产生部件分成两个部分积产生器,设计一个修正值的产生部件,在部分积压缩部件中增加相应的电路,使处理短操作数乘法操作的能力提高了一倍。1. The present invention makes full use of the hardware resources in the multiplier, with less hardware overhead, the partial product generating part is divided into two partial product generators, a correction value generating part is designed, and the corresponding partial product compression part is added. A circuit that doubles the ability to handle multiplication operations with short operands.

2.采用本发明设计的乘法器各个部件之间没有反馈,容易划分成几个流水站,以得到更高的性能。2. There is no feedback between the parts of the multiplier designed by the present invention, and it can be easily divided into several flow stations to obtain higher performance.

附图说明:Description of drawings:

图1是普通乘法器的逻辑结构图;Fig. 1 is the logic structure diagram of common multiplier;

图2是普通16位乘法器部分积的点积图;Fig. 2 is the dot product diagram of the partial product of common 16-bit multipliers;

图3是采用本发明实现的16位混合乘法器的部分积的点积图;Fig. 3 is the dot product diagram of the partial product of the 16 mixed multipliers realized by the present invention;

图4是修正值产生原理示意图;Fig. 4 is a schematic diagram of the principle of correction value generation;

图5是采用本发明设计的混合乘法器的逻辑结构图;Fig. 5 is the logical structural diagram of the mixed multiplier that adopts the present invention to design;

具体实施方式:Detailed ways:

图1为普通乘法器的逻辑图,普通乘法器由操作数扩展部件、译码器、部分积产生部件、部分积压缩部件和加法器(CPL)组成。操作数扩展部件在译码器的控制下对操作数1和操作数2进行符号扩展变为被乘数和乘数输入到部分积产生部件,部分积产生部件产生(n+1)个部分积,部分积压缩部件把(n+1)个部分积压缩成两个4n位的数,最后一个传播进位的加法器对这两个数求和得到一个4n位的乘积。Figure 1 is a logic diagram of an ordinary multiplier. The ordinary multiplier is composed of an operand expansion unit, a decoder, a partial product generation unit, a partial product compression unit and an adder (CPL). The operand extension unit carries out sign extension to the operand 1 and the operand 2 under the control of the decoder to become the multiplicand and the multiplier input to the partial product generation unit, and the partial product generation unit generates (n+1) partial products , the partial product compression unit compresses (n+1) partial products into two 4n-bit numbers, and the last adder that propagates the carry sums the two numbers to obtain a 4n-bit product.

图2为一个考虑了部分积的权的普通16位乘法器部分积的点积图,部分积的最高位在右侧,最低位在左侧。图中的E为部分积的符号,S指示部分积是否经过取反求补,当部分积需要取反求补时,并不是立即转换为它的反码的补码,而是通过在它的反码的最低位加1的冗余形式来表示。图3是采用本发明设计的16(2n)位混合乘法器的部分积的点积图,其中1-5个部分积由部分积产生器1产生,第n/2+1=5个部分积为0。第6-10个部分积由部分积产生器2产生。第6个部分积在普通模式时相当于图3中的第5个部分积,这时它的最高三位E1E2E3=E10;在SIMD模式时,第6个部分积是高位部分乘法的第1个部分积,它的最高三位E1E2E3= E EE, E表示E的非。这是由于采用2位Booth编码时,第1个部分积和其余部分积符号扩展的方法不同。Figure 2 is a dot product diagram of the partial product of an ordinary 16-bit multiplier considering the weight of the partial product. The highest bit of the partial product is on the right and the lowest bit is on the left. E in the figure is the symbol of the partial product, and S indicates whether the partial product has been negated and complemented. When the partial product needs to be negated and complemented, it is not immediately converted to the complement of its complement, but through its It is represented by the redundant form of adding 1 to the lowest bit of the inverse code. Fig. 3 adopts the dot product diagram of the partial product of 16 (2n) mixed multipliers designed by the present invention, wherein 1-5 partial products are produced by partial product generator 1, and n/2+1=5 partial products is 0. The 6th to 10th partial products are generated by the partial product generator 2 . The sixth partial product is equivalent to the fifth partial product in Figure 3 in normal mode, and its highest three bits E 1 E 2 E 3 =E10; in SIMD mode, the sixth partial product is the high order part The first partial product of multiplication, its highest three bits E 1 E 2 E 3 = E EE, E represents the negation of E. This is because when 2-bit Booth encoding is used, the sign extension methods of the first partial product and the remaining partial products are different.

图4中以16位乘法为例对本发明修正值产生的原理进行说明。图中用1个16位的乘法器实现图3中低位部分的乘法,方法是把低位乘法的被乘数和乘数的符号位扩展8位,可以得到如图4(a)所示的部分积。把图4(a)中的部分积相加之后,可以得到图4(b)的结果,其中S=0或者1。把图4(a)中的部分积与图3中I区域中的低位乘法的部分积相比较,可以发现图4(a)只是多加了32′hfe00_0000,“fe”是图4(a)中右侧的区域II中的7个1的十六进制表示。当图3中低位部分乘积的符号位为0时,本发明对图3中区域I的部分积加上32′hfe00_0000;当低位部分乘积的符号位为1时,本发明对图2中区域I的部分积加上32′hfe01_0000,都可以使图3中区域I中部分积的最终结果变为图4(c)中的结果,即低位乘积的符号位不会对高位乘积产生影响。所加的值32′hfe00_0000或32′hfe01_0000即为修正值。In FIG. 4, the principle of correction value generation in the present invention is illustrated by taking 16-bit multiplication as an example. In the figure, a 16-bit multiplier is used to realize the multiplication of the low-order part in Figure 3. The method is to extend the sign bit of the multiplicand and the multiplier of the low-order multiplication by 8 bits, and the part shown in Figure 4(a) can be obtained product. After adding the partial products in Figure 4(a), the result in Figure 4(b) can be obtained, where S=0 or 1. Comparing the partial product in Figure 4(a) with the partial product of the low-order multiplication in the I region in Figure 3, it can be found that Figure 4(a) only adds 32'hfe00_0000, and "fe" is in Figure 4(a) The hexadecimal representation of the seven 1s in Region II on the right. When the sign bit of the low part product in Fig. 3 was 0, the present invention added 32' hfe00_0000 to the part product of region I in Fig. 3; The partial product of 32'hfe01_0000 can make the final result of the partial product in region I in Figure 3 become the result in Figure 4(c), that is, the sign bit of the low-order product will not affect the high-order product. The added value 32'hfe00_0000 or 32'hfe01_0000 is the correction value.

图5是采用本发明设计的混合乘法器的结构图,它由操作数扩展部件、译码器、部分积产生器1、部分积产生器2、修正值产生部件、部分积压缩部件和加法器组成。与普通乘法器相比,混合乘法器的操作数扩展部件除了进行一般的符号扩展之外,在SIMD模式下,要把被乘数1的第n至第(2n-1)位也扩展成符号位,被乘数2的低n位要置为0;乘数1和乘数2也是由操作数扩展部件产生。混合乘法器的部分积是由两个部分积产生器产生的,每个产生(n/2+1)个部分积,部分积产生器2需要根据工作模式确定它的第一个部分积最高三位的值。修正值产生部件根据控制信号和被乘数1与乘数1的符号位产生高位结果的修正值。部分积压缩部件把两个部分积产生器产生的(n+2)个部分积和高位结果的修正值压缩成两个4n位的数。最后的传播进位的加法器对这两个数求和得到一个4n位的乘积,在普通模式下,它就是两个2n位操作数的乘积;在SIMD模式下,低2n位是n位乘法的乘积,高2n位是高n位乘法的乘积。Fig. 5 is the structural diagram of the hybrid multiplier that adopts the design of the present invention, and it is by operand extension unit, decoder, partial product generator 1, partial product generator 2, correction value generation unit, partial product compression unit and adder composition. Compared with the ordinary multiplier, in addition to the general sign extension, the operand extension part of the hybrid multiplier should also extend the nth to (2n-1) bits of the multiplicand 1 into a sign in SIMD mode The lower n bits of the multiplicand 2 should be set to 0; the multiplier 1 and the multiplier 2 are also generated by the operand expansion unit. The partial products of the hybrid multiplier are generated by two partial product generators, each of which generates (n/2+1) partial products, and the partial product generator 2 needs to determine its first partial product up to three according to the working mode. bit value. The correction value generating unit generates a correction value of the high-order result according to the control signal and the sign bits of the multiplicand 1 and the multiplier 1. The partial product compression unit compresses (n+2) partial products generated by the two partial product generators and the correction values of high-order results into two 4n-bit numbers. The final adder that propagates the carry sums the two numbers to get a 4n-bit product. In normal mode, it is the product of two 2n-bit operands; in SIMD mode, the lower 2n bits are n-bit multiplication. The product, the upper 2n bits are the product of the multiplication of the upper n bits.

Claims (4)

1. method for designing of supporting the mixed multiplier of single instrction multioperand, comprise the operand widening parts in its mixed multiplier structure, code translator, partial-product generator, partial product compression member and totalizer, adopt two Booth multiplication to produce partial product, it is characterized in that also designing in the mixed multiplier structure modified value production part is arranged, the partial product production part is designed to two parts, by partial-product generator 1, partial-product generator 2 is formed, they are equivalent to the partial-product generator of a 2n * n multiplier respectively, produce low level and n/2+1 high-order partial product respectively, by a current mode of operation of control signal indication multiplier, code translator is according to the type of control signal judgment task pattern and operand, widening parts and the work of modified value production part are counted in control operation, the operand widening parts is under the control of code translator, operand is expanded, multiplicand 1 and multiplier 1 after the expansion are delivered to partial-product generator 1, multiplicand 2 and multiplier 2 are delivered to partial-product generator 2, partial-product generator 1 and partial-product generator 2 respectively produce n/2+1 partial product, deliver to the partial product compression member, when the modified value production part produces the SIMD pattern under the control of code translator to the modified value of high-order product, high 2n position to product is revised, and makes that the sign bit of low level product is 0; The partial product compression member is compressed into the high-order result's of n+2 partial-product sum of two partial-product generators generations modified value the number of two 4n positions, by propagating the add with carry musical instruments used in a Buddhist or Taoist mass this two numbers addition, finally obtain the product of a 4n position, under general mode, it is exactly the product of two 2n positional operands; Under the SIMD pattern, low 2n position is the product of low n position multiplication, and high 2n position is the product of high n position multiplication.
2. a kind of method for designing of supporting the mixed multiplier of single instrction multioperand as claimed in claim 1, it is characterized in that described operand widening parts expands operand 1 and operand 2, produce two multiplicands respectively and two multipliers are delivered to two partial-product generators, the length of multiplicand 1 and multiplicand 2 is the 2n+2 position, under general mode, the low 2n position of multiplicand 1 and multiplicand 2 equals operand 1, simultaneously high two sign bits that are extended to operand 1; Under the SIMD pattern, the low n position of multiplicand 1 equals the low n position of operand 1, and n to the 2n+1 position of multiplicand 1 all is extended to the sign bit of the low n position of operand 1; The low n position of multiplicand 2 is the high n position that 0, the n to the 2n-1 position equals operand 1, and the highest two is the sign bit that 2n and 2n+1 position expand to the high n position of operand 1; The length of multiplier 1 and multiplier 2 all is the n+3 position, multiplier 1 mainly comes from the low n position of operand 2, multiplier 2 mainly comes from the high n position of operand 2, the operand widening parts also will respectively be expanded 1 prefix and 2 bit sign positions in the front and back of multiplier 1 and multiplier 2, the prefix of multiplier 1 is 0, the sign bit of multiplier 2 is consistent with the sign bit of operand 2 high n positions, and the prefix of the sign bit of multiplier 1 and multiplier 2 is different configurations under different mode of operations.
3. a kind of method for designing of supporting the mixed multiplier of single instrction multioperand as claimed in claim 1, when it is characterized in that the present invention adopts two Booth multiplication to produce partial product, the input of partial-product generator 1 is multiplicand 1 and multiplier 1, the input of partial-product generator 2 is multiplicand 2 and multiplier 2, partial-product generator 1 produces n/2+1 partial product of low level, partial-product generator 2 produces n/2+1 high-order partial product, and partial-product generator 2 is determined the value of its Senior Three sign bit of first partial product according to mode of operation:
3.1 when mixed multiplier is operated in general mode, the 1st to n/2 partial product of partial-product generator 1 and general multipliers the 1st identical respectively to the production method and the power of n/2 partial product; N/2+1 partial product of partial-product generator 1 is 0, and the 1st to n/2+1 partial product of partial-product generator 2 is identical respectively with the production method and the power of n/2+1 to a n+1 partial product of general multipliers; Therefore when general mode, the partial product of mixed multiplier and general multipliers is just the same, and n+2 partial product of mixed multiplier added up promptly obtains the product of a 2n * 2n multiplication, and at this moment, the prefix of the sign bit of multiplier 1 and multiplier 2 all is changed to b N-1
3.2 when mixed multiplier was operated in the SIMD pattern, the high n position of the multiplicand 1 of partial-product generator 1 expanded to the symbol of operand 1 low n position, two sign bits of multiplier 1 expand to the sign bit of operand 2 low n positions; Produce the 1st identical during with general mode to the control code of n/2 partial product; The 1st is identical during with general mode to the power of n/2 partial product; N/2+1 partial product is by [s, s, b N-1] control generation, wherein b N-1Be the most significant digit of low n position multiplier, s is a sign bit, when the low level multiplier is signed number, and s=b N-1, when the low level multiplier is unsigned number, s=0; The power of n/2+1 partial product is n; Under the SIMD pattern, the low n position of the multiplicand 2 of partial-product generator 2 is changed to 0, and high n position remains unchanged, and the prefix of multiplier 2 is 0; The control code of the 1st partial product of the generation of partial-product generator 2 is by [b N+1, b n, b N-1] become [b N+1, b n, 0]; The remainder of partial-product generator 2 is identical when amassing with general mode; The power of partial-product generator 2 all partial products remains unchanged; Under the SIMD pattern, each partial-product generator all is equivalent to the partial-product generator of the multiplier of a 2n * n, the long-pending low portion that is positioned at the partial product of partial-product generator 1 of the live part of low n positional operand multiplication, the long-pending high-order portion that is positioned at the partial product of partial-product generator 2 of the live part of high n positional operand multiplication.
4. a kind of method for designing of supporting the mixed multiplier of single instrction multioperand as claimed in claim 1, it is characterized in that method that the present invention revises the result of high 2n position is that result to high 2n position adds a modified value when the SIMD pattern, concrete grammar is to make the sign bit of low level product expand to the most significant digit of high-order product, when the sign bit of low level product is 0, the low level product can not exert an influence to high-order product, and this moment, the lowest order at high-order product added one 0; When the sign bit of low level product is 1, add one 1 at the lowest order of high-order product, just can make the symbol at high-order product place of low level product become 0; For the sign bit that makes the low level multiplication expands to the most significant digit of high-order product, the present invention adds 2 in the highest n-1 position of high-order product N-1-1, therefore, the modified value under the SIMD pattern of the present invention is made up of two parts, be added in high-order product lowest order 0 or 1 and be added in 2 on the high n-1 position N-1-1, this modified value adds 2 by the modified value production part is created in high-order product under the control of code translator the highest n-1 position N-1-1, the modified value under the SIMD pattern promptly of the present invention is made up of two parts, be added in high-order product lowest order 0 or 1 and be added in 2 on the high n-1 position N-1-1, this modified value is produced under the control of code translator by the modified value production part.
CNB2004100467180A 2004-09-02 2004-09-02 Design method of number mixed multipler for supporting single-instruction multiple-operated Expired - Fee Related CN100356315C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100467180A CN100356315C (en) 2004-09-02 2004-09-02 Design method of number mixed multipler for supporting single-instruction multiple-operated

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100467180A CN100356315C (en) 2004-09-02 2004-09-02 Design method of number mixed multipler for supporting single-instruction multiple-operated

Publications (2)

Publication Number Publication Date
CN1598757A true CN1598757A (en) 2005-03-23
CN100356315C CN100356315C (en) 2007-12-19

Family

ID=34665679

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100467180A Expired - Fee Related CN100356315C (en) 2004-09-02 2004-09-02 Design method of number mixed multipler for supporting single-instruction multiple-operated

Country Status (1)

Country Link
CN (1) CN100356315C (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986263A (en) * 2010-11-25 2011-03-16 中国人民解放军国防科学技术大学 Method and microprocessor for supporting single instruction stream and multi-instruction stream dynamic switching execution
CN102253822A (en) * 2011-08-17 2011-11-23 电子科技大学 A Modular (2n-3) Multiplier
CN102360281A (en) * 2011-10-31 2012-02-22 中国人民解放军国防科学技术大学 Multifunctional fixed-point media access control (MAC) operation device for microprocessor
CN102591615A (en) * 2012-01-16 2012-07-18 中国人民解放军国防科学技术大学 Structured mixed bit-width multiplying method and structured mixed bit-width multiplying device
CN107636640A (en) * 2016-01-30 2018-01-26 慧与发展有限责任合伙企业 Dot product engine with designator of negating
CN110399117A (en) * 2019-07-31 2019-11-01 上海燧原智能科技有限公司 A kind of mixing multiplication addition process method and device
CN111008003A (en) * 2019-09-24 2020-04-14 上海寒武纪信息科技有限公司 Data processor, method, chip and electronic equipment
CN113031918A (en) * 2019-12-24 2021-06-25 上海寒武纪信息科技有限公司 Data processor, method, device and chip
CN116991359A (en) * 2023-09-26 2023-11-03 上海为旌科技有限公司 Booth multiplier, hybrid Booth multiplier and operation method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3139466B2 (en) * 1998-08-28 2001-02-26 日本電気株式会社 Multiplier and product-sum operator

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101986263A (en) * 2010-11-25 2011-03-16 中国人民解放军国防科学技术大学 Method and microprocessor for supporting single instruction stream and multi-instruction stream dynamic switching execution
CN101986263B (en) * 2010-11-25 2012-08-22 中国人民解放军国防科学技术大学 Method and microprocessor for supporting single instruction stream and multi-instruction stream dynamic switching execution
CN102253822A (en) * 2011-08-17 2011-11-23 电子科技大学 A Modular (2n-3) Multiplier
CN102253822B (en) * 2011-08-17 2013-07-17 电子科技大学 Modular (2<n>-3) multiplier
CN102360281B (en) * 2011-10-31 2014-04-02 中国人民解放军国防科学技术大学 Multifunctional fixed-point media access control (MAC) operation device for microprocessor
CN102360281A (en) * 2011-10-31 2012-02-22 中国人民解放军国防科学技术大学 Multifunctional fixed-point media access control (MAC) operation device for microprocessor
CN102591615A (en) * 2012-01-16 2012-07-18 中国人民解放军国防科学技术大学 Structured mixed bit-width multiplying method and structured mixed bit-width multiplying device
CN107636640A (en) * 2016-01-30 2018-01-26 慧与发展有限责任合伙企业 Dot product engine with designator of negating
CN110399117A (en) * 2019-07-31 2019-11-01 上海燧原智能科技有限公司 A kind of mixing multiplication addition process method and device
CN110399117B (en) * 2019-07-31 2021-05-28 上海燧原智能科技有限公司 Hybrid multiplication and addition processing method and device
CN111008003A (en) * 2019-09-24 2020-04-14 上海寒武纪信息科技有限公司 Data processor, method, chip and electronic equipment
CN111008003B (en) * 2019-09-24 2023-10-13 上海寒武纪信息科技有限公司 Data processor, method, chip and electronic equipment
CN113031918A (en) * 2019-12-24 2021-06-25 上海寒武纪信息科技有限公司 Data processor, method, device and chip
CN116991359A (en) * 2023-09-26 2023-11-03 上海为旌科技有限公司 Booth multiplier, hybrid Booth multiplier and operation method
CN116991359B (en) * 2023-09-26 2023-12-22 上海为旌科技有限公司 Booth multiplier, hybrid Booth multiplier and operation method

Also Published As

Publication number Publication date
CN100356315C (en) 2007-12-19

Similar Documents

Publication Publication Date Title
Vázquez et al. A new family of high. performance parallel decimal multipliers
Vazquez et al. Improved design of high-performance parallel decimal multipliers
Erle et al. Decimal multiplication with efficient partial product generation
Luo et al. Accelerating pipelined integer and floating-point accumulations in configurable hardware with delayed addition techniques
JP3139466B2 (en) Multiplier and product-sum operator
CN1928809A (en) System, apparatus and method for performing floating-point operations
JPH07506444A (en) small multiplier
CN1288545A (en) Method and apparatus for arithmetic operation
CN1598757A (en) Design method of number mixed multipler for supporting single-instruction multiple-operated
Ramya et al. Low power single precision BCD floating–point Vedic multiplier
CN1786900A (en) Multiplier based on improved Montgomey&#39;s algorithm
Erle et al. Decimal floating-point multiplication
CN102253822B (en) Modular (2&lt;n&gt;-3) multiplier
Sharma et al. Modified booth multiplier using wallace structure and efficient carry select adder
Mohan et al. Evaluation of Mixed-Radix Digit Computation Techniques for the Three Moduli RNS {2 n− 1, 2 n, 2 n+ 1− 1}
Merchant et al. Efficient realization of table look-up based double precision floating point arithmetic
Daud et al. Hybrid modified booth encoded algorithm-carry save adder fast multiplier
CN110506255B (en) Energy-saving variable power adder and use method thereof
CN112631546B (en) High-performance modular multiplier based on KO-8 algorithm
CN115904507A (en) CGRA-oriented multi-precision small-area SIMD operation system, method, medium and device
Kumar et al. VLSI architecture of pipelined booth wallace MAC unit
CN103699729A (en) Modulus multiplier
CN102929575B (en) A Modular (2n+3) Multiplier
Soni et al. An Enhanced Two-Speed, Radix-4 Multiplier using Spurious Power Suppression Technique
Issa et al. Design and implementation of sign-digit floating point multiplier unit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20071219

Termination date: 20190902