JPH0644228B2 - Squaring device - Google Patents
Squaring deviceInfo
- Publication number
- JPH0644228B2 JPH0644228B2 JP1011351A JP1135189A JPH0644228B2 JP H0644228 B2 JPH0644228 B2 JP H0644228B2 JP 1011351 A JP1011351 A JP 1011351A JP 1135189 A JP1135189 A JP 1135189A JP H0644228 B2 JPH0644228 B2 JP H0644228B2
- Authority
- JP
- Japan
- Prior art keywords
- pointer
- value
- controller
- shifter
- pointers
- 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.)
- Expired - Lifetime
Links
Landscapes
- Complex Calculations (AREA)
Description
【発明の詳細な説明】 (産業上の利用分野) 本発明はレジスタが複数個にまたがるような大規模整数
を扱う2乗演算装置に関する。Description: TECHNICAL FIELD The present invention relates to a squaring unit for handling a large-scale integer having a plurality of registers.
(従来の技術) 従来、2乗演算ではあっても、特に区別はせず、同じ数
同志を乗算することで処理していた。(Prior Art) Conventionally, although it is a square operation, no particular distinction is made and processing is performed by multiplying the same numbers.
(発明が解決しようとする問題点) 大規模整数の2乗演算を高速に実行させたい場合、同じ
数の乗算と見なすのは、無駄な処理が多く、高速化の妨
げになる。(Problems to be Solved by the Invention) When a large-scale integer square operation is to be executed at high speed, it is wasteful to treat the same number of multiplications, which is an obstacle to speeding up.
(問題を解決するための手段) 上記問題点は、以下のようにして解決できる。すなわ
ち、m個のレジスタで表現されている正整数Xの2乗を
演算する装置であって、少なくとも2つのポインタと、
前記2つのポインタの指し示すレジスタの値を乗算する
乗算器と、前記乗算器の出力をコントローラの制御によ
ってシフトを行なうシフト器と、シフト器の出力を格納
する記憶装置を有し、第一のポインタはコントローラの
制御によって1からmまで働き、第二のポインタはコン
トローラの制御によって第一のポインタの値からmまで
働き、コントローラは第一のポインタと第二のポインタ
の値が等しい時、シフト器により1ビットシフトさせ、
シフト器の出力を第一のポインタと第二のポインタBの
和に定数を足したアドレスのメモリに足し込むことを特
徴とした2乗演算装置である。(Means for Solving Problems) The above problems can be solved as follows. That is, a device for calculating the square of a positive integer X represented by m registers, which has at least two pointers,
A first pointer having a multiplier that multiplies the values of the registers indicated by the two pointers, a shifter that shifts the output of the multiplier under the control of the controller, and a storage device that stores the output of the shifter. Operates from 1 to m under the control of the controller, the second pointer operates from the value of the first pointer to m under the control of the controller, and the controller shifts when the values of the first pointer and the second pointer are equal. Shift 1 bit by
This is a square operation device characterized in that the output of the shifter is added to the memory of an address obtained by adding a constant to the sum of the first pointer and the second pointer B.
(作用) Xがレジスタ長mで表現されているとする。すなわち、
qをレジスタの単位とおけば、 であるとする。ここで、Xiは、ポインタがiのときに
指し示すX領域の値てある。このとき、X2は、 であるから、前述のポインタAをカウンタi、ポインタ
Bをカウンタjと見なせば、ポインタAが1からmまで
動くとき、ポインタBはポインタAからmまで動き、ポ
インタBとポインタAが等しいときは両ポインタの示す
X領域の値Xi、Xj(ここではXi=Xj)を掛け合
わせ、等しくないときは両ポインタの示すX領域の値を
掛け合わせた後に2倍、すなわち1ビット左にシストし
て足し合わす。(Operation) It is assumed that X is represented by the register length m. That is,
If q is a unit of register, Suppose Here, X i is the value of the X area pointed to when the pointer is i. At this time, X 2 is Therefore, assuming that the pointer A is the counter i and the pointer B is the counter j, when the pointer A moves from 1 to m, the pointer B moves from the pointer A to m, and when the pointer B and the pointer A are equal to each other. Are multiplied by the X area values X i and X j (here, X i = X j ) indicated by both pointers, and when they are not equal, they are doubled after multiplying the X area values indicated by both pointers, that is, 1 bit. Sist to the left and add together.
(実施例) 本発明をディジタルシグナルプロセッサ(以下DSPと
略す)上で実施した例を述べる。mレジスタで表現され
ている大規模整数が上位レジスタから順にアドレス1か
らmまでに格納されているとする。その2乗がアドレス
nからn+2m−2に格納される場合を考える。ここ
で、被乗数と積のアドレスが重ならないように、n>m
とする。以下の手順は第1図に示してある。まず、アド
レスnからn+2m−1までの結果領域をクリアする。
ポインタBをmにセットする。ポインタAをBと等しく
する。次に、結果領域のためのポインタをCと名付け、
Cに2m+n−2(=A+B+n−2)を代入する。ポ
インタA及びポインタBで指される値を@A、@Bと記
し、@Aと@Bの積を求める。この時、ポインタA=ポ
インタBであるので、この乗算結果にはシフトをせず、
また結果領域もクリアされているのでそのまま格納す
る。格納するとき、下位ワードをアドレスCのレジスタ
に格納し、上位ワードは一次待避レジスタに置いてお
く。つぎにポインタA並びにポインタCをひとつ減ら
し、同様に@Aと@Bを掛け合わせる。この時、ポイン
タAとポインタBの値は等しくないので、この積を2
倍、すなわち1ビット左にシフトする。そののち、前乗
算からの繰越ワードを足し合わせる。得られた和の下位
ワードをアドレスCに格納し、上位ワードは次の積に繰
り越すため待避レジスタに入れて置く。以上の処理を繰
り返し、ポインタAが0になったら、待避レジスタにあ
る値をポインタCの示す第2メモリ領域のアドレスに格
納し、ポインタBの値を1つ減らす。以下同様な手順を
続けるが、2回目からは前回結果領域に格納してある値
をも加算することになる。上記の処理をポインタBが0
になるまで繰り返す。(Example) An example in which the present invention is carried out on a digital signal processor (hereinafter abbreviated as DSP) will be described. It is assumed that a large-scale integer represented by the m register is stored in the addresses 1 to m in order from the upper register. Consider the case where the square is stored from address n to n + 2m-2. Here, n> m so that the addresses of the multiplicand and the product do not overlap.
And The following procedure is shown in FIG. First, the result area from address n to n + 2m-1 is cleared.
Set pointer B to m. Make pointer A equal to B. Then name the pointer for the result area C
2m + n-2 (= A + B + n-2) is substituted for C. The values pointed by the pointer A and the pointer B are described as @A and @B, and the product of @A and @B is obtained. At this time, since pointer A = pointer B, this multiplication result is not shifted,
Since the result area is also cleared, it is stored as it is. When storing, the lower word is stored in the register of address C and the upper word is stored in the primary save register. Next, the pointers A and C are reduced by one, and @A and @B are similarly multiplied. At this time, since the values of pointer A and pointer B are not equal, this product is
Double, that is, shift left one bit. After that, carry forward words from the previous multiplication are added. The lower word of the obtained sum is stored in address C, and the upper word is placed in the save register for carrying over to the next product. When the pointer A becomes 0 by repeating the above processing, the value in the save register is stored in the address of the second memory area indicated by the pointer C, and the value of the pointer B is decreased by one. The same procedure is continued thereafter, but from the second time onward, the value stored in the result area last time is also added. Pointer B is 0
Repeat until.
(発明の効果) 以上詳細に説明した通り、本発明装置を用いれば、効率
よく高速に2乗演算が実行できる。(Effects of the Invention) As described in detail above, the use of the device of the present invention enables efficient and high-speed square calculation.
第1図は本発明の一実施例を示す図である。第2図は本
発明の一実施例を示すブロック図である。FIG. 1 is a diagram showing an embodiment of the present invention. FIG. 2 is a block diagram showing an embodiment of the present invention.
Claims (1)
の2乗を演算する装置であって、少なくとも2つのポイ
ンタと、前記2つのポインタの指し示すレジスタの値を
乗算する乗算器と、前記乗算器の出力をコントローラの
制御によってシフトを行なうシフト器と、シフト器の出
力を格納する記憶装置を有し、第一のポインタはコント
ローラの制御によって1からmまで働き、第二のポイン
タはコントローラの制御によって第一のポインタの値か
らmまで働き、コントローラは第一のポインタと第二の
ポインタの値が等しい時、シフト器により1ビットシフ
トさせ、シフト器の出力を第一のポインタと第二のポイ
ンタの和に定数を足したアドレスのメモリに足し込むこ
とを特徴とした2乗演算装置。1. A positive integer X represented by m registers.
A device for calculating the square of, a multiplier for multiplying at least two pointers, the value of the register pointed to by the two pointers, and a shifter for shifting the output of the multiplier under the control of the controller. A first pointer works from 1 to m under the control of the controller, a second pointer works from the value of the first pointer to m under the control of the controller, When the value of the first pointer and the value of the second pointer are equal, the shifter shifts by 1 bit, and the output of the shifter is added to the memory of the address obtained by adding a constant to the sum of the first pointer and the second pointer. A squaring device characterized by the above.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1011351A JPH0644228B2 (en) | 1989-01-20 | 1989-01-20 | Squaring device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1011351A JPH0644228B2 (en) | 1989-01-20 | 1989-01-20 | Squaring device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH02191030A JPH02191030A (en) | 1990-07-26 |
| JPH0644228B2 true JPH0644228B2 (en) | 1994-06-08 |
Family
ID=11775617
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1011351A Expired - Lifetime JPH0644228B2 (en) | 1989-01-20 | 1989-01-20 | Squaring device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0644228B2 (en) |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2550597B2 (en) * | 1987-08-27 | 1996-11-06 | ソニー株式会社 | Squarer |
-
1989
- 1989-01-20 JP JP1011351A patent/JPH0644228B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH02191030A (en) | 1990-07-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4754421A (en) | Multiple precision multiplication device | |
| US5226171A (en) | Parallel vector processing system for individual and broadcast distribution of operands and control information | |
| US5081573A (en) | Parallel processing system | |
| US4602350A (en) | Data reordering memory for use in prime factor transform | |
| US4604721A (en) | Computer and method for high speed prime factor transform | |
| JPH0368416B2 (en) | ||
| JPH08329261A (en) | Parameter curve generator | |
| JPH0731592B2 (en) | Division circuit | |
| JP3271120B2 (en) | Device for fast multiplication of binary numbers | |
| US3973243A (en) | Digital image processor | |
| JPH0644228B2 (en) | Squaring device | |
| JPS63501828A (en) | multi-zone processor | |
| JPS58129653A (en) | Multiplication system | |
| JPH0585924B2 (en) | ||
| JPS5853217A (en) | Digital filter circuit | |
| US5715187A (en) | Method and apparatus for integer multiplication | |
| JPS6259828B2 (en) | ||
| JPS60138640A (en) | Writing system of register file | |
| SU962926A1 (en) | Device for taking logarithms | |
| JP2951685B2 (en) | Fixed-point arithmetic unit | |
| JP2595820B2 (en) | Galois extended field arithmetic unit | |
| JP2550597B2 (en) | Squarer | |
| JPS58151644A (en) | digital arithmetic device | |
| JP2674747B2 (en) | Signal processor | |
| SU918946A1 (en) | Digital logarithmic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080608 Year of fee payment: 14 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090608 Year of fee payment: 15 |
|
| EXPY | Cancellation because of completion of term | ||
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090608 Year of fee payment: 15 |