JPS61251962A - Matrix multiplier - Google Patents

Matrix multiplier

Info

Publication number
JPS61251962A
JPS61251962A JP60093124A JP9312485A JPS61251962A JP S61251962 A JPS61251962 A JP S61251962A JP 60093124 A JP60093124 A JP 60093124A JP 9312485 A JP9312485 A JP 9312485A JP S61251962 A JPS61251962 A JP S61251962A
Authority
JP
Japan
Prior art keywords
register
shift register
trigger pulse
multiplier
control means
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
JP60093124A
Other languages
Japanese (ja)
Other versions
JPH0335700B2 (en
Inventor
Nobuhiko Yamagami
山上 宣彦
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP60093124A priority Critical patent/JPS61251962A/en
Publication of JPS61251962A publication Critical patent/JPS61251962A/en
Publication of JPH0335700B2 publication Critical patent/JPH0335700B2/ja
Granted legal-status Critical Current

Links

Abstract

PURPOSE:To operate a sum of products at a high speed with the simple constitution in terms of a row vector made of two constant and two real numbers composed of the product of a mantissa part and power of two and a column vector made of two variables and one fixed value by latching them the mantissa part and an exponent part shift register, inputting sequentially (x) and (y) and executing the prescribed arithmetic processing. CONSTITUTION:In terms of the product sum of the row vector composed of two real numbers amX2<ae-m> and bmX2<be-m>, and the constant (e) and the column vector composed of two variables (x) and (y) and the constant '1', the am and the bm in registers 13 and 14 are loaded in multipliers 21, 22, and the ae and the be in registers 15 and 16 are loaded in control blocks 23, 24. (x), (y) and a sine bit S are transmitted to the multipliers 21 and 22 through shift registers 17 and 18 corresponding to the trigger pulses CLK2 and CLK23 of the blocks 23 and 24, and simultaneously the am and the bm are loaded. The outputs of the multipliers 21 and 22 are inputted to adders 31 and 34. An (e) in the shift register is inputted to the multiplier 31 in accordance with the CLK1 and its output is inputted to the multiplier 34, whose output is transmitted to a shift register 35, thereby obtaining a desired result (u).

Description

【発明の詳細な説明】 [発明の技術分野] この発明は、特に図形処理にあける座標変換に必要とな
る行ベクトルと列ベクトルとの積を求めるマトリクス乗
算器に関する。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field of the Invention] The present invention relates to a matrix multiplier that calculates the product of a row vector and a column vector, which is necessary for coordinate transformation particularly in graphic processing.

[発明の技術的背景とその問題点] 近年、コンピュータを用いた図形処理システムが広範に
利用されるようになってきている。このシステムは、一
般に図形定義システムと図形表示システムとから成る。
[Technical background of the invention and its problems] In recent years, graphic processing systems using computers have come into widespread use. This system generally consists of a graphics definition system and a graphics display system.

