TWI247240B - Extendable squarer and square operation method - Google Patents

Extendable squarer and square operation method Download PDF

Info

Publication number
TWI247240B
TWI247240B TW93120608A TW93120608A TWI247240B TW I247240 B TWI247240 B TW I247240B TW 93120608 A TW93120608 A TW 93120608A TW 93120608 A TW93120608 A TW 93120608A TW I247240 B TWI247240 B TW I247240B
Authority
TW
Taiwan
Prior art keywords
bit
data
square
code
operator
Prior art date
Application number
TW93120608A
Other languages
Chinese (zh)
Other versions
TW200602967A (en
Inventor
Shi-Ho Tien
Ching-Chun Meng
Tzu-Yin Chu
Yow-Ling Gau
Original Assignee
Chung Shan Inst Of Science
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 Chung Shan Inst Of Science filed Critical Chung Shan Inst Of Science
Priority to TW93120608A priority Critical patent/TWI247240B/en
Application granted granted Critical
Publication of TWI247240B publication Critical patent/TWI247240B/en
Publication of TW200602967A publication Critical patent/TW200602967A/en

Links

Landscapes

  • Complex Calculations (AREA)
  • Logic Circuits (AREA)

Abstract

An extendable squarer applied for processing a square operation of an n bit data has a bit expanding circuit and a plurality of operation units. The bit expanding circuit has n-1 bit expanding output terminals applied for outputting a plurality of bit expanding data. The operation units receive a plurality of bit codes forming the n bit data respectively based on the weight of binary. In addition, except the operation unit receiving the MSB code, the rest of the operation units receive the corresponding bit expanding data output by the bit expanding circuit respectively. The present invention evaluates the square operation value of the n bit data based on the corresponding bit expanding data and bit code.

Description

I247^4fitwf.doc/006 九、發明說明: 【發明所屬之技術領域】 本發明是有關於一種平方運算器,且特別是有關 於一種可擴充式平方運算器。 【先前技術】 在VLSI電路、通訊系統或是雷達系統中,經常 需要將訊號進行平方運算。在最早期,系統中的平方 運异係採用乘法器,但是對於複雜的運算系 子化的電路系統,可能需要成千上萬的 並不符合製造成本。 為要解決上述的問題,一些平方運算的技術和電 路開始被發展出來。圖1係繪示一種B〇〇th的乘法技 術之流程表。請參照圖卜其中y為被乘積項,X為 乘積項,而下標i則表示位元數,係一正整數。Booth 的乘法技術係每次運算時,會檢查3個位元而跳過2 個位元,因此會重疊丨個位元,而會產生m/2列的部 分乘積項,如圖1所綠示。 圖2係繪示一種一般平方運算器之部分乘積矩 陣:请參照圖2 ’纟巾A代表位元碼,而下標則用來 標示個別位元碼的位元數。在圖2中的部份乘積矩 陣,係表示一 4位元資料(Α()ΑιΑ2Α3)的平方運算過 程。 此外,習知常用來進行平方運算的技術,還包括 Booth編碼技術。以計算8位元資料為例,當一個8 1247孤 '.doc/006 位元資料要使用Booth編碼技術來進行平方運瞀 時,先將此8位元資料表示如下: # —卜27 +έ626 + …+ 6。2° =5326 +5224 +孕22 +5。2° 其中,b為8位元資料的位元碼,而下標則用來表示 個別位元碼所在的位元數。此外,、β2、&和b 係利用Booth編碼技術所獲得的運算子,用通 4I247^4fitwf.doc/006 IX. Description of the Invention: [Technical Field] The present invention relates to a square operator, and more particularly to an expandable square operator. [Prior Art] In a VLSI circuit, a communication system, or a radar system, it is often necessary to square the signal. In the earliest days, the squared transport in the system used multipliers, but for complex computing subsystems, thousands of systems may be required that do not meet manufacturing costs. In order to solve the above problems, some techniques and circuits for square operations have begun to develop. Fig. 1 is a flow chart showing a multiplication technique of B〇〇th. Please refer to Figure 卜 where y is the product of the product, X is the product term, and subscript i is the number of bits, which is a positive integer. Booth's multiplication technique checks 3 bits and skips 2 bits for each operation, so it overlaps one bit and produces a partial product of m/2 columns, as shown in Figure 1. . Fig. 2 is a partial product matrix of a general square operator: Please refer to Fig. 2's towel A for the bit code, and the subscript for the number of bits for the individual bit code. The partial product matrix in Fig. 2 represents the square operation of a 4-bit data (Α()ΑιΑ2Α3). In addition, conventional techniques for performing square operations are also known, including Booth encoding techniques. Taking the calculation of 8-bit data as an example, when an 8 1247 orphan '.doc/006 bit data is to be squared using Booth coding technology, the 8-bit data is first expressed as follows: #—卜27 +έ626 + ... + 6. 2 ° = 5326 + 5224 + pregnancy 22 + 5. 2 ° where b is the bit code of the 8-bit data, and the subscript is used to indicate the number of bits in which the individual bit code is located. In addition, β2, & and b are the operators obtained by Booth coding technology.

示係如下所示: I 圖3係繪示8位元Booth摺疊部分乘積矩陣。依 照圖3所示,我們可以將8位元資料的平方值用以 的式子來表示: (2B326 +25224 +2B{22)xB02° +B0 x2° + (2B324 +2B222)xB124 + Βλ xBx24 + (2B322)xB22s ^B2xB22s + B3xB3212 再將以上的式子整理成下式: (户。23 + C0) + (6 23 + ς )24 + 〇P2 23 + C2 )28 + C3 2〗2 其中,P和c的通式係如下所示:The system is as follows: I Figure 3 shows the product matrix of the 8-bit Booth folded part. According to Figure 3, we can express the square value of the 8-bit data using: (2B326 +25224 +2B{22)xB02° +B0 x2° + (2B324 +2B222)xB124 + Βλ xBx24 + (2B322)xB22s ^B2xB22s + B3xB3212 Then formulate the above formula into the following formula: (household. 23 + C0) + (6 23 + ς ) 24 + 〇 P2 23 + C2 ) 28 + C3 2 〗 2 where P The general formulas of c and c are as follows:

Ci^=BixBi / = 1,...j4 + 〜2、..· + υ〇4Α·+12。)% 習知用來對資料進行平方運算之技術的缺點,在 於貝現廷些技術所需要的電路面 體系統的體積無法進行大幅度的限縮_二U使件王文 【發明内容】 因此, 算器,可以 本發明的目的就是在提供—種可擴充式平方運 有效地縮減電路的面積。 1247孤 doc/〇〇6 1247孤 doc/〇〇6 種平方運算方法,可以適 ’用來對一資料進行平方 本發明的再一目的是提供一 用於上述的可擴充式平方運算器 運算。 本發明之目的在提供一種可擴充式平方運算器,可以 用來處理- η位元資料的平方運算,“係不為〇的正整 數本!X月内包括了一位元擴充電路和數個計算單元。在 位元擴充電路上,係具有η]個位元擴充輸出端,用來分 別對應輸出數筆位元擴充資料,其中帛!個位元擴充資料 的内容為 k=\ 7=2 其中,k、bj和bj+1分別為n位元資料之第、』和i+i 位元的位it碼’而卜』和k都是正整數。此外,計算單元 則依照二進位之權重(Weight)分別對應接收用來組成η位 ,資料的位元碼’並且除了接收最高位^之位元碼的計算 早兀之外’其餘計算單元之輸人,係分別對應純位元擴 充電路的位元擴充輸出端,以分別對應接收所輸出的位元 擴充資料。另夕卜,每-個計算單元會將對應之位元擴充資 料乘與位it碼相乘之後,再乘以2的平方,並且加上對應 之位元碼的平方值以得到一運算子。 在本發明的實施例中,本發明還包括一加法運算單 疋’係用來接收所有計算單元的輸出。加法運算單元會分 別將=一個計算單元的輸出進行下列運算 /=0 其中Si為接收第i個位元碼之計算單元所產生的運算子,❿Cn i則為 接收最咼位7L之位元碼的計算單元所產生之運算子,其等於最高位元 doc/006 之位元碼的平方值。 在較佳的情況下,本發明還包括 進位權重而產生所有的位元碼。 從另一觀點來看,本發明提供一種平方運曾方去 以計算一 η位元資料的平方值’而此n位元資料係由η: 位元碼所組成,而η為正整數。本發明之平方運算方法的 步驟係如下所述。首先’產生n-丨個位元擴充資料,其中 第i個位元擴充資料的内容為 λ-3 n-2 k=l j=2 而bn_〗、bj和bj+l分別為n位元資料之第〜丨、j和i+l位元 的位元碼,並且i、j和k都為正整數。接著,除了最高位 元的位元碼之外,每一個位元碼都分別對應乘以其中一個 位元擴充資料,而產生數個計算值。然後將每一計算值乘 以2的平方之後,再加上對應之位元碼的平方值而獲得數 個運算子。最後則將這些運算子進行下列的運算而得到^ 位元資料之平方值 /=0 其中,A為第i個位元碼所對應之運算子,而L則為最高位元之位元 碼所對應之運异子’其等於最高位元之位元碼的平方值。 斤。在本發明的貫施例中,11位元資料之最高位元碼係代表 :號位元,用以決定n位元資料是否為正值。而當n位元 貝料為負值時’則將所有的位元擴充資料反相後再進行運 算。 V、上所述’本發明所提供的數個數學式,可以使得計 1247240 13853twf.doc/006 算單兀分別依據位元碼和對應的位元擴充資料而獲得相關 的運异子,並進而計异n位元資料的平方值。而依據這些 式子,可以將本發明提供的可擴充式平方運算器的電路體 積有效地減低,因此連帶地,也減低了整體系統的硬體成 本和體積。 u為讓本發明之上述和其他目的、特徵和優點能更明顯 易十重,下文特舉較佳實施例,並配合所附圖式,作詳細說 明如下。 【實施方式】 為求使熟習此技藝者能夠明瞭本發明的精神,首先以4 位元資料和8位元資料之平方運算的數學模型進行說明。 我們先將一個4位元資料成以下的表示式: +b222 ^b{21 +b02° 4位元資料内的位元碼,而下標則用來表示個 碼的位元數。__可以將此4位元資料的平方 運整理成圖4中的矩陣,圖終+ 佳實施例的一種4位元之二發明之-較 兀^貝枓千方運异的運算矩陣。嗜夂 '、、、圖?我:可,圖4中的矩陣 h(-2b32、2b22、2bi2i)xbQ2、bQxb〆 彳的式子· + (~2ό322 +2ό221)χόι22 x^22 + (-2b32l)xb224 +b2xb224 ..........( 1 ) + b3xb326 然後將第(1)式整理成下式·· 其中S和c可以表示如下: (2) doc/〇〇6 5 广(巧22+CV) ho,···,。 ,= 〇”·.,2 —s、、 第(2)式中的P則定義為: ,= 〇,···,2 :J下J們將。|中括號的部份定義為ΒΕ,,則可以將。,改Ci^=BixBi / = 1,...j4 + 〜2,..· + υ〇4Α·+12. %) The shortcoming of the technique used to square the data is that the volume of the circuit surface system required by these technologies cannot be greatly limited. The calculator, the object of the present invention is to effectively reduce the area of the circuit by providing an expandable square operation. 1247 orphan 〇〇 / 〇〇 6 1247 orphan doc / 〇〇 6 kinds of square operation method, can be used to square a data. A further object of the present invention is to provide an expandable square operator operation for the above. The object of the present invention is to provide an expandable square operator which can be used to process the square operation of the -n bit data. "The positive integer is not a !! The X month includes a one-dimensional expansion circuit and several The calculation unit. On the bit expansion circuit, there are η] bit expansion output ends, which are respectively used for outputting the number of bit expansion data, wherein the content of the 扩充! bit expansion data is k=\ 7=2 Where k, bj, and bj+1 are the nth bit of the n-bit data, respectively, and the bit it code of the i+i bit, and k is a positive integer. In addition, the calculation unit is weighted according to the binary ( Weight) respectively corresponding to the bit code of the data received to form the η bit, and the input of the remaining computing unit except for the calculation of the bit code of the highest bit ^, respectively corresponding to the pure bit expansion circuit The bit expands the output end to respectively correspondingly receive the output bit expansion data. In addition, each calculation unit multiplies the corresponding bit expansion data by the bit it code, and then multiplies the square of 2 And adding the square value of the corresponding bit code to get In an embodiment of the present invention, the present invention further includes an addition unit 疋' for receiving the outputs of all the calculation units. The addition unit will respectively perform the following operations on the output of one calculation unit / =0 Si is the operator generated by the calculation unit that receives the i-th bit code, and ❿Cn i is the operator generated by the calculation unit that receives the bit code of the last bit 7L, which is equal to the bit of the highest bit doc/006. In the preferred case, the present invention also includes carry weights to generate all the bit codes. From another point of view, the present invention provides a square transport to calculate an n-bit data. The squared value 'and the n-bit data is composed of η: bit code, and η is a positive integer. The steps of the square operation method of the present invention are as follows. First, 'generate n-丨 bit expansion data , wherein the content of the i-th bit expansion data is λ-3 n-2 k=lj=2 and bn_, bj, and bj+l are the first 丨, j, and i+l bits of the n-bit data, respectively. Bit code, and i, j, and k are both positive integers. Then, except for the highest bit In addition to the bit code, each bit code is multiplied by one of the bit expansion data, and several calculated values are generated. Then each calculated value is multiplied by the square of 2, and then the corresponding bit is added. The operator obtains several operators by the square value of the code. Finally, these operators perform the following operations to obtain the square value of the bit data /=0 where A is the operator corresponding to the i-th bit code. And L is the operator of the highest bit, which is equal to the square of the bit code of the highest bit. In the embodiment of the present invention, the highest bit of the 11-bit data The code system represents: the number bit is used to determine whether the n-bit data is positive. When the n-bit material is negative, then all the bit expansion data are inverted and then operated. V, the above-mentioned several mathematical formulas provided by the present invention, such that the 12472240 13853 twf.doc/006 calculation unit obtains the relevant transport elements according to the bit code and the corresponding bit expansion data respectively, and further Calculate the squared value of the n-bit data. According to these equations, the circuit volume of the expandable square operator provided by the present invention can be effectively reduced, thereby reducing the hardware cost and volume of the overall system. The above and other objects, features, and advantages of the present invention will become more apparent and appreciated. [Embodiment] In order to enable the skilled person to understand the spirit of the present invention, a mathematical model of the square operation of 4-bit data and 8-bit data is first described. We first make a 4-bit data into the following expression: +b222 ^b{21 +b02° The bit code in the 4-bit data, and the subscript is used to represent the number of bits in the code. __ can be used to organize the square of the 4-bit data into the matrix in Figure 4, and the end of the figure + a four-bit second invention of the preferred embodiment - the operation matrix of the 兀^枓枓 枓 运.夂 夂 ',,, map? I: Yes, the matrix h (-2b32, 2b22, 2bi2i) xbQ2, bQxb〆彳 in the figure of Figure 4 + (~2ό322 +2ό221)χόι22 x^22 + (-2b32l)xb224 +b2xb224 .... (1) + b3xb326 Then classify the formula (1) into the following equation: where S and c can be expressed as follows: (2) doc/〇〇6 5 广(巧22+CV) ho, ···,. , = 〇"·., 2 - s,, P in the formula (2) is defined as: , = 〇, ···, 2: J, J will be. | The brackets are defined as ΒΕ, , you can change it.

Pi = BEi X b.......... — z ............-.........(3) 將著-我們时論8位兀資料的平方運算。同樣地,先 將8位7〇資料展開成下式: B - ~672 + 0626 +6525 +6424 +6323 +6222 +^21 +Z>02° 然後我們將8位it資料的平方運算以圖5的矩陣來表示, 圖5係繪示依照本發明之一較佳實施例的一種8位元之次 料平方運算的運算矩陣。請參照圖5,我們同樣可以貝 中的气陣展開成下式: 間) = (-26727 十 26626 + 26525 + 2¾24 + 2M3 + 26222 + 26,21) X 6。2% 6 x 6 2〇 + {-2b, 26 +2b625 +2b52A +2b423 +2b,22 +2b22l)xbx22 +blX bx 22° ° + (-267 25 + 265 24 + 2¾ 23 + 26322 + 262 21) x 24 + x Z>2 24 ' + {-2b, 24 -f 2*6 23 + 2Z?5 22 + 2¾ 21) x 63 26 + 63 x 63 26 + (-26723 +2i622 +26521)x6428 +b4xb42s ^-(-2b722 +2b62l)xb5210 +b5xb5210 + (-2b72l)xb62u+b6xb6212 + i7 xZ>7214 然後同樣將上述式子整理成: 50 + ^ 22 + 52 24 + 53 26 + 54 28 + 55 210 + 56 212 + C7 214 而S和C還是表示成:Pi = BEi X b.......... — z ............-......(3) will be - we will talk about 8平方 The square operation of the data. Similarly, first expand the 8-bit 7〇 data into the following formula: B - ~672 + 0626 +6525 +6424 +6323 +6222 +^21 +Z>02° Then we will square the 8-bit it data to Figure 5 The matrix is shown. FIG. 5 illustrates an operational matrix of an 8-bit quadratic operation in accordance with a preferred embodiment of the present invention. Referring to Figure 5, we can also expand the air array in the following equation: ()) = (-26727 ten 26626 + 26525 + 23⁄424 + 2M3 + 26222 + 26, 21) X 6. 2% 6 x 6 2〇+ {-2b, 26 +2b625 +2b52A +2b423 +2b,22 +2b22l)xbx22 +blX bx 22° ° + (-267 25 + 265 24 + 23⁄4 23 + 26322 + 262 21) x 24 + x Z> 2 24 ' + {-2b, 24 -f 2*6 23 + 2Z?5 22 + 23⁄4 21) x 63 26 + 63 x 63 26 + (-26723 +2i622 +26521)x6428 +b4xb42s ^-(-2b722 +2b62l) Xb5210 +b5xb5210 + (-2b72l)xb62u+b6xb6212 + i7 xZ>7214 Then the above formula is also organized into: 50 + ^ 22 + 52 24 + 53 26 + 54 28 + 55 210 + 56 212 + C7 214 and S and C is still expressed as:

Sj:、Pj2l+Cf、 7 = 0,-..,6 C. = b; x b; 其中P為: ίο 1247¾^ oc/006 Pi =(-^26^+0625^/ = 0,...,6Sj:, Pj2l+Cf, 7 = 0,-..,6 C. = b; xb; where P is: ίο 12473⁄4^ oc/006 Pi =(-^26^+0625^/ = 0,... ,6

+6/+i2〇)x^ 而定義+6/+i2〇)x^ and defined

Pi中括號的部份為 BEi,則同樣也可以改寫成第(3) @ 6係繪不依照本發明之一較佳實施例的 ::法之步驟流程圖。將上述4位元資料和8位元資料: =方運异的結果作-個歸納,本發明提出n位元的平方運 =法’如圖6所示。請參照圖6,依照本實施例的步驟, 本勒明可以用來處理n位元的資料的平方運算。而此 凡的資料可以展開成下式: 首,,如步驟S61〇所述,產生n]個位元擴充資料be, 而弟i個位元擴充資料BE可以表示成下式: n-3 n-2 A广·+ΣΣΜ〜μ2〇 k=\ y=2 =九2〜4Λ_22"-3-’ + …+ 622Ά+12。 / = 然後如步驟S620所述,將每一個位元擴充資料乘以對應的 位元碼而產生數個計算值,係如上述之第(3)式所表八的 P,並且進行步驟S630,將每一個計算值p乘以2的=方 後再加上對應之位元碼的平方而得到運算子s,係如 示: 工所 ^j = 22 + Cj) j 二 0”··,η - 2 c/ H / = 〇,·.,-1 最後則如步驟S640所述,依據所有的運算子s來得到n位 元資料之平方運算的結果為: M) 以上之η位元資料的最高位元碼,係可以當作$ 元,用來決定此η位元資料的正負性。若是η位元 1247為〇^/006 負值時’則上述之位元擴充資料be須取反相後在進行運 算。 圖7係繪示依照本發明之一較佳實施例的^位元可擴 充式平方運算器之架構方塊圖。請參照圖7,本實施例中的 可擴充式平方運算器,係依據圖6之平方運算方法所設計。 在圖7中’位元擴充電路701具有η-ΐ個位元擴充輸出端, 可以分別送出n-1筆位元擴充資料(BEg〜BEn_2)至計算單元 (A〇〜An_2)。另外,在圖7的架構中,本發明包含了 ^個計 早兀(Α〇 Αη· 1) ’其依照^一進位的權重(Weight)而分別對廉 接收用來組成η位元資料的η個位元碼。 請繼續參照圖7,在本實施例中,本發明更包括了解碼 器703和加法單元705。其中解碼器703係耦接至計算單元 (Α〇〜An-ι)的輸入’係用來產生η個位元碼至對應的計算單 元。而每一個計算單元都會依據其輸入的資料,產生運算 子至加法單元705,以對η位元資料進行平方運算。當解碼 器703將一 η位元資料解碼成^個位元碼(bG〜bn·!)後,會分 別將這些位元碼(bG〜U送至計算單元(Ag〜An l)。此時,位 兀擴充電路701也會產生η·ι筆位元擴充資料(BE()〜Bu 至計算單元(A〇〜An_2)。而除了接收最高位元之位元碼的計 #單元An·〗之外’其餘計算單元(aq〜An_2)會如圖6之步驟 S620和S630所述,依據對應的位元擴充資料BEi和位元碼 bi而產生運算子(SG〜Sn_2)至加法單元705。而計算單元An l 則將所接收之位元碼bn_!取其平方值後,也會產生運算子 Cn」至加法單元705。而加法單元7〇5則依據所有計算單元 (A〇〜Ay)的輸出,如步驟S64〇所述,計算出^位元資料的 平方值0 12 1247觀· doc/006 圖8係繪示依照本發明之一實施例的一種i6位元 充式平方運算ϋ之架構方塊圖。請參照圖8,為了能夠以更 小的電路面積來處理龐大的資料運算,因此本發明之可擴 充式平方運算器還可以採用模組化的技術。例如在圖8 ^ 的可擴充式平方運算器,同樣包括位元擴充電路8〇ι、解碼 器803和加法單元805。但是特別的是’其中的計算單元係 採用例如810的運算模組來實現,而其中的工作原理可以 參照圖6和圖7所述,因此不再多作敘述。The part of the parentheses in Pi is BEi, and the same can be rewritten as the (3) @6 series of steps of the following method which does not follow a preferred embodiment of the present invention. The above-mentioned 4-bit data and 8-bit data: = the result of the square-way data are summarized, and the present invention proposes that the n-bit squared motion = method' is shown in Fig. 6. Referring to FIG. 6, according to the steps of this embodiment, Benleming can be used to process the square operation of the n-bit data. And the ordinary data can be expanded into the following formula: First, as described in step S61, generating n] bit expansion data be, and the i-bit expansion data BE can be expressed as follows: n-3 n -2 A wide · + ΣΣΜ ~ μ2 〇 k = \ y = 2 = nine 2 ~ 4 Λ _22 " -3- ' + ... + 622 Ά +12. / = Then, as described in step S620, multiplying each bit expansion data by the corresponding bit code to generate a plurality of calculated values, such as P of Table 8 of the above formula (3), and proceeding to step S630, Multiply each calculated value p by the square of 2 and then add the square of the corresponding bit code to obtain the operator s, as shown in the figure: ^^ = 22 + Cj) j 2 0"··, η - 2 c / H / = 〇, ·., -1 Finally, as described in step S640, the result of the square operation of the n-bit data based on all the operators s is: M) The above η bit data The highest bit code can be used as the $ yuan to determine the positive and negative of the η bit data. If the η bit 1247 is 〇^/006 negative value, then the above bit expansion data be must be inverted. Figure 7 is a block diagram showing the architecture of a bit-expandable square operator according to a preferred embodiment of the present invention. Referring to Figure 7, the expandable square operator in this embodiment is shown. It is designed according to the square operation method of Fig. 6. In Fig. 7, the 'bit expansion circuit 701 has η-ΐ bit expansion output terminals, which can be divided. The n-1 pen bit expansion data (BEg~BEn_2) is sent to the calculation unit (A〇~An_2). In addition, in the architecture of Fig. 7, the present invention includes a number of premature (Α〇Αη·1) ' It receives the n bit codes used to form the n-bit data respectively according to the weight of the carry. Referring to FIG. 7, in the embodiment, the present invention further includes the decoder 703 and Adding unit 705. The decoder 703 is coupled to the input unit of the computing unit (Α〇~An-ι) for generating n bit codes to the corresponding computing unit, and each computing unit is based on the input thereof. Data, an operator is generated to the addition unit 705 to perform square operation on the n-bit data. When the decoder 703 decodes an n-bit data into ^bit codes (bG~bn·!), these will be respectively The bit code (bG~U is sent to the calculation unit (Ag~An1). At this time, the bit expansion circuit 701 also generates the η·ι pen bit expansion data (BE()~Bu to the calculation unit (A〇~ An_2). Except for the unit #··· which receives the highest-order bit code, the remaining calculation units (aq~An_2) will As shown in steps S620 and S630 of FIG. 6, the operator (SG~Sn_2) is generated according to the corresponding bit extension data BEi and the bit code bi to the addition unit 705. The calculation unit An1 then receives the received bit code. After taking the square value of bn_!, the operator Cn" is also generated to the adding unit 705. The adding unit 7〇5 calculates the output according to the output of all the calculating units (A〇~Ay) as described in step S64. The square value of the bit data is 0 12 1247. doc/006 FIG. 8 is a block diagram showing the architecture of an i6-bit charging square operation according to an embodiment of the present invention. Referring to Fig. 8, in order to be able to process a large data operation with a smaller circuit area, the expandable square operator of the present invention can also adopt a modular technique. For example, the expandable square operator of Fig. 8^ also includes a bit expansion circuit 8〇, a decoder 803, and an addition unit 805. However, in particular, the computing unit therein is implemented by a computing module such as 810, and the working principle thereof can be referred to FIG. 6 and FIG. 7, and therefore will not be described again.

雖然在圖8中,係將16位元可擴充式平方運算器以模 組化的技術來實現,但並不限制只有16位元可擴充式平方 運算器。熟習此技藝者當知道,4位元、8位元或其他規格 的可擴充式平方運算器,都可以採取圖8中的形式來實現, 並且每-個運算模組内包含的計算單原本發明也不加 制0Although in Figure 8, the 16-bit scalable square operator is implemented as a modular technique, it is not limited to a 16-bit scalable square operator. Those skilled in the art will recognize that a 4-bit, 8-bit or other scalable expandable square operator can be implemented in the form of Figure 8, and the calculations contained in each of the operational modules are originally invented. No added 0

綜上所述,依照本發明之平方運算方法所設計的可擴 充式平方運算H,可以對η位元資料進行平方運算。而因 為本發明係將η位元資料直接進行平分運算,再歸納其中 的法則來設計可擴充式平方運算器。因此,本發明之;^擴 充式平方運算器可以將低硬體的成本。此外,本發明之可 擴充式平方運算器還可以採用模組化的方式來設計,更使 得硬體的面積降低,進而降低整體系統的硬體成本。 雖然本發明已以較佳實施例揭露如上,然其並非用以 限定本發明,任何熟習此技藝者,在不脫離本發明之精神 和範圍内,當可作些許之更動與潤飾,因此本發明之保護 範圍當視後附之申請專利範圍所界定者為準。 叹 13 1247孤 doc/006 【圖式簡單說明】 圖1係續^示一種Booth的乘法技術之流程表。 圖2係繪示一種一般平方運算器之部分乘積矩 陣。 圖3係繪示8位元Booth摺疊部分乘積矩陣。 圖4係繪示依照本發明之一較佳實施例的一種4 位元之資料平方運算的運算矩陣。 圖5係繪示依照本發明之一較佳實施例的一種8 位元之資料平方運算的運算矩陣。 圖6係繪示依照本發明之一較佳實施例的一種 平方運算方法之步驟流程圖。 圖7係繪示依照本發明之一較佳實施例的η位元 可擴充式平方運算器之架構方塊圖。 圖8係繪示依照本發明之一實施例的一種16位 元可擴充式平方運算器之架構方塊圖。 【主要元件符號說明】 701、801 :位元擴充電路 703、803 :解碼器 705、805 :加法單元 810 :運算模組 S610、S620、S630、S640 ··平方運算方法之步 驟流程 14In summary, according to the scalable square operation H designed by the square operation method of the present invention, the η bit data can be squared. However, in the present invention, the η-bit data is directly halved, and the rules are summarized to design an expandable square operator. Therefore, the present invention can achieve a low hardware cost. In addition, the expandable square operator of the present invention can also be designed in a modular manner, which further reduces the area of the hardware, thereby reducing the hardware cost of the overall system. While the present invention has been described in its preferred embodiments, the present invention is not intended to limit the invention, and the present invention may be modified and modified without departing from the spirit and scope of the invention. The scope of protection is subject to the definition of the scope of the patent application. Sigh 13 1247 orphan doc/006 [Simple diagram of the diagram] Figure 1 is a flow chart showing the multiplication technique of Booth. Figure 2 is a partial product matrix of a general square operator. FIG. 3 is a diagram showing an 8-bit Booth folded partial product matrix. 4 is a diagram showing an operation matrix of a 4-bit data squaring operation in accordance with a preferred embodiment of the present invention. FIG. 5 illustrates an operational matrix of an 8-bit data squaring operation in accordance with a preferred embodiment of the present invention. 6 is a flow chart showing the steps of a square operation method in accordance with a preferred embodiment of the present invention. 7 is a block diagram showing the architecture of an n-bit scalable square operator in accordance with a preferred embodiment of the present invention. FIG. 8 is a block diagram showing the architecture of a 16-bit scalable square operator according to an embodiment of the invention. [Main component symbol description] 701, 801: bit extension circuit 703, 803: decoder 705, 805: addition unit 810: operation module S610, S620, S630, S640 · · square operation method step flow 14

Claims (1)

'.doc/006 I2472^Qwf· 十、申請專利範圍: L一種可擴充式平方運算器,用以處理 ^料的平方運算,而4不為㈣正整數 式平方運算器包括·· t、充 用以八電路’具有W個位元擴充輸出端, :=對應輸出多數個位元擴充資料,其中第!個 位兀擴充資料的内容為 八 n-1 和bj+1分別為該n位元資料第 〕和⑴位元的位元碼,而….和,則為正/數η·1以 及 分別:計算單元,係依照二進位之權重(Weight) 碼,目收用以組成該n位元資料之多數個位元 :* 了接收最高位元之位元碼的計算單元之外, 擴計算單元之輸入,係分別對應轉接該些位元 輸出端,用以分別對應接收該些位元擴充資料, 母„亥些5十异單几係將對應之位元擴 再乘以2的平方,並加上對應… 巧的+方值以得到一運算子。 瞀./·如申請專利範圍第1項所述之可擴充式平方運 Ϊ二更包括一加法運算單元,用以接收該些計算單 管雨出,並分別將該些計算單元之輸出進行下列運 n~2 +02㈣ Σ\22, 15 其中,&為接收第丨個位元碼之計算單元所產生的運算子,而 則為接收最高位元之位元碼的計算單元所產生之運算 子,其專於最高位元之位元碼的平方值。 管如申請專利範圍第1項所述之可擴充式平方運 7〇〇更包括一解碼器,用以依據二進位權重而產生 該些位元碼。 μ 4.如巾請專利範圍第!項所述之可擴充式平方運 异為,其中該η位元資料之最高位元碼係代表符號位 兀,用以決定該!!位元資料是否為正值。 平太Γ種平方運算方法,用以計算1位元資料的 :方值,而該η位元資料係由η個位元碼所組成,i 中η為正整數,該平方運算方法包括下列步驟:- 資料=二個位元擴充資料’其中第1個位元擴充 众=1 二 Ο "—3 λ—2 其中,bw'bj釭匕+1分別為該 』…元的位元碼,而…和,則; 胸二:取而位元之位元碼外’每一該些位元碼係分 m應乘㈣些位元擴充資料其巾之— 個計算值; 7生土夕数 _將每一計算值乘以2的平方後,再加上對應之位 兀碼的平方值而獲得多數個運算子;以及 將該些運算子進行下列運曾 料之平方纟 卩卜’异而仔職η位元資 16 doc/006 1247240.. 中,&為第i個位元碼所對應之運算子,而Cm則為最 高位元之位元碼所對應之運算子,其等於最高位元之位元碼的 平方值。 6.如申請專利範圍第5項所述之平方運算方法, 其中該η位元資料之最高位元碼係代表符號位元,用 以決定該η位元資料是否為正值。 7.如申請專利範圍第5項所述之平方運算方法, 其中當該η位元資料為負值時,則將所有該些位元擴 充資料反相後再進行運算。'.doc/006 I2472^Qwf· X. Patent application scope: L. An expandable square operator for processing the square operation of the material, and 4 is not (four) positive integer square operator including ·· t, charging With eight circuits 'with W bits to expand the output, := corresponds to output a large number of bits to expand the data, which is the first! The content of the unit 兀 expansion data is that the eight n-1 and bj+1 are the bit code of the n-th data and the (1)-bit, respectively, and the .... and, the positive/number η·1 and the respectively: The calculation unit is configured to receive a plurality of bits of the n-bit data according to a weight code of the binary: * In addition to the calculation unit that receives the bit code of the highest bit, the calculation unit The input is respectively corresponding to the output terminals of the bits for respectively receiving the bit expansion data, and the mothers are divided into a plurality of squares, and the corresponding bits are expanded and multiplied by a square of 2, and In addition, the corresponding + square value is used to obtain an operator. 瞀./· The expandable square operation described in item 1 of the patent application scope further includes an adding unit for receiving the calculation sheets. The pipe is rained out, and the outputs of the calculation units are respectively subjected to the following operations: n~2 +02(4) Σ\22, 15 where & is the operator generated by the calculation unit receiving the second bit code, and An operator generated by a computing unit that receives the highest-order bit code, which is specific to the highest bit The squared value of the meta-code. The expandable squared transport described in item 1 of the patent application scope further includes a decoder for generating the bit codes according to the binary weights. The expandable squared difference described in the scope of the patent is as follows, wherein the highest bit code of the n-bit data represents the symbol bit, which is used to determine whether the !! bit material is positive. The square operation method is used to calculate the square value of the 1-bit data, and the η-bit data is composed of η bit codes, where η is a positive integer, and the square operation method includes the following steps: = two bits of expansion data 'where the first bit expands the population = 1 Ο Ο " — 3 λ — 2 where bw'bj釭匕 +1 is the bit code of the 』... element, and... and , then; chest 2: take the bit of the bit outside the code 'each of these bit code points m should be multiplied (four) some bits to expand the data of the towel - a calculated value; 7 raw soil eve _ will each Multiplying a calculated value by the square of 2, plus the square of the corresponding bit weight to obtain a majority of the operators; The operator performs the following operations. The square of the previous data is different from the η bit element 16 doc/006 1247240.. The operator corresponding to the bit code of the bit, which is equal to the square value of the bit code of the highest bit. 6. The square operation method as described in claim 5, wherein the highest bit of the n-bit data The metacode system represents a symbol bit for determining whether the n-bit data is a positive value. 7. The square operation method according to claim 5, wherein when the n-bit data is negative, then Invert all of the bit expansion data before performing the operation. 1717
TW93120608A 2004-07-09 2004-07-09 Extendable squarer and square operation method TWI247240B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW93120608A TWI247240B (en) 2004-07-09 2004-07-09 Extendable squarer and square operation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW93120608A TWI247240B (en) 2004-07-09 2004-07-09 Extendable squarer and square operation method