そして図形定義システムにより仮想空間(xy−空間)
で定義された図形が、図形表示システムによりいくつか
の変換を受け、実空間(UV−空間〉に写像される。こ
の実空間とは、グラフィックディスプレイ装置のCRT
管面や静電プロッタの紙面などに対応する。
Then, virtual space (xy-space) is created using the figure definition system.
The figure defined in is subjected to several transformations by the figure display system and is mapped to real space (UV-space). This real space is the CRT of the graphic display device.
Compatible with tube surfaces and electrostatic plotter paper surfaces.

さて、2次元座標空間における変換は、っぎの(1)式
が基本となっている。
Now, the conversion in the two-dimensional coordinate space is based on equation (1).

x、y:仮想空間での絶対値座標 u、v:実空間での絶対値座標 上記(1)式において、定数項であるa、b、c。x, y: Absolute value coordinates in virtual space u, v: absolute value coordinates in real space In the above formula (1), a, b, and c are constant terms.

dは浮動小数点数で表現される実数であり、X。d is a real number expressed as a floating point number, and X.

yは2の補数で表現される整数である。したがって、上
記(1)式の変換のためには、複雑な浮動小数点処理を
伴う積和計算が必要となる。このため上記(1)式の変
換は、従来よりホストコンピュータや周辺装置内のマイ
クロプロセッサで行なわれていた。しかし、上記の変換
をホストコンピュータやマイクロプロセッサで行なうこ
とは、多大の処理時間を要するために高速表示に対する
ボトルネックとなり問題があった。
y is an integer expressed in two's complement. Therefore, in order to convert the above equation (1), sum-of-product calculations involving complicated floating-point processing are required. For this reason, the conversion of equation (1) above has conventionally been performed by a microprocessor in a host computer or peripheral device. However, performing the above conversion using a host computer or microprocessor requires a large amount of processing time, which poses a problem as a bottleneck for high-speed display.

[発明の目的] この発明は上記事情に鑑みてなされたものでその目的は
、アフィン変M等に要求されるa−X+b−y+e (
a、bは定数項であり実数、x、 yは変数項であり整
数、eは定数項で必り固定小数点数)の積和演算が簡単
なハードウェア構成で高速に行なえるマトリクス乗算器
を提供することにある。
[Object of the invention] This invention was made in view of the above circumstances, and its purpose is to solve the problem of a-X+b-y+e (
A and b are constant terms and real numbers, x and y are variable terms and integers, and e is a constant term and must be a fixed-point number. It is about providing.

[発明の概要] この発明にJ:れば、 8mX2   。[Summary of the invention] If this invention is J: 8mX2.

bmX2be−mで表わされる定数項a、b (am。Constant terms a, b expressed as bmX2be-m (am.

bmは2の補数で表わされる多ビットの整数、ae、b
e、mはO≦ae、be≦mを満たす整数)および定数
項e(eは2の補数で表わされる整数部pビット、小数
部qビットの固定小数点数)の3つの要素から成る行ベ
クトルと変数項x、y(x、yは2の補数で表わされる
にビットの整数)および同定値1の3つの要素から成る
列ベクトルとの積であるa−x十b−y+eで示される
積和演算を行なうマトリクス乗算器が提供される。
bm is a multi-bit integer expressed in two's complement, ae, b
A row vector consisting of three elements: e, m are integers satisfying O≦ae, be≦m) and a constant term e (e is a fixed-point number with p bits in the integer part and q bits in the fraction part, expressed in two's complement). and the variable term x, y (x, y are two-bit integers expressed in two's complement) and a column vector consisting of three elements with an identification value of 1. A matrix multiplier is provided that performs a summation operation.

上記マトリクス乗算器は、amをラッチする8mレジス
タと、bmをラッチするbmレジスタと、動作開始によ
り基本クロック信号に応じてカウントを行ない、mとq
との差だけカウントすると同タロツク信号に同期した第
1制御トリガパルスを繰返し発生する第1制御手段と、
動作開始により基本クロック信号に応じてカウントを行
ない、aeだけカウントすると同クロック信号に同期し
た第2制御トリガパルスを繰返し発生する第2制御手段
と、動作開始により基本タロツク信号に応じてカウント
を行ない、beだけカウントすると同クロック信号に同
期した第3制御トリガパルスを繰返し発生する第3制御
手段とを有している。
The matrix multiplier has an 8m register that latches am, a bm register that latches bm, and counts m and q according to the basic clock signal at the start of operation.
a first control means that repeatedly generates a first control trigger pulse synchronized with the tarok signal when counting the difference between the two and
A second control means performs counting according to the basic clock signal at the start of operation, and repeatedly generates a second control trigger pulse synchronized with the same clock signal when only ae is counted; , be, the third control means repeatedly generates a third control trigger pulse synchronized with the same clock signal.

またマトリクス乗算器は、eをラッチし、その内容を第
1制御手段からの第1制御トリガパルスに応じて下位方
向にシフトする第1シフトレジスタと、Xをラッチして
その内容を第2制御手段からの第2制御トリガパルスに
応じて下位方向にシフトする第2シフトレジスタと、y
をラッチしてその内容を第3制御手段からの第3制御ト
リガパルスに応じて下位方向にシフトする第3シフトレ
ジスタと、lXffビットの第1および第2乗算器とを
有している。第2シフトレジスタからのシリアル出力ビ
ットと8mレジスタの内容とは第1乗算器に供給され、
第3シフトレジスタからのシリアル出力ビットとbmレ
ジスタの内容とは第2乗算器に供給される。第1乗算器
は、第2シフトレジスタからのシリアル出力ビットと8
mレジスタの内容との乗算を第2制御手段からの第2制
御トリガパルスに応じて実行し、第2乗算器は、第3シ
フl−レジスタからのシリアル出力ビットとbmレジス
タの内容との乗算を第3制御手段からの第3制御トリガ
パルスに応じて実行し、1回の乗算動作毎に乗算結果の
最下位ピッ1〜を出力する。即ち第1.第2乗算器は、
a−x、b−yの乗算結果を1ビット単位で出力する。
The matrix multiplier also includes a first shift register that latches e and shifts its contents downward in response to a first control trigger pulse from the first control means, and a first shift register that latches e and shifts its contents downward in response to a first control trigger pulse from the first control means; a second shift register that shifts downward in response to a second control trigger pulse from the means;
The third shift register has a third shift register that latches and shifts its contents downward in response to a third control trigger pulse from a third control means, and first and second multipliers of lXff bits. The serial output bits from the second shift register and the contents of the 8m register are fed to a first multiplier;
The serial output bits from the third shift register and the contents of the bm register are provided to a second multiplier. The first multiplier combines the serial output bits from the second shift register with 8
The second multiplier performs multiplication by the contents of the m register in response to a second control trigger pulse from the second control means, and the second multiplier multiplies the serial output bit from the third shift l-register by the contents of the bm register. is executed in response to a third control trigger pulse from the third control means, and the lowest digits 1 to 1 of the multiplication results are output for each multiplication operation. That is, the first. The second multiplier is
The multiplication result of a-x and by is output in 1-bit units.

上記マトリクス乗算器は、更に加算手段を有している。The matrix multiplier further includes addition means.

この加算手段には、第1および第2乗算器からの出力ビ
ットと第1シフトレジスタからのシリアル出力ビットと
が供給される。加算手段は、これら3種の入力ビツト間
の加算を繰返し行なう。
The adding means is supplied with the output bits from the first and second multipliers and the serial output bits from the first shift register. The adding means repeatedly adds these three types of input bits.

さて、第1シフトレジスタは第1制御手段からの第1制
御トリガパルスにより動作制御され、第2シフトレジス
タおよび第1乗算器は第2制御手段からの第2制御トリ
力パルスにより動作制御され、第3シフトレジスタおよ
び第2乗算器は第3制御手段からの第3制御トリガパル
スにより動作制御されている。したがつ□て、加算手段
に供給される第1.第2乗算器並びに第1シフトレジス
タからの各ビットデータは、正しく桁合せされており、
したがって加算手段からはa−x十b−y十eで示され
る積和演算お演算結果がその下位ビットより順に出力さ
れることになる。
Now, the operation of the first shift register is controlled by the first control trigger pulse from the first control means, the operation of the second shift register and the first multiplier is controlled by the second control trigger pulse from the second control means, The operation of the third shift register and the second multiplier is controlled by a third control trigger pulse from the third control means. Therefore, the first . Each bit data from the second multiplier and the first shift register is correctly aligned,
Therefore, the addition means outputs the product-sum operation results indicated by a-x+b-y+e in order from the lower bits.

[発明の実施例] 以下、この発明の一実施例を図面を参照して説明する。[Embodiments of the invention] An embodiment of the present invention will be described below with reference to the drawings.

第1図はこの発明の一実施例に係るマトリクス乗算器の
構成を示す。第1図のマトリクス乗算器は、前記(1)
式のu (=a −x+b −y+e)を算出するのに
用いられる。第1図において、11は外部(上位プロセ
ッサ)から与えられる変数項XをラッチするXレジスタ
、12は同じく外部から与えられる変数項yをラッチす
るXレジスタである。
FIG. 1 shows the configuration of a matrix multiplier according to an embodiment of the present invention. The matrix multiplier in FIG.
It is used to calculate u (=a −x+b −y+e) in the equation. In FIG. 1, 11 is an X register that latches a variable term X given from the outside (upper processor), and 12 is an X register that latches a variable term y also given from the outside.

x、yば2の補数で表わされるにビットの整数である。x and y are bit integers expressed as two's complement numbers.

この実施例ではに=24である。In this example, =24.

さて、前記(1)式における定数項a−dは実数(R)
である。実数(R)は、仮数部(P)と指数部(E−)
とにより次の(2)式で表わされる。
Now, the constant term a-d in the above equation (1) is a real number (R)
It is. A real number (R) has a mantissa part (P) and an exponent part (E-)
It is expressed by the following equation (2).

R=Px2E−(2) 指数部E−は 一8≦F−≦t(3) で示される値をとりうる。但しs、tは正の整数である
。上記(3)式は m=s±t、E=E−+S と置くと O≦E≦m(4) と書換えられる。また(2)式は Pm=PX2t と置くと R= Pmx 2 ”’        (5)と書換
えられる。上記(5)式の指数部E −mは(4)式か
ら明らかなようにOまたは負である。この実施例では、
上記(5)式の形式の実数(R)が適用される。即ち、
この実施例では、通常の浮動小数点数と異なり、その取
扱いデータ(実数)の全てについて指数部がO以下とな
るようにしており、これに伴い仮数部が予め21倍され
ている。
R=Px2E-(2) The exponent part E- can take a value expressed as -8≦F-≦t(3). However, s and t are positive integers. The above equation (3) can be rewritten as O≦E≦m (4) by setting m=s±t and E=E−+S. In addition, equation (2) can be rewritten as R= Pmx 2 ''' (5) by setting Pm=PX2t.As is clear from equation (4), the exponent part E - m of equation (5) above is O or negative. In this example,
A real number (R) in the form of equation (5) above is applied. That is,
In this embodiment, unlike a normal floating point number, the exponent part of all the handling data (real numbers) is set to be less than or equal to O, and accordingly, the mantissa part is multiplied by 21 in advance.

以上のことから、定数項a、b、c、dはa=amx2
ae−m b=bmx2”’−” C=CmX2°e−m d=dm×2d0−IIl と表わされる 但し、■am−dmは2の補数で表わされるlビットの
整数、■ae〜ad、mは O≦ae、be、ce、de≦m の条件を満たす整数である。
From the above, the constant terms a, b, c, d are a=amx2
ae-m b=bmx2"'-" C=CmX2°e-m d=dm×2d0-IIl Where, ■am-dm is an l-bit integer expressed in two's complement, ■ae~ad, m is an integer that satisfies the following conditions: O≦ae, be, ce, de≦m.

また(1)式における定数項e、fは2の補数で表わさ
れ、整数部pビット、小数部qピットの固定小数点数で
ある。
Further, the constant terms e and f in equation (1) are expressed as two's complement numbers, and are fixed point numbers with p bits in the integer part and q pits in the decimal part.

これらを用いると、前記(1)式のU、Vは(6)式。When these are used, U and V in the above formula (1) become the formula (6).

(7)式のようになる。It becomes as shown in equation (7).

′u=am  −x  −2ae−m e−m +bm−y・2   +e    (6)v=  cm
  −x  −2Ce−me−m 十dm−y・2   +f    (7)上記(6)式
を模式的に示すと第2図のようになる。
'u=am -x -2ae-m e-m +bm-y・2 +e (6)v=cm
-x -2Ce-me-m 10dm-y.2 +f (7) The above equation (6) is schematically shown in FIG. 2.

上述した説明並びに第2図から明らかなように、mは、
各取扱いデータの小数点位置に対する基準点(位置)を
示し、ae、beは基準点からam(am−x)、bm
 (bm−y>の最下位ビットまでのビット数を示す。
As is clear from the above explanation and FIG. 2, m is
The reference point (position) for each handling data decimal point position is shown, and ae and be are am (am-x) and bm from the reference point.
(Indicates the number of bits up to the least significant bit of bm-y>.

また基準点からeの最下位ビットまでのビット数は、(
m−q)ビットである。したがって、am(am−x)
、bm(bm−y)の扱いについてはae、beをカウ
ントし、eの扱いについてはm−qをカウントして処理
開始のタイミングを決定することにより、正しく桁合せ
することが可能となる。
The number of bits from the reference point to the least significant bit of e is (
m−q) bits. Therefore, am(am-x)
, bm (bm-y) by counting ae and be, and e by counting m-q to determine the processing start timing, thereby making it possible to correctly align the digits.

再び第1図を参照すると、13は定数項amをラッチす
るamレジスタ、14は同じ<bmをラッチするbmレ
ジスタ、15は同じくaeをラッチするaemレジスタ
16は同じ<beをラッチするbeレジスタである。a
m、bmは前記したように2の補数で表わされる2ビツ
トの整数である。この実施例では2=24である。am
、bm、ae。
Referring again to FIG. 1, 13 is an am register that latches the constant term am, 14 is a bm register that latches the same <bm, and 15 is an aem register that also latches ae. 16 is a be register that latches the same <be. be. a
As described above, m and bm are 2-bit integers expressed as two's complement numbers. In this example, 2=24. am
, bm, ae.

beは外部(上位プロセッサ)から予め与えられるよう
になっている。17はXレジスタ11にラッチされた変
数項X(X座標値)をロードし、その内容を制御トリガ
パルスCLK2に応じて下位方向にシフトするXシフト
レジスタ、18はXレジスタ12にラッチされた変数項
y(y座標値)をロードし、その内容を制御トリガパル
スCLK3に応じて下位方向にシフトするyシフトレジ
スタである。
be is given in advance from the outside (upper processor). 17 is an X shift register that loads the variable term X (X coordinate value) latched into the X register 11 and shifts its contents downward in response to the control trigger pulse CLK2; 18 is a variable latched into the X register 12; This is a y shift register that loads the term y (y coordinate value) and shifts its contents downward in response to the control trigger pulse CLK3.

また19.20はレジスタ11.12からのx、yのサ
インビットSをラッチし、シフトレジスタ18.19の
最上位ビットMSBの位置に供給するフリップフロップ
である。
Further, reference numeral 19.20 is a flip-flop that latches the sign bit S of x and y from register 11.12 and supplies it to the most significant bit MSB position of shift register 18.19.

21はamレジスタ13からその保持内容amをロード
し、Xシフトレジスタ17からのシリアル出力ビットX
=jとの間で制御トリガパルスCLK2に応じて乗算を
行なう1×2ビツト(E=24>の乗算器、22はbm
レジスタ14からその保持内容bmをロードし、Xシフ
トレジスタ18からのシリアル出力ビットY−にとの間
で制御トリガパルスCLK3に応じて乗算を行なう1)
lビット(2=24)の乗算器である。乗算器21.2
2は、1回の乗算動作毎にその結果の最下位ビットLS
Bを出力するようになっている。乗算器21.22は、
例えば米国AMD社の25LS14 (1×8ビツト乗
算器)をそれぞれ3m用いて構成されている。
21 loads the held content am from the am register 13 and outputs the serial output bit X from the X shift register 17.
1×2 bits (multiplier with E=24>, 22 is bm
Load the held content bm from the register 14 and perform multiplication between the serial output bit Y- from the X shift register 18 according to the control trigger pulse CLK31)
It is an l-bit (2=24) multiplier. Multiplier 21.2
2 is the least significant bit LS of the result for each multiplication operation.
It is designed to output B. The multipliers 21 and 22 are
For example, it is constructed using 25LS14 (1×8 bit multiplier) of 3 m each made by AMD, USA.

23、24は図示せぬカウンタを内蔵し、制御トリガパ
ルスCLK2.CLK3を発生する制御プロツク(DE
LAY>である。制御ブロック23.24はレジスタ1
5.16からae、beをロードし、その値を基本クロ
ック信号CLKによりカウントダウンして“OIIとな
った後、同タロツク信号CLKに同期した制御トリガパ
ルスCLK2.CL−に3をk+l回(k=24.J2
=24)発生するようになっている。制御ブロック23
からの制御トリガパルスCLK2はXシフトレジスタ1
7および乗算器21に供給され、制御ブロック24から
の制御トリガパルスCLK3はXシフトレジスタ18お
よび乗算器22に供給される。また25は制御トリガパ
ルスCLK1を発生する制御ブロック(DELAY>で
ある。制御ブロック25は、所定値m−qを内部に保持
しており、動作開始によりm−qを内部のカウンタ(図
示せず)にロードし、その値を基本クロック信号CLK
によりカウントダウンして“O゛′となった後、同タロ
ツク信号CLKに同期した制御トリガパルスCLK1を
p+q回発生するようになっている。mは前記したよう
に、基準点から小数点までのビット数を示しており、例
えば51である。またp、qは、外部から定数項として
与えられるeのそれぞれ整数部、小数部のビット数であ
る。この実施例ではp=40.q=8である。
23 and 24 have built-in counters (not shown), and control trigger pulses CLK2. Control block (DE
LAY>. Control blocks 23 and 24 register 1
After loading ae and be from 5.16 and counting down their values using the basic clock signal CLK to reach "OII," add 3 to the control trigger pulse CLK2.CL- synchronized with the same tarlock signal CLK k+l times (k =24.J2
=24) is set to occur. control block 23
The control trigger pulse CLK2 from X shift register 1
A control trigger pulse CLK3 from a control block 24 is supplied to an X shift register 18 and a multiplier 22. Further, 25 is a control block (DELAY>) that generates the control trigger pulse CLK1.The control block 25 internally holds a predetermined value m-q, and when the operation starts, m-q is stored in an internal counter (not shown). ) and load its value into the basic clock signal CLK.
After counting down and reaching "O", the control trigger pulse CLK1 synchronized with the same tally clock signal CLK is generated p+q times. As mentioned above, m is the number of bits from the reference point to the decimal point. For example, it is 51. Also, p and q are the number of bits of the integer part and fractional part, respectively, of e given as a constant term from the outside. In this example, p = 40.q = 8. .

26は外部から予め定数項として与えられるeをラッチ
し、その内容を制御トリガパルスCLK1に応じて下位
方向にシフトするeシフトレジスタである。eシフトレ
ジスタ26のシリアル出力ビットEiは同レジスタ26
のMSB、およびタイミング補正用のフリップフロップ
(L)27に供給される。
Reference numeral 26 denotes an e shift register which latches e given as a constant term from the outside and shifts its contents downward in response to the control trigger pulse CLK1. The serial output bit Ei of the e shift register 26 is
MSB of , and a flip-flop (L) 27 for timing correction.

31は乗算器21のシリアル出力ビットAX”jおよび
フリップフロップ27の出力ビットE−1の加算を行な
う1ビツト加算器(ADD>、32は加算のフリップフ
ロップ(L)である。また33は乗算器22のシリアル
出力ビットBY−kを保持するタイミング補正用のフリ
ップ70ツブ(L)、34はフリップフロップ32.3
3の各出力ビットを加算する1ビツト加算器(ADD>
、35は演算結果Uをラッチするp+qビット(p+q
=48)のUシフトレジスタでおる。Uシフトレジスタ
35には加算器34の加算結果R7,がそのMSBより
シリアル入力される。
31 is a 1-bit adder (ADD>) that adds the serial output bit AX"j of the multiplier 21 and the output bit E-1 of the flip-flop 27; 32 is an addition flip-flop (L); and 33 is a multiplication 34 is a flip-flop 32.3 for timing correction that holds the serial output bit BY-k of the device 22.
A 1-bit adder (ADD>
, 35 are p+q bits (p+q
=48) U shift register. The addition result R7 of the adder 34 is serially input to the U shift register 35 starting from its MSB.

次にこの発明の一実施例の動作を第3図のタイミングチ
ャートを参照して説明する。なお、第3図において、T
i  <i=1.2.・・・98)はクロックサイクル
を、RDYは第1図のマトリクス乗算器の状態を示すス
テータス信号を、そしてDl。
Next, the operation of one embodiment of the present invention will be explained with reference to the timing chart of FIG. In addition, in Fig. 3, T
i<i=1.2. . . 98) represents a clock cycle, RDY represents a status signal indicating the state of the matrix multiplier shown in FIG. 1, and Dl represents a clock cycle.

D2.D3は、制御ブロック23.24.25にロード
された値(ae、be、m−q)の変化を示す。
D2. D3 shows the change in the values (ae, be, m-q) loaded into control block 23.24.25.

第1図のマトリクス乗算器では、各X、yの組に対する
Uの算出に先だって、外部(上位プロセッサ)からam
、ae、bm、be、eが順次与えられる。そしてam
はamレジスタ13に、aeはaeレジスタ15にそれ
ぞれセットされる。またbmはbmレジスタ14に、b
eはbemレジスタ16、そしてeはeシフトレジスタ
26に、それぞれセットされる。この後は、X、yの組
だけが外部から順次与えられ、座標変換が連続的に行な
われる。
In the matrix multiplier shown in FIG. 1, before calculating U for each pair of X and y, am
, ae, bm, be, and e are given sequentially. and am
is set in the am register 13, and ae is set in the ae register 15. Also, bm is stored in the bm register 14, b
e is set in the bem register 16 and e is set in the e shift register 26, respectively. After this, only the X, y pair is sequentially given from the outside, and coordinate transformation is performed continuously.

さて第1図のマトリクス乗算器の動作は、新たなx、y
がレジスタ11.12にセットされて図示せぬステータ
ス回路のステータス信号RDYが1−1i(lhレベル
となることにより始まる(T1)。
Now, the operation of the matrix multiplier in Figure 1 is as follows:
is set in the registers 11 and 12, and the status signal RDY of a status circuit (not shown) becomes 1-1i (lh level), and the process starts (T1).

最初に、amレジスタ13内のamが乗算器21に、b
mレジスタ14内のbmが乗算器22に、aemレジス
タ15内aeが制御ブロック23(の図示せぬカウンタ
)に、beレジスタ16内のbeが制御ブロック24(
の図示せぬカウンタ)に、Xレジスタ11内のXがXシ
フトレジスタ17に、そしてXレジスタ12内のyがX
シフトレジスタ18に、それぞれロードされる(T2)
。また、このT2においては、Xレジスタ11内のXの
サインビットSがフリップフロップ19に、Xレジスタ
12内のyのサインビットSがフリップフロップ20に
、それぞれロードされる。更に丁2においては、制御ブ
ロック25内に保持されているm−qがブロック25内
の図示せぬカウンタにロードされる。しかして制御ブロ
ック23、24.25は、ロードされた値が“O″にな
るよで基本クロック信号CLKによりカウントダウンを
行なう。この実施例では、ae=Q、be=4L m−
q=51−8=43である。したがって、制卸ブロック
24ではT3〜丁66の間、制御ブロック25ではT3
〜T46の間カウントダウンが行なわれる。なお、制御
ブロック23においてはae=0であるため、カウント
ダウンは行なわれない。
First, am in the am register 13 is sent to the multiplier 21, and b
bm in the m register 14 is sent to the multiplier 22, ae in the aem register 15 is sent to the control block 23 (not shown), and be in the be register 16 is sent to the control block 24 (not shown).
), X in the X register 11 is transferred to the X shift register 17, and y in the X register 12 is transferred to
Each is loaded into the shift register 18 (T2)
. Also, at T2, the sign bit S of X in the X register 11 is loaded into the flip-flop 19, and the sign bit S of y in the X register 12 is loaded into the flip-flop 20, respectively. Further, in step 2, m-q held in the control block 25 is loaded into a counter (not shown) in the block 25. The control blocks 23, 24, and 25 then count down based on the basic clock signal CLK since the loaded value becomes "O". In this example, ae=Q, be=4L m-
q=51-8=43. Therefore, in the control block 24, between T3 and 66, and in the control block 25, T3
A countdown is performed during the period from -T46. Note that since ae=0 in the control block 23, no countdown is performed.

この操作は、第2図で小数点の桁合せを行なう処理に相
当する。
This operation corresponds to the process of aligning the decimal points in FIG.

制御ブロック23.24.25は、カウントダウン動作
により上記ロードした値が“′O″となると、その時よ
り制御トリガパルスCLK1.CLK2゜CLK3を発
生する。具体的には、制御ブロック23、24.25は
、基本クロック信号CLKのパルス列をそのまま制御ト
リガパルスCLK1.CLK2、CLK3として出力す
る。なお、制御ブロック23は、ae=Qであるため、
T3より制御トリガパルスCLK2を発生することにな
る。
Control blocks 23, 24, and 25 control trigger pulses CLK1 . Generate CLK2°CLK3. Specifically, the control blocks 23, 24, 25 directly convert the pulse train of the basic clock signal CLK into control trigger pulses CLK1. Output as CLK2 and CLK3. Note that since the control block 23 has ae=Q,
Control trigger pulse CLK2 is generated from T3.

制御ブロック23からの制御トリガパルスCLK2はX
シフトレジスタ17および乗算器21に供給される。こ
れによりXシフトレジスタ17は下位方向へのシフト動
作(右シフト動作)を開始する。Xシフトレジスタ17
のLSBからのシリアル出力ビットX−jは乗算器21
に供給される。乗算器21は、制御ブロック23からの
制御トリガパルスCLK2に応じてamレジスタ13の
内容amをロードし、同amとXシフトレジスタ17か
らのX−jとの乗算を制御トリ力パルスCLK2に応じ
て行なう。
The control trigger pulse CLK2 from the control block 23 is
The signal is supplied to a shift register 17 and a multiplier 21. As a result, the X shift register 17 starts a downward shift operation (right shift operation). X shift register 17
The serial output bits X-j from the LSB of
supplied to The multiplier 21 loads the content am of the am register 13 in response to the control trigger pulse CLK2 from the control block 23, and multiplies the content am by X-j from the X shift register 17 in response to the control trigger pulse CLK2. Let's do it.

そして乗算器21は、その積のLSB (AX−j )
を出力する。このAX−jは、周知のように、前回出力
したAX′j−1の上位に位置するビット列と、今回の
1×2ビット乗算結果を示すビット列との加算結果のL
SBである。即ち乗算器21においては、上記の加算結
果が得られると1ビツト右シフトされ、そのシリアル出
力ビットがAX−jとして用いられ、残りビットが次の
1×2ビット乗算結果との加算用に内部保持される。な
お、Xシフトレジスタ17においては、制御トリガパル
スCLK2によりその保持内容が1ビツト右シフトされ
ると、そのMSBにはフリップフロップ19の保持ビッ
ト即ちサインビットSが入力される。
Then, the multiplier 21 calculates the LSB (AX-j) of the product.
Output. As is well known, this AX-j is the L of the addition result of the upper bit string of AX'j-1 output last time and the bit string indicating the current 1×2 bit multiplication result.
It is SB. That is, in the multiplier 21, when the above addition result is obtained, it is shifted to the right by 1 bit, the serial output bit is used as AX-j, and the remaining bits are internally used for addition with the next 1×2 bit multiplication result. Retained. In the X shift register 17, when the contents held therein are shifted to the right by one bit by the control trigger pulse CLK2, the held bit of the flip-flop 19, ie, the sign bit S, is input to the MSB thereof.

一方、制御ブロック24からの制御トリガパルスCLK
3はXシフトレジスタ18および乗算器22に供給され
る。これによりXシフトレジスタ18は下位方向へのシ
フト動作(右シフト動作)を開始する。Xシフトレジス
タ18のLSBからのシリアル出力ビットY−には乗算
器22に供給される。乗算器22は、制御ブロック24
からの制御トリガパルスCLK3に応じてbmレジスタ
14の内容bmをロードし、同bmとXシフトレジスタ
18からのY′にとの乗算を制御トリガパルスCLK3
に応じて行なう。そして乗算器22は、その積のLSB
(BY”k)を出力する。
On the other hand, the control trigger pulse CLK from the control block 24
3 is supplied to X shift register 18 and multiplier 22. As a result, the X shift register 18 starts a downward shift operation (right shift operation). The serial output bit Y- from the LSB of X shift register 18 is provided to multiplier 22. The multiplier 22 is connected to the control block 24
The content bm of the bm register 14 is loaded in response to the control trigger pulse CLK3 from the control trigger pulse CLK3, and the content bm of the bm register 14 is multiplied by Y' from the X shift register 18.
Do so accordingly. The multiplier 22 then calculates the LSB of the product.
(BY”k) is output.

また、制御ブロック25からの制御トリガパルスCLK
1はeシフトレジスタ26に供給される。これによりe
シフトレジスタ26は下位方向へのシフト動作(右シフ
ト動作)を開始する。eシフトレジスタ26のLSBか
らのシリアル出力ビットEiは、フリップフロップ27
に一時保持されてタイミング調整が施され、E′iとし
て加算器31のA人力に供給される。加算器31のB入
力には乗算器21からのシリアル出力ビットAX′jが
供給される。
In addition, the control trigger pulse CLK from the control block 25
1 is supplied to the e shift register 26. This allows e
The shift register 26 starts a downward shift operation (right shift operation). The serial output bit Ei from the LSB of the e shift register 26 is sent to the flip-flop 27.
The signal is temporarily held, subjected to timing adjustment, and supplied to the adder 31 as E'i. The B input of the adder 31 is supplied with the serial output bit AX'j from the multiplier 21.

しかして加算器31においてE−1とAX−jとの(E
’−i +AX−j )はフリップフロップ32に一時
保持されてタイミング調整が施されて加算器34の六入
力に供給される。加算器34のB入力には、乗算器22
からのシリアル出力ビットBY−kがフリップフロップ
33に一度保持されてタイミング調整が施された後に供
給される。しかして加算器34器34ノ加算結果R”m
  (E −i + AX −J 十BY −k)はU
シフトレジスタ35のMSBにシリアル入力される。
Therefore, in the adder 31, (E
'-i+AX-j) is temporarily held in the flip-flop 32, subjected to timing adjustment, and supplied to six inputs of the adder 34. The B input of the adder 34 is connected to the multiplier 22
The serial output bit BY-k is once held in the flip-flop 33, subjected to timing adjustment, and then supplied. Therefore, the addition result of 34 adders 34 is R”m
(E -i + AX -J 1BY -k) is U
It is serially input to the MSB of the shift register 35.

以上の動作が繰返し行なわれ、加算器34の加算結果R
IIlのUシフトレジスタ35へのシリアル入力がp+
q (=48)回繰返されると、そのときのしシフトレ
ジスタ35の内容が求めるU (=a・x+b−y+e
)となる。なお、この実施例では、Uシフトレジスタ3
5に求められたUではなく、その上位p(=40)ビッ
ト即ち整数部のデータU′が求める結果として用いられ
る。即ちこの実施例では、小数部のq (=8)ビット
は、演算の精度を向上するために用いられる。
The above operation is repeated, and the addition result R of the adder 34 is
The serial input to the U shift register 35 of IIl is p+
When it is repeated q (=48) times, the contents of the shift register 35 at that time are the required U (=a・x+b−y+e
). Note that in this embodiment, the U shift register 3
5, but the upper p (=40) bits, that is, the data U' of the integer part is used as the result. That is, in this embodiment, q (=8) bits of the fractional part are used to improve the precision of the calculation.

さて、eシフトレジスタ26のLSBからのシリアル出
力ビットE1は、同レジスタ26のMSBにも入力され
る。即ちeシフトレジスタ26は制御トリガパルスCL
K1に応じて回転シフトするようになっている。したが
って制御ブロック25からの1)十〇 (=48)発の
制御トリガパルスCLK1により、eシフトレジスタ2
6においてp+q回の回転シフトが行なわれると、その
時の内容はeとなる。この場合、次のX、yの組の演算
において、eを改めてeシフトレジスタ26にセットす
る必要がなくなる。勿論、eを保持する(aeレジスタ
15、bemレジスタ16同様の)eレジスタを設け、
必要に応じてeレジスタからeシフトレジスタ26にロ
ードするようにしてもよい。
Now, the serial output bit E1 from the LSB of the e-shift register 26 is also input to the MSB of the same register 26. That is, the e shift register 26 receives the control trigger pulse CL.
The rotation is shifted according to K1. Therefore, the control trigger pulse CLK1 of 1) 10 (=48) from the control block 25 causes the
When the rotational shift is performed p+q times in step 6, the content at that time becomes e. In this case, there is no need to set e in the e shift register 26 again in the calculation of the next pair of X and y. Of course, an e register (similar to the ae register 15 and bem register 16) is provided to hold e,
If necessary, the data may be loaded from the e register to the e shift register 26.

上述したように、この実施例によれば第1図のマトリク
ス乗算器を用いることにより、U (=a= 22− ・x+b−y十e)を算出することができる。また第1
図のマトリクス乗算器をv (=c −x十d・y+f
)算出に用いることも可能である。この場合、amレジ
スタ13をcmラッチ用、bmレジスタ14を6mラッ
チ用、aeレジスタ15をceクラッチ、beレジスタ
16をdeクラッチ、eシフトレジスタ26をfラッチ
用にそれぞれ用いればよい。同様に、乗算器21をcm
とXとの乗算用、乗算器22をdmとyとの乗算用とに
用い、Uシフトレジスタ35をVラッチ用に用いればよ
い。この場合、算出の動作については、前記したU算出
の動作説明においてa、b、e、uをc、d、f。
As described above, according to this embodiment, by using the matrix multiplier shown in FIG. 1, it is possible to calculate U (=a=22-.x+by10e). Also the first
The matrix multiplier shown in the figure is v (=c −x0d・y+f
) can also be used for calculation. In this case, the am register 13 may be used for the cm latch, the bm register 14 for the 6m latch, the ae register 15 for the ce clutch, the be register 16 for the de clutch, and the e shift register 26 for the f latch. Similarly, the multiplier 21 is set to cm
The multiplier 22 may be used to multiply dm and y, and the U shift register 35 may be used to latch V. In this case, regarding the calculation operation, a, b, e, and u are replaced by c, d, and f in the explanation of the operation of U calculation described above.

■と読替えられたい。また第1図のマトリクス乗算器を
U算出用とV算出用に2台設けることにより、U、を並
行して求めることも可能である。
I would like it to be read as ■. Further, by providing two matrix multipliers shown in FIG. 1, one for calculating U and one for calculating V, it is also possible to calculate U in parallel.

この場合、Xレジスタ11およびXレジスタ12の組は
1組でもよい。また、第1図のマトリクス乗算器をUと
■算出用に交互に用いることも可能である。但し、この
場合には、amレジスタ13、bmレジスタ14、ae
レジスタ15、beレジスタ16、eシフトレジスタ2
6へのデータ設定を、UまたはVを求める際にその都度
行なう必要がある。
In this case, there may be only one set of the X register 11 and the X register 12. It is also possible to use the matrix multiplier shown in FIG. 1 alternately for calculating U and (2). However, in this case, am register 13, bm register 14, ae
Register 15, be register 16, e shift register 2
It is necessary to set data to 6 each time U or V is determined.

なお、この発明によるマトリクス乗算器は、図形処理の
座標変換に限らず、一般に(1)式で表わせるような演
算式における行ベクトルと列ベクトルとの乗算に適用可
能である。
Note that the matrix multiplier according to the present invention is applicable not only to coordinate transformation in graphic processing but also to multiplication of row vectors and column vectors in general arithmetic expressions such as the one expressed by equation (1).

[発明の効果] 以上詳述したようにこの発明によれば、a、b。[Effect of the invention] As detailed above, according to the present invention, a, b.

e(a、bは定数項であり実数、eは定数項であり固定
小数点数)の3つの要素からなる行ベクトルと、X、V
、1 (X、 yは変数項であり整数〉の3つの要素か
ら成る列ベクトルとの積であるa・x十b−y十eで示
される積和演算が簡単なハードウェア構成で高速に行な
える。
A row vector consisting of three elements e (a, b are constant terms and real numbers, e is a constant term and fixed point number), and X, V
, 1 (X, y are variable terms and integers) and a column vector consisting of three elements, and the product-sum operation represented by a x b - y e can be performed at high speed with a simple hardware configuration. I can do it.

【図面の簡単な説明】[Brief explanation of drawings]

第1図はこの発明の一実施例に係るマトリクス乗算器の
ブロック構成図、第2図はこの発明の詳細な説明する図
、第3図は動作を説明するためのタイミングチャートで
ある。 11・・・Xレジスタ、12・・・Xレジスタ、13・
・・amレジスタ、14・・・bmレジスタ、17・・
・Xシフトレジスタ、18・・・yシフトレジスタ、2
1.22・・・乗算器、23〜25・・・制御ブロック
、26・・・eシフトレジスタ、31、34・・・加算
器、35・・・Uシフトレジスタ。
FIG. 1 is a block diagram of a matrix multiplier according to an embodiment of the present invention, FIG. 2 is a diagram explaining the invention in detail, and FIG. 3 is a timing chart for explaining the operation. 11...X register, 12...X register, 13.
...am register, 14...bm register, 17...
・X shift register, 18...y shift register, 2
1.22... Multiplier, 23-25... Control block, 26... e shift register, 31, 34... Adder, 35... U shift register.

Claims (2)

【特許請求の範囲】[Claims] (1)am×2^a^e^−^m、bm×2^b^e^
−^mで表わされる定数項a、b(am、bmは2の補
数で表わされるlビットの整数、ae、be、mは0≦
ae、be≦mを満たす整数)および定数項e(eは2
の補数で表わされる整数部pビット、小数部qビットの
固定小数点数)の3つの要素から成る行ベクトルと変数
項x、y(x、yは2の補数で表わされるにビットの整
数)および固定値1の3つの要素から成る列ベクトルと
の積であるa・x+b・y+eで示される積和演算を行
なうマトリクス乗算器であつて、 上記amをラッチするamレジスタと、上記bmをラッ
チするbmレジスタと、動作開始により基本クロック信
号に応じてカウントを行ない、上記mとqとの差だけカ
ウントすると上記基本クロック信号に同期した第1制御
トリガパルスを繰返し発生する第1制御手段と、動作開
始により上記基本クロック信号に応じてカウントを行な
い、上記aeだけカウントすると上記基本クロック信号
に同期した第2制御トリガパルスを繰返し発生する第2
制御手段と、動作開始により上記基本クロック信号に応
じてカウントを行ない、上記beだけカウントすると上
記基本クロック信号に同期した第3制御トリガパルスを
繰返し発生する第3制御手段と、上記eをラッチし、そ
の内容を上記第1制御手段からの上記第1制御トリガパ
ルスに応じて下位方向にシフトする第1シフトレジスタ
と、上記xをラッチし、その内容を上記第2制御手段か
らの上記第2制御トリガパルスに応じて下位方向にシフ
トする第2シフトレジスタと、上記yをラッチし、その
内容を上記第3制御手段からの上記第3制御トリガパル
スに応じて下位方向にシフトする第3シフトレジスタと
、上記第2シフトレジスタからのシリアル出力ビットと
上記amレジスタの内容との乗算を上記第2制御手段か
らの上記第2制御トリガパルスに応じて実行する1×l
ビットの第1乗算器と、上記第3シフトレジスタからの
シリアル出力ビットと上記bmレジスタの内容との乗算
を上記第3制御手段からの上記第3制御トリガパルスに
応じて実行する1×lビットの第2乗算器と、上記第1
および第2乗算器から1回の乗算動作毎にそれぞれ出力
される乗算結果の最下位ビットと上記第1シフトレジス
タからのシリアル出力ビットとの加算を行なう加算手段
と、を具備することを特徴とするマトリクス乗算器。
(1) am x 2^a^e^-^m, bm x 2^b^e^
Constant terms a, b expressed as -^m (am, bm are l-bit integers expressed in two's complement, ae, be, m are 0≦
ae, an integer satisfying be≦m) and a constant term e (e is 2
A row vector consisting of three elements, variable terms x, y (x, y are 2-bit integers expressed in 2's complement), A matrix multiplier that performs a product-sum operation represented by a, x + b, y + e, which is a product of a column vector consisting of three elements with a fixed value of 1, and an am register that latches the above am and an am register that latches the above bm. bm register; a first control means that performs counting according to the basic clock signal when the operation starts, and repeatedly generates a first control trigger pulse synchronized with the basic clock signal when the difference between the m and q is counted; At the start, counting is performed according to the basic clock signal, and when the ae is counted, a second control trigger pulse is repeatedly generated in synchronization with the basic clock signal.
a control means, a third control means that performs counting according to the basic clock signal at the start of operation, and repeatedly generates a third control trigger pulse synchronized with the basic clock signal when the above be is counted; and a third control means that latches the e. , a first shift register that shifts the contents downward in response to the first control trigger pulse from the first control means, and a first shift register that latches the x and transfers the contents to the second a second shift register that shifts downward in response to a control trigger pulse; and a third shift register that latches the y and shifts its contents downward in response to the third control trigger pulse from the third control means. a 1×l register, for performing multiplication of the serial output bit from the second shift register by the contents of the am register in response to the second control trigger pulse from the second control means;
a first bit multiplier and a 1×l bit for performing multiplication of the serial output bit from the third shift register by the content of the bm register in response to the third control trigger pulse from the third control means; a second multiplier of
and addition means for adding the least significant bit of the multiplication result output from the second multiplier for each multiplication operation and the serial output bit from the first shift register. matrix multiplier.
(2)上記第1制御手段が上記第1制御トリガパルスを
p+q回発生し、上記第2制御手段が上記第2制御トリ
ガパルスをk+l回発生し、上記第3制御手段が上記第
3制御トリガパルスをk+l回発生することを特徴とす
る特許請求の範囲第1項記載のマトリクス乗算器。
(2) The first control means generates the first control trigger pulse p+q times, the second control means generates the second control trigger pulse k+l times, and the third control means generates the third control trigger pulse p+q times. The matrix multiplier according to claim 1, characterized in that the pulse is generated k+l times.
JP60093124A 1985-04-30 1985-04-30 Matrix multiplier Granted JPS61251962A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60093124A JPS61251962A (en) 1985-04-30 1985-04-30 Matrix multiplier

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60093124A JPS61251962A (en) 1985-04-30 1985-04-30 Matrix multiplier

Publications (2)

Publication Number Publication Date
JPS61251962A true JPS61251962A (en) 1986-11-08
JPH0335700B2 JPH0335700B2 (en) 1991-05-29

Family

ID=14073770

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60093124A Granted JPS61251962A (en) 1985-04-30 1985-04-30 Matrix multiplier

Country Status (1)

Country Link
JP (1) JPS61251962A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61254987A (en) * 1985-05-07 1986-11-12 セイコーインスツルメンツ株式会社 Matrix computation circuit for graphic display

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61254987A (en) * 1985-05-07 1986-11-12 セイコーインスツルメンツ株式会社 Matrix computation circuit for graphic display

Also Published As

Publication number Publication date
JPH0335700B2 (en) 1991-05-29

Similar Documents

Publication Publication Date Title
US8990282B2 (en) Apparatus and method for performing fused multiply add floating point operation
US6295597B1 (en) Apparatus and method for improved vector processing to support extended-length integer arithmetic
Wang et al. A survey of hardware designs for decimal arithmetic
JPH05233228A (en) Floating point arithmetic unit and its arithmetic method
JP3418460B2 (en) Double precision division circuit and method
Mehta et al. Implementation of single precision floating point multiplier using karatsuba algorithm
Lichtenau et al. Quad precision floating point on the IBM z13
JPH0477932B2 (en)
Tan et al. Multiple-mode-supporting floating-point FMA unit for deep learning processors
US10983755B2 (en) Transcendental calculation unit apparatus and method
JP2822399B2 (en) Logarithmic function arithmetic unit
JP2508784B2 (en) Exponential function calculator
EP4018388A1 (en) Neural network training with decreased memory consumption and processor utilization
JPH04291418A (en) Pre-processor for division circuit
JPS61251962A (en) Matrix multiplier
TW201939266A (en) Fast vector multiplication and accumulation circuit
EP3610367B1 (en) Energy-efficient variable power adder and methods of use thereof
JPH0322024A (en) Multiplier
JPH0335701B2 (en)
US20040049528A1 (en) Apparatus and method for adding multiple-bit binary-strings
Liu et al. The Mechanism of The Arithmetic Logic Unit
JPH0325809B2 (en)
JP3251071B2 (en) Division / square root calculation method and calculation device
JP2508286B2 (en) Square root calculator
JP3461706B2 (en) Digit serial multiplier