Publications (2)

Publication Number Publication Date
TWI247240B true TWI247240B (en) 2006-01-11
TW200602967A TW200602967A (en) 2006-01-16

Family

ID=37399815

Family Applications (1)

Application Number Title Priority Date Filing Date
TW93120608A TWI247240B (en) 2004-07-09 2004-07-09 Extendable squarer and square operation method

Country Status (1)

Country Link
TW (1) TWI247240B (en)

Also Published As

Publication number Publication date
TW200602967A (en) 2006-01-16

Similar Documents

Publication Publication Date Title
JP7029321B2 (en) Information processing methods, information processing equipment and programs
JP5611923B2 (en) Power efficient code extension for booth multiplication method and system
CN114341892A (en) Machine learning hardware with reduced precision parameter components for efficient parameter updating
JPH07248841A (en) Nonlinear function generator and format converter
CN110265002B (en) Speech recognition method, speech recognition device, computer equipment and computer readable storage medium
JP2007234004A (en) Device and method for booth multiplication
CN111126557B (en) Neural network quantization, application method, device and computing equipment
CN113222813A (en) Image super-resolution reconstruction method and device, electronic equipment and storage medium
TW201921264A (en) Providing efficient floating-point operations using matrix processors in processor-based systems
TWI247240B (en) Extendable squarer and square operation method
US5289398A (en) Small-sized low power consumption multiplication processing device with a rounding recording circuit for performing high speed iterative multiplication
JP2012104138A (en) Booth multiplier with enhanced reduction tree circuitry
CN115686436A (en) Method and device for calculating fixed point division
Anuhya et al. ASIC implementation of efficient floating point multiplier
CN113570053A (en) Neural network model training method and device and computing equipment
JP2009534729A (en) N-bit adder and corresponding addition method
JP3922380B2 (en) Extensible squarer and square calculation method
Dhakar et al. A novel parallel architecture of lifting based 2D-discrete wavelet transform
JP2910124B2 (en) DCT processing equipment
JP4643951B2 (en) CONVERTING DEVICE AND CONVERTING METHOD FOR CONVERTING RESIDUAL CONVERSION NUMBER TO BINARY NUMBER
CN116820391A (en) Multiplier operation method, multiplier operation device, electronic equipment and storage medium
JP3610564B2 (en) Information processing device
Vassalos et al. Efficient architectures for modulo 2 n− 2 arithmetic units
JP2870018B2 (en) Product-sum operation circuit
Chen et al. New Booth Modulo m Multipliers with Signed-Digit Number Arithmetic