JPH0277967A - matrix multiplier - Google Patents
matrix multiplierInfo
- Publication number
- JPH0277967A JPH0277967A JP63230422A JP23042288A JPH0277967A JP H0277967 A JPH0277967 A JP H0277967A JP 63230422 A JP63230422 A JP 63230422A JP 23042288 A JP23042288 A JP 23042288A JP H0277967 A JPH0277967 A JP H0277967A
- Authority
- JP
- Japan
- Prior art keywords
- matrix
- circuit
- multiplier
- vector
- column
- 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.)
- Pending
Links
Landscapes
- Complex Calculations (AREA)
Abstract
(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.
Description
【発明の詳細な説明】
産業上の利用分野
本発明は、マトリックスとベクトルを乗算するマトリッ
クス乗算器に関し、特にグラフィックスデイスプレィ装
置における座標変換を高速に行うマトリックス乗算器に
関する。DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a matrix multiplier that multiplies a matrix and a vector, and more particularly to a matrix multiplier that performs coordinate transformation at high speed in a graphics display device.
従来の技術
]ンピュータグラフィックスやCADの分野で用いられ
るグラフィックスデイスプレィ装置においては、定義さ
れた物体を様々な視点から見た画像や、物体自身を移動
させたり回転させた画像を高速に表示することが要求さ
れる。表示の対象となる物体はその表面を多角形で近似
し、多角形の集合として定義される。また個々の多角形
はその多角形を構成する頂点の座標を示すベクトルの集
合として表現される。一方、視点を変えたり物体を移動
させる処理は座標を変換するためのマトリックスとして
表現される。従って、視点や物体があたかも連続的に移
動しているかのように表示するためには、物体を定義す
る座標ベクトルに、変換を表す変換マトリックスを高速
に乗することが必要になる。この機能を実現する装置を
マトリックス乗算器と呼ぶ。具体的にどのようなマトリ
ックスがどのような変換を表すかについては、例えば、
「コンピュータデイスプレィによる図形処理工学」(山
口冨士夫著、日刊工業新聞社、昭和56年)の第3章お
よび第4章(pp65〜211)などに詳しく述べられ
ている。一般に、グラフィックデイスプレィ装置で用い
られるマトリックス乗算器では1つの変換マトリックス
を複数の座標ベクトルに乗することが多いため、マトリ
ックス乗算器内にマトリックスの要素を格納するための
マトリックスレジスタと呼ばれるレジスタを設けて、予
め変換マトリックスの要素を格納しておき、逐次入力さ
れる座標ベクトルに変換マトリックスを乗するという方
法がとられる。またマトリックスレジスタを複数設けて
、い(つかの変換マトリックスを格納しておき、入力さ
れる座標ベクトルごとに選択的に乗する方法もとられて
いる。このようなマトリックス乗算器の例として、特開
昭48−83744 rマトリクス乗算器」が挙げられ
る。[Prior art] Graphics display devices used in the fields of computer graphics and CAD rapidly display images of a defined object viewed from various viewpoints, or images of the object itself being moved or rotated. This is required. The surface of an object to be displayed is approximated by a polygon, and is defined as a set of polygons. Furthermore, each polygon is expressed as a set of vectors indicating the coordinates of the vertices that make up the polygon. On the other hand, the process of changing the viewpoint or moving an object is expressed as a matrix for converting coordinates. Therefore, in order to display the viewpoint or object as if it were continuously moving, it is necessary to quickly multiply the coordinate vector that defines the object by a transformation matrix representing the transformation. A device that achieves this function is called a matrix multiplier. For details on what kind of matrix represents what kind of transformation, for example,
It is described in detail in Chapters 3 and 4 (pp. 65-211) of ``Graphic Processing Engineering Using Computer Displays'' (Fujio Yamaguchi, Nikkan Kogyo Shimbun, 1981). In general, matrix multipliers used in graphic display devices often multiply one transformation matrix by multiple coordinate vectors, so a register called a matrix register is provided in the matrix multiplier to store matrix elements. Therefore, a method is used in which the elements of the transformation matrix are stored in advance and the coordinate vectors that are sequentially input are multiplied by the transformation matrix. Another method is to provide a plurality of matrix registers, store some transformation matrices, and selectively multiply each input coordinate vector. As an example of such a matrix multiplier, 1974-83744 r matrix multiplier".
第5図は前記従来例に示されたマトリックス乗算器の構
成を示すブロック図である。第5図で、501はマトリ
ックスレジスタ群を、502はマトリックス読出し回路
を、503は乗数となるマトリックスを、504は入力
された第1のm次元ベクトルを、505はマトリックス
乗算回路を、506は積となる第2のm次元ベクトルを
示している。マトリックスレジスタ501に格納された
複数のm行m列のマトリックスの要素は、マトリックス
読出し回路502によって、そのうちのいずれかのマト
リックスが選択され、読出されたマトリックスの要素5
03はマトリックス乗算回路505に供給される。マト
リックス乗算回路505は入力された第1のm次元ベク
トル504に読出されたマトリックスの要素503を乗
算し、積として第2のm次元ベクトル506を出力する
。マトリックス乗算回路505で行われる乗算は、第1
のm次元ベクトル504を行ベクトルとみなして、マト
リックスの要素503を右から乗するか、または第1の
m次元ベクトル504を列ベクトルとみなして、マトリ
ックスの要素503を左から乗するかのいずれか一方の
演算のみを行う。FIG. 5 is a block diagram showing the structure of the matrix multiplier shown in the conventional example. In FIG. 5, 501 is a matrix register group, 502 is a matrix readout circuit, 503 is a matrix serving as a multiplier, 504 is an input first m-dimensional vector, 505 is a matrix multiplication circuit, and 506 is a multiplier. The second m-dimensional vector is shown. The matrix reading circuit 502 selects one of the elements of a plurality of m rows and m columns of matrices stored in the matrix register 501, and reads element 5 of the matrix.
03 is supplied to the matrix multiplication circuit 505. The matrix multiplication circuit 505 multiplies the input first m-dimensional vector 504 by the read matrix element 503, and outputs a second m-dimensional vector 506 as the product. The multiplication performed in the matrix multiplication circuit 505 is performed by the first
The first m-dimensional vector 504 is regarded as a row vector and the elements 503 of the matrix are multiplied from the right, or the first m-dimensional vector 504 is regarded as a column vector and the elements 503 of the matrix are multiplied from the left. Perform only one operation.
発明が解決しようとする課題
一般に、いくつかの変換を連続して行う場合に、逐次に
入力される座標ベクトルに対してこれらの変換を表すマ
トリックスをひとつずつ乗算することは効率的でないた
め、予めこれらの変換を合成(または結合)した変換を
表すマトリックスを作り、このマトリックスを入力され
る座標ベクトルに乗するという方法がとられる。変換の
合成はその変換を表すマトリックス同士を乗算すること
に相当する。従って、マトリックスをベクトルの集合と
考えれば、m行m列のマトリックスをm個のm次元ベク
トルに分解し、マトリックス乗算器を用いてm回のマト
リックスとベクトルの乗算を行えば、m行m列のマトリ
ックス同士の乗算が実現できる。しかしながら第5図に
示した従来のマトリックス乗算器では、マトリックス乗
算の結果として出力される積のm次元ベクトルの要素を
マトリックスレジスタに格納して、以後のマトリックス
乗算における乗数マトリックスの要素として利用するた
めの配慮がなされていないため、既にマトリックスレジ
スタに格納されているマトリックスに対して他のマトリ
ックスを乗じて、マトリックスの表す変換を合成し、そ
の積のマトリックスを以後の乗数マトリックスとして利
用できないという問題点があった。また、マトリックス
乗算回路505では、乗数マトリックスの要素503は
常に右からかまたは左からかのどちらか一方からしか乗
じられないため、例えば、常に右からしか乗じられない
場合には、この乗数マトリックの要素503となるマト
リックスに右から新たなマトリックス−を合成する(即
ち、乗する)ことができないという問題点があった。ま
た、乗数マトリックスの要素503が常に左からしか乗
じられない場合には、この乗数マトリックの要素503
となるマトリックスに左から新たなマトリックスを合成
することができないという問題点があった。Problem to be Solved by the Invention In general, when several transformations are performed in succession, it is not efficient to multiply successively input coordinate vectors one by one by a matrix representing these transformations. A method is used in which a matrix representing a transformation is created by combining (or combining) these transformations, and the input coordinate vector is multiplied by this matrix. Composition of transformations corresponds to multiplying the matrices representing the transformations. Therefore, if we consider a matrix as a set of vectors, if we decompose an m-by-m-column matrix into m m-dimensional vectors and use a matrix multiplier to multiply the matrix and the vector m times, Multiplication between matrices can be realized. However, in the conventional matrix multiplier shown in FIG. 5, the elements of the m-dimensional vector of the product output as a result of matrix multiplication are stored in the matrix register and used as elements of the multiplier matrix in subsequent matrix multiplication. The problem is that the matrix already stored in the matrix register cannot be multiplied by another matrix to synthesize the transformation represented by the matrix, and the product matrix cannot be used as a subsequent multiplier matrix. was there. In addition, in the matrix multiplication circuit 505, the element 503 of the multiplier matrix is always multiplied only from either the right or the left. There is a problem in that it is not possible to combine (that is, multiply) a new matrix from the right with the matrix that becomes element 503. In addition, if the element 503 of the multiplier matrix is always multiplied only from the left, the element 503 of the multiplier matrix
There was a problem in that it was not possible to synthesize a new matrix from the left into the matrix.
本発明はかかる点に鑑み、予めマトリックスレジスタ群
に格納されているマトリックスに、新たなマトリックス
を右または左のいずれからも合成でき、またその合成さ
れたマトリックスをマトリックスレジスタ群に格納して
、以後のマトリックス乗算の乗数マトリックスとして利
用できるようなマトリックス乗算器を提供することを目
的とする。In view of this point, the present invention allows a new matrix to be synthesized from either the right or the left to the matrix previously stored in the matrix register group, and the synthesized matrix can be stored in the matrix register group and used thereafter. The present invention aims to provide a matrix multiplier that can be used as a multiplier matrix for matrix multiplication.
課題を解決するための手段
本発明は前記の課題を解決するために、複数のm f?
m列マトリックスの要素を格納するマトリックスレジス
タ群と、前記マトリックスレジスタ群の保持するいずれ
かのマトリックスの要素を読み出すマトリックス読出し
回路と、前記マトリックス読み出し回路の出力するm
fr m列マトリックスの要素の行と列を入れ替えるマ
トリックス転置回路と、前記マトリックス読出し回路の
出力するm行m列マトリックスの要素と前記マトリック
ス転置回路の出力するm行m列マトリックスの要素のい
ずれかを選択し出力する乗数マトリックス選択回路と、
入力された第1のm次元ベクトルに前記乗数マトリック
ス選択回路の出力するm行m列のマトリックスの要素を
乗算して積となる第2のm次元ベクトルを出力するマト
リックス乗算回路と、前記マトリックス乗算回路の出力
する第2のm次元ベクトルの要素を前記マトリックスレ
ジスタ群のいずれかのマトリックスレジスタに書き込む
マトリックス書き込み回路とを備えたマトリックス乗算
器である。Means for Solving the Problems In order to solve the above problems, the present invention provides a plurality of m f?
a matrix register group that stores elements of an m-column matrix; a matrix readout circuit that reads out any matrix element held by the matrix register group; and m
fr A matrix transposition circuit that swaps rows and columns of elements of an m-column matrix, and either an element of the m-row m-column matrix outputted by the matrix readout circuit or an element of the m-row m-column matrix outputted by the matrix transposition circuit. a multiplier matrix selection circuit that selects and outputs;
a matrix multiplication circuit that multiplies the input first m-dimensional vector by an element of an m-by-m-column matrix output from the multiplier matrix selection circuit and outputs a second m-dimensional vector that is the product; and the matrix multiplication circuit. The matrix multiplier includes a matrix write circuit for writing an element of a second m-dimensional vector outputted from the circuit into one of the matrix registers of the matrix register group.
作 用
本発明は前記の構成により、マトリックスレジスタ群に
格納されたいずれかのマトリックスの要素をマトリック
ス読出し回路によって読出し、読出されたマトリックス
の要素をそのまま、またはマトリックス転置回路で行と
列を入れ替えた後に、マトリックス乗算回路に供給して
、入力されたベクトルに乗じ、その積となるベクトルの
要素をマトリックス書き込み回路によってマトリックス
レジスタ群のいずれかのマトリックスレジスタに書き込
むことにより、合成されたマトリックスをマトリックス
レジスタに格納し、以後のマトリックス乗算における乗
数マトリックスとして利用することを可能にしている。According to the above configuration, the present invention reads out the elements of any matrix stored in the matrix register group by the matrix readout circuit, and reads out the readout matrix elements as they are or by transposing the rows and columns with the matrix transposition circuit. Afterwards, the input vector is supplied to a matrix multiplication circuit, multiplied by the input vector, and the elements of the vector that is the product are written to one of the matrix registers in the matrix register group by the matrix write circuit, thereby writing the combined matrix into the matrix register. It is possible to store it in the matrix and use it as a multiplier matrix in subsequent matrix multiplication.
また、マトリックス転置回路によって、マトリックスを
右および左のいずれからも合成することを可能にしてい
る。Additionally, a matrix transposition circuit allows matrices to be synthesized from either the right or the left.
実施例
第1図は本発明のマトリックス乗算器の一実施例の構成
を示すブロック図である。第1図において、101はマ
トリックスレジスタ群を、102はマトリックス読出し
回路を、103はマトリックス読出し回路102によっ
て読出されたマトリックスの要素を、104はマトリッ
クス転置回路を、105はマトリックス転置回路104
によって行と列を入れ替えられたマトリックスの要素を
、106は乗数マトリックス選択回路を、107は乗数
マトリックス選択回路106によって選択された乗数マ
トリックスの要素を、108は入力された第1のm次元
ベクトルを、109はマトリックス乗算回路を、110
はマトリックス乗算回路109の出力する積を表す第2
のm次元ベクトルを、111はマトリックス書き込み回
路をそれぞれ示している。Embodiment FIG. 1 is a block diagram showing the structure of an embodiment of the matrix multiplier of the present invention. In FIG. 1, 101 is a matrix register group, 102 is a matrix readout circuit, 103 is a matrix element read out by the matrix readout circuit 102, 104 is a matrix transposition circuit, and 105 is a matrix transposition circuit 104.
106 is the multiplier matrix selection circuit, 107 is the multiplier matrix element selected by the multiplier matrix selection circuit 106, and 108 is the input first m-dimensional vector. , 109 is a matrix multiplication circuit, 110
represents the product output from the matrix multiplication circuit 109.
111 represents an m-dimensional vector, and 111 represents a matrix writing circuit, respectively.
以上のように構成された本発明のマトリックス乗算器の
一実施例の動作を以下に説明する。なお、以下の説明に
おいて、「マトリックス」という用語と「マトリックス
の要素」という用語を同じ意味で用いる。マトリックス
レジスタ群101は複数のm行m列のマトリックスの要
素を格納するために、m行m列のレジスタからなるマト
リックスレジスタが複数で構成されでいる。マトリック
ス読出し回路102はマトリックスレジスタ群101を
構成するマトリックスレジスタのいずれか1つのマトリ
ックスレジスタに格納されたm行m列マトリックスの要
素を選択して読出し、マトリックス転置回路104およ
び乗数マトリックス選択回路106に出力する。一方、
マトリックス書き込み回路111は、マトリックス乗算
回路109の出力する積を表す第2のm次元ベクトル1
10の各要素を、マトリックスレジスタ群101のいず
れかのマトリックスレジスタのいずれかの行または列に
格納する。The operation of one embodiment of the matrix multiplier of the present invention configured as described above will be described below. Note that in the following description, the terms "matrix" and "matrix element" are used interchangeably. The matrix register group 101 includes a plurality of matrix registers each having m rows and m columns to store elements of a plurality of m rows and m columns of matrices. The matrix readout circuit 102 selects and reads out the elements of the m-row m-column matrix stored in any one of the matrix registers constituting the matrix register group 101, and outputs the selected elements to the matrix transposition circuit 104 and the multiplier matrix selection circuit 106. do. on the other hand,
The matrix writing circuit 111 writes a second m-dimensional vector 1 representing the product output from the matrix multiplication circuit 109.
Each of the 10 elements is stored in any row or column of any matrix register in the matrix register group 101.
第2図にマトリックスレジスタ群101とマトリックス
読出し回路102とマトリックス書き込み回路111の
より詳細な実施例のブロック図を、mが3で、マトリッ
クスレジスタが3つの場合を例にして示す。第2図(a
)は請求項2記載のマトリックス乗算器における実施例
を示しており、第2図(b)は請求項3記載のマトリッ
クス乗算器における実施例を示している。第2図(a)
および(b)において、201はマトリックス乗算回路
109の出力する積を表すベクトル110の第1要素を
、202は゛ベクトル110の第2要素を、203はベ
クトル110の第3要素を示しており、204から21
2はマトリックスレジスタ群を構成する3つのマトリッ
クスレジスタの各行各列ごとの要素を格納するレジスタ
を示しており、204.205.206が第1行の要素
に、207.208.209が第2行の要素に、210
.211.212が第3行の要素にそれぞれ対応してお
り、204.207.210が第1列の要素に、205
.208.211が第2列の要素に、206.209.
212が第3列の要素にそれぞれ対応している。213
から221は各行各列の要素を保持する3つのレジスタ
204〜212から、いずれかのマトリックスレジスタ
の要素を選択するためのセレクタであり、前記のマトリ
ックス読出し回路102を構成する。222〜230は
マトリックス読出し回路102を構成する各セレクタ2
13〜221の出力するマトリックスの要素である。な
お、前記のマトリックス書き込み回路111は図示され
ないが、ベクトルの要素201〜203を、マトリック
スレジスタ群101を構成するいずれか1つのマトリッ
ク、スレジスタのいずれか1つの行(第2図(a)の場
合)または列(第2図(b)の場合)に対応したレジス
タ204〜212に格納するための制御を行う。FIG. 2 shows a block diagram of a more detailed embodiment of the matrix register group 101, the matrix read circuit 102, and the matrix write circuit 111, taking as an example the case where m is 3 and there are three matrix registers. Figure 2 (a
) shows an embodiment of the matrix multiplier according to claim 2, and FIG. 2(b) shows an embodiment of the matrix multiplier according to claim 3. Figure 2(a)
In (b), 201 indicates the first element of the vector 110 representing the product output from the matrix multiplication circuit 109, 202 indicates the second element of the vector 110, 203 indicates the third element of the vector 110, and 204 From 21
2 indicates a register that stores elements for each row and each column of the three matrix registers that make up the matrix register group; 204, 205, and 206 are the elements in the first row, and 207, 208, and 209 are the elements in the second row. 210 to the element of
.. 211.212 correspond to the elements in the third row, 204.207.210 correspond to the elements in the first column, 205
.. 208.211 is the second column element, 206.209.
212 correspond to the elements in the third column. 213
221 is a selector for selecting an element of one of the matrix registers from the three registers 204 to 212 holding elements of each row and each column, and constitutes the matrix readout circuit 102. 222 to 230 are respective selectors 2 constituting the matrix readout circuit 102;
These are the elements of the matrix to be output from 13 to 221. Although the matrix write circuit 111 is not shown, vector elements 201 to 203 are written to any one row of any one matrix or register (in the case of FIG. 2(a)) constituting the matrix register group 101. ) or column (in the case of FIG. 2(b)).
第1図に戻って、マトリックス転置回路104は、マト
リックス読出し回路102が出力するマトリックスの要
素103の行と列を入れ替えて転置マトリックスの要素
105を出力する。乗数マトリックス選択回路106は
、マトリックス読出し回路102が出力するマトリック
スの要素103またはマトリックス転置回路104が出
力する転置マトリックスの要素105のいずれかを選択
して、乗数マトリックスの要素107として出力する。Returning to FIG. 1, the matrix transposition circuit 104 interchanges the rows and columns of the matrix element 103 output by the matrix readout circuit 102 and outputs the transposed matrix element 105. The multiplier matrix selection circuit 106 selects either the matrix element 103 outputted by the matrix readout circuit 102 or the transposed matrix element 105 outputted by the matrix transposition circuit 104, and outputs it as the multiplier matrix element 107.
第3図にマトリックス転置回路104と乗数マトリック
ス選択回路106のより詳細な実施例を、第2図の場合
と同様にmが3の場合を例にして示す。第3図において
、301から309はマトリックス読出し回路102の
出力するマトリックス103の各要素を示しており第2
図(a)および(b)における222〜230と同じも
のである。301が第1行第1列の要素に、302が第
1行第2列の要素に、303が第1行第3列の要素に、
304が第2行第1列の要素に、以下同様にして、30
9が第3行第3列の要素にそれぞれ対応している。31
0から315はそれぞれセレクタであり、乗数マトリッ
クス107としてマトリックス読出し回路102の出力
するマトリックス103をそのまま出力する場合には、
それぞれのセレクタの左側の入力を選択し、乗数マトリ
ックス107としてマトリックス転置回路104の出力
するマトリックス105を選択する場合には、それぞれ
のセレクタの右側の入力を選択する。316から324
は乗数マトリックス選択回路106の出力する乗数マト
リックスの各要素を示しており、316が第1行第1列
の要素に、317が第1行第2列の要素に、318が第
1行第3列の要素に、319が第2行第1列の要素に、
以下同様にして、324が第3行第3列の要素にそれぞ
れ対応している。FIG. 3 shows a more detailed embodiment of the matrix transposition circuit 104 and the multiplier matrix selection circuit 106, taking as an example the case where m is 3, as in the case of FIG. In FIG. 3, 301 to 309 indicate each element of the matrix 103 output from the matrix readout circuit 102, and the second
These are the same as 222 to 230 in Figures (a) and (b). 301 is the element in the first row, first column, 302 is the element in the first row, second column, 303 is the element in the first row, third column,
304 is the element in the second row and first column, and in the same way, 30
9 corresponds to the elements in the third row and third column, respectively. 31
0 to 315 are selectors, and when the matrix 103 output from the matrix readout circuit 102 is output as is as the multiplier matrix 107,
When selecting the left input of each selector and selecting the matrix 105 output from the matrix transposition circuit 104 as the multiplier matrix 107, the right input of each selector is selected. 316 to 324
indicates each element of the multiplier matrix output from the multiplier matrix selection circuit 106, where 316 is the element in the first row and first column, 317 is the element in the first row and second column, and 318 is the element in the first row and third column. In the column element, 319 is the element in the second row and first column,
Similarly, 324 corresponds to the elements in the third row and third column.
第1図に戻って、マトリックス乗算回路109は入力さ
れた第1のm次元ベクトル108に乗数マトリックス1
07を乗算し、第2のm次元ベクトル110を積として
出力する。請求項2記戦のマトリックス乗算器では、第
1のm次元ベクトル108をm次元の行ベクトルとみな
して、ベクトル108の右から乗数マトリックス107
を乗じ、請求項3記載のマトリックス乗算器では、第1
のm次元ベクトル108をm次元の列ベクトルとみなし
て、ベクトル108の左から乗数マトリックス107を
乗する。Returning to FIG. 1, the matrix multiplication circuit 109 adds a multiplier matrix 1 to the input first m-dimensional vector 108.
07 and outputs the second m-dimensional vector 110 as a product. In the matrix multiplier according to claim 2, the first m-dimensional vector 108 is regarded as an m-dimensional row vector, and the multiplier matrix 107 is
In the matrix multiplier according to claim 3, the first
The m-dimensional vector 108 of is regarded as an m-dimensional column vector, and the vector 108 is multiplied by the multiplier matrix 107 from the left.
第4図にマトリックス乗算回路のより詳細な実施例を、
mが3の場合を例にして示す。第4図(a)は請求項2
記載のマトリックス乗算器であり、かつ請求項4記載の
マトリックス乗算器であるマトリックス乗算器における
マトリックス乗算回路の実施例を示しており、第4図(
b)は請求項3紀載のマトリックス乗算器であり、かつ
請求項4記載のマトリックス乗算器であるマトリックス
乗算器におけるマトリックス乗算回路の実施例を示して
いる。第4図(a)および(b)において、401は第
1のm次元ベクトル108の第1要素を、402は第1
のm次元ベクトル108の第2要素を、403は第1の
m次元ベクトル108の第3要素をそれぞれ示しており
、404から412は乗数マトリックス選択回路106
が出力する乗数マトリックス107の各要素を示してお
り、第3図の316から324と同じものである。また
、413から430はスカラ乗算器であり、431から
442はスカラ加算器である。第4図(a)では、スカ
ラ乗算器413.416.419およびスカラ加算器4
31,434が第1の積和演算回路を構成しており、ス
カラ乗算器414.417,420およびスカラ加算器
432.435が第2の積和演算回路を構成しており、
スカラ乗算器415.418.421およびスカラ加算
器433,436が第3の積和演算回路を構成している
。また、第4図(b)では、スカラ乗算器422.42
3.424およびスカラ加算器437.438が第1の
積和演算回路を構成しており、スカラ乗算器425.4
2−6,427およびスカラ加算器439,440が第
2の積和演算回路を構成しており、スカラ乗算器428
.429.430およびスカラ加算器441゜442が
第3の積和演算回路を構成している。443から445
はマトリックス乗算回路109の出力する積を表すベク
トル110の各要素を示しており、それぞれ第2図にお
ける201から203と同じものである。FIG. 4 shows a more detailed example of the matrix multiplication circuit.
The case where m is 3 will be shown as an example. Figure 4(a) is claim 2.
FIG.
b) is a matrix multiplier according to claim 3, and shows an embodiment of a matrix multiplication circuit in a matrix multiplier which is a matrix multiplier according to claim 4. In FIGS. 4(a) and (b), 401 represents the first element of the first m-dimensional vector 108, and 402 represents the first element of the first m-dimensional vector 108.
403 indicates the second element of the m-dimensional vector 108, 403 indicates the third element of the first m-dimensional vector 108, and 404 to 412 indicate the multiplier matrix selection circuit 106.
shows each element of the multiplier matrix 107 outputted by , and is the same as 316 to 324 in FIG. Further, 413 to 430 are scalar multipliers, and 431 to 442 are scalar adders. In FIG. 4(a), scalar multipliers 413, 416, 419 and scalar adders 4
31, 434 constitute a first product-sum calculation circuit, scalar multipliers 414, 417, 420 and scalar adders 432, 435 constitute a second product-sum calculation circuit,
Scalar multipliers 415, 418, and 421 and scalar adders 433 and 436 constitute a third product-sum operation circuit. In addition, in FIG. 4(b), scalar multipliers 422, 42
3.424 and scalar adders 437.438 constitute a first product-sum calculation circuit, and scalar multiplier 425.4
2-6, 427 and scalar adders 439, 440 constitute a second product-sum operation circuit, and a scalar multiplier 428
.. 429, 430 and scalar adders 441 and 442 constitute a third product-sum operation circuit. 443 to 445
denotes each element of the vector 110 representing the product output from the matrix multiplication circuit 109, and are the same as 201 to 203 in FIG. 2, respectively.
以上のように構成された本発明のマトリックス乗算器に
おいて、どのようにマトリックスの合成が実現されるか
を説明する。まず、請求項2記載のマトリックス乗算器
の場合について説明する。A description will be given of how matrices are combined in the matrix multiplier of the present invention configured as described above. First, the case of the matrix multiplier according to claim 2 will be explained.
この場合マトリックス乗算回路109では、入力された
ベクトル108をm次元の行ベクトルとみなして、乗数
マトリックス107は常にベクトル108の右から乗じ
られる。既にマトリックスレジスタ群101に格納され
ている方のマトリックスをAとし、マトリックスAに新
たに合成するマトリックスをBとする。マトリックスA
にマトリックスBを左から合成する場合(即ち、マトリ
ックスの積B−Aを求める場合)には、マトリクスBを
各行ごとにm個の行ベクトルに分解し、順次マトリック
ス乗算回路109に入力し、転置しないもとのままのマ
トリックスAと乗算し、第i行(t=it ・・・、m
)の行ベクトルから得られた積をマトリックスレジスタ
群101のマトリックスA以外のマトリックスレジスタ
の第i行に格納することにより、合成されたマトリック
スB−Aの要素がマトリックスレジスタ群101に格納
される。マトリックスAにマトリックスBを右から合成
する場合(即ち、マトリックスの積A・Bを求める場合
)には、マトリックスBを各列ごとにm個の列ベクトル
に分解し、順次マトリックス乗算回路109に入力し、
転置したマトリックスAと乗算し、第i列の列ベクトル
から得られた積をマトリックスレジスタ群101のマト
リックスA以外のマトリックスレジスタの第i行に格納
することにより、合成されたマトリックスA・Bの転置
マトリックスの要素がマトリックスレジスタ群101に
格納される。従って、次に乗数マトリックスとして用い
る際にマトリックス転置回路104で転置すれば、合成
されたマトリックスA−Bと同じ要素が乗数マトリック
スとして利用できることになる。これはマトリックスと
マトリックスの乗算における次式(1)の関係を用いて
いる。In this case, the matrix multiplication circuit 109 regards the input vector 108 as an m-dimensional row vector, and always multiplies the vector 108 from the right by the multiplier matrix 107. Let A be the matrix already stored in the matrix register group 101, and let B be the matrix to be newly combined with matrix A. Matrix A
To synthesize matrix B from the left (that is, to obtain the matrix product B-A), matrix B is decomposed into m row vectors for each row, sequentially input to matrix multiplication circuit 109, and transposed. The i-th row (t=it . . . , m
) is stored in the i-th row of matrix registers other than matrix A in matrix register group 101, the elements of the combined matrix B-A are stored in matrix register group 101. When combining matrix B with matrix A from the right (that is, when calculating the matrix product A and B), matrix B is decomposed into m column vectors for each column and sequentially input to the matrix multiplication circuit 109. death,
Transpose the combined matrices A and B by multiplying by the transposed matrix A and storing the product obtained from the column vector of the i-th column in the i-th row of the matrix register other than matrix A in the matrix register group 101. The elements of the matrix are stored in matrix register group 101. Therefore, if the matrix is transposed by the matrix transposition circuit 104 when used as a multiplier matrix next time, the same elements as the combined matrix A-B can be used as the multiplier matrix. This uses the relationship of the following equation (1) in matrix-matrix multiplication.
A−B= (T (T (B)・T(A)) (1)
但し、T (X)はマトリクスXの転置を表す。A-B= (T (T (B)・T(A)) (1)
However, T (X) represents the transposition of matrix X.
この場合マトリックスBに関する転置T (B)は、マ
トリックスBを列ベクトルに分解して入力し、乗算の際
にこの列ベクトルを行ベクトルとみなして乗算したこと
によって実現されている。In this case, the transpose T (B) regarding matrix B is realized by inputting matrix B after decomposing it into column vectors, and performing multiplication by treating the column vectors as row vectors.
次に、請求項3記載のマトリックス乗算器の場合につい
て説明する。この場合マトリックス乗算回路109では
、入力されたベクトル108をm次元の列ベクトルとみ
なして、乗数マトリックス107は常にベクトル108
の左から乗じられる。既にマトリックスレジスタ群10
1に格納されている方のマトリックスをAとし、マトリ
ックスAに新たに合成するマトリックスをBとする。Next, the case of the matrix multiplier according to claim 3 will be explained. In this case, the matrix multiplication circuit 109 regards the input vector 108 as an m-dimensional column vector, and the multiplier matrix 107 always uses the vector 108.
is multiplied from the left. Already matrix register group 10
Let A be the matrix stored in 1, and B be the matrix to be newly synthesized with matrix A.
マトリックスAにマトリックスBを右から合成する場合
(即ち、マトリックスの積A−Bを求める場合)には、
マトリクスBを各列ごとにm個の列ベクトルに分解し、
順次マトリックス乗算回路109に入力し、転置しない
もとのままのマトリックスAと乗算し、第i列(i=1
. ・・・、m)の列ベクトルから得られた積をマトリ
ックスレジスタ群101のマトリックスA以外のマトリ
ックスレジスタの第1列に格納することにより、合成さ
れたマトリックスA−Bの要素がマトリックスレジスタ
群101に格納される。マトリックスAにマトリックス
Bを左から合成する場合(即ち、マトリックスの積B−
Aを求める場合)には、マトリクスBを各行ごとにm個
の行ベクトルに分解し、順次マトリックス乗算回路10
9に入力し、転置したマトリックスAと乗算し、第i行
の行ベクトルから得られた積をマトリックスレジスタ群
101のマトリックスA以外のマトリックスレジスタの
第1列に格納することにより、合成されたマトリックス
B−Aの転置マトリックスの要素がマトリックスレジス
タ群101に格納される。When combining matrix B with matrix A from the right (that is, when calculating the matrix product A-B),
Decompose matrix B into m column vectors for each column,
It is sequentially input to the matrix multiplication circuit 109, multiplied by the original matrix A without transposition, and the i-th column (i=1
.. ..., m) in the first column of matrix registers other than matrix A in matrix register group 101, the elements of the combined matrix A-B are stored in matrix register group 101. is stored in When combining matrix B with matrix A from the left (i.e., matrix product B-
A), matrix B is decomposed into m row vectors for each row, and sequentially matrix multiplication circuit 10
9, multiplied by the transposed matrix A, and stored the product obtained from the row vector of the i-th row in the first column of the matrix register other than matrix A in the matrix register group 101. The elements of the transposed matrix of B-A are stored in matrix register group 101.
従って、次に乗数マトリックスとして用いる際にマトリ
ックス転置回路104で転置すれば、合成されたマトリ
ックスB−Aと同じ要素が乗数マトリックスとして利用
できることになる。これはマトリックスとマトリックス
の乗算における次式(2)の関係を用いている。Therefore, if the matrix is transposed in the matrix transposition circuit 104 when used as a multiplier matrix next time, the same elements as the combined matrix B-A can be used as the multiplier matrix. This uses the relationship of the following equation (2) in matrix-matrix multiplication.
B・A= (T (T (A)・T (B)) (2
)但し、T (X)はマトリクスXの転置を表す。B・A= (T (T (A)・T (B)) (2
) However, T (X) represents the transposition of matrix X.
この場合マトリックスBに関する転置T (B)は、マ
トリックスBを行ベクトルに分解して入力し、乗算の際
にこの行ベクトルを列ベクトルとみなして乗算したこと
によって実現されている。In this case, the transposition T (B) regarding matrix B is realized by inputting matrix B after decomposing it into row vectors, and performing multiplication by treating the row vectors as column vectors.
なお、本発明の実施例を示す際に、マトリックスの次元
を3として図示したがこの限りではな(、またマトリッ
クスレジスタ群に格納されるマトリックスの数もまた3
として図示したがこの限りではないことを付は加えてお
く。Note that although the dimensions of the matrix are illustrated as three in the embodiments of the present invention, this is not limited to this (and the number of matrices stored in the matrix register group is also three).
I would like to add that although this is shown in the diagram, this is not the only limit.
発明の効果
以上に説明してきたように、本発明によれば、既にマト
リックスレジスタに格納されているマトリックスに対し
て新たなマトリックスを合成することが、通常のマトリ
ックスとベクトルの乗算のひとつとして実現できる。ま
たマトリックスを右からも左からも合成することができ
る。従って、グラフィックデイスプレィ装置において、
座標ベクトルを変換するための変換マトリックスを高速
にかつ柔軟に合成することが可能となり、物体を種々の
視点から見た画像や物体に対して種々の回転や移動を施
した画像の生成の速度の向上に対する寄与は大である。Effects of the Invention As explained above, according to the present invention, combining a new matrix with a matrix already stored in a matrix register can be realized as one of ordinary matrix-vector multiplications. . It is also possible to compose matrices from the right or left. Therefore, in a graphic display device,
It is now possible to quickly and flexibly synthesize transformation matrices for converting coordinate vectors, and it is possible to speed up the generation of images of objects viewed from various viewpoints and images of objects rotated and moved in various ways. The contribution to improvement is significant.
第1図は本発明のマトリックス乗算器の一実施例の構成
を示すブロック図、第2図(a)は請求項2記載の発明
におけるマトリックス乗算器を構成するマトリックスレ
ジスタ群とマトリックス読出し回路とマトリックス書き
込み回路のより詳細な実施例を示すブロック図、第2図
(b)は請求項3記載の発明におけるマトリックス乗算
器を構成するマトリックスレジスタ群とマトリックス読
出し回路とマトリックス書き込み回路のより詳細な実施
例を示すブロック図、第3図は本発明のマトリックス乗
算器を構成するマトリックス転置回路と乗数マトリック
ス選択回路のより詳細な実施例を示すブロック図、第4
図(a)は請求項2記載の発明におけるマトリックス乗
算器でありかつ請求項4記載のマトリックス乗算器であ
るマトリックス乗算器を構成するマトリックス乗算回路
のより詳細な実施例を示すブロック図、第4図(b)は
請求項3記載の発明におけるマトリックス乗算器であり
かつ請求項4記載の発明におけるマトリックス乗算器で
あるマトリックス乗算器を構成するマトリックス乗算回
路のより詳細な実施例を示すブロック図、第5図は従来
のマトリックス乗算器の例を示すブロック図である。
101・・・マトリックスレジスタ群。
102・・・マトリックス読出し回路、104・・・マ
トリックス転置回路、
106・・・乗数マトリックス選択回路、107・・・
乗数マトリックス、
108・・・入力ベクトル、
109・・・マトリックス乗算回路、
110・・・積ベクトル。
代理人の氏名 弁理士 粟野重孝 ほか1名第1図
第 2 図 42113
図
114 図
とaノ第5図FIG. 1 is a block diagram showing the configuration of an embodiment of the matrix multiplier of the present invention, and FIG. FIG. 2(b) is a block diagram showing a more detailed embodiment of the write circuit, and FIG. 2(b) shows a more detailed embodiment of the matrix register group, the matrix read circuit, and the matrix write circuit that constitute the matrix multiplier in the invention according to claim 3. FIG. 3 is a block diagram showing a more detailed embodiment of the matrix transposition circuit and multiplier matrix selection circuit constituting the matrix multiplier of the present invention.
FIG. 4A is a block diagram showing a more detailed embodiment of a matrix multiplication circuit constituting a matrix multiplier which is a matrix multiplier according to the invention as claimed in claim 2 and is also a matrix multiplier as claimed in claim 4. Fig. (b) is a block diagram showing a more detailed embodiment of a matrix multiplier circuit constituting a matrix multiplier which is a matrix multiplier according to the invention according to claim 3 and which is a matrix multiplier according to the invention according to claim 4, FIG. 5 is a block diagram showing an example of a conventional matrix multiplier. 101...Matrix register group. 102... Matrix readout circuit, 104... Matrix transposition circuit, 106... Multiplier matrix selection circuit, 107...
Multiplier matrix, 108... Input vector, 109... Matrix multiplication circuit, 110... Product vector. Name of agent: Patent attorney Shigetaka Awano and one other person Figure 1 Figure 2 42113
Figure 114
and a no Figure 5
Claims (4)
トリックスレジスタ群と、前記マトリックスレジスタ群
の保持するいずれかのマトリックスの要素を読み出すマ
トリックス読出し回路と、前記マトリックス読み出し回
路の出力するm行m列マトリックスの要素の行と列を入
れ替えるマトリックス転置回路と、前記マトリックス読
出し回路の出力するm行m列マトリックスの要素と前記
マトリックス転置回路の出力するm行m列マトリックス
の要素のいずれかを選択し出力する乗数マトリックス選
択回路と、入力された第1のm次元ベクトルに前記乗数
マトリックス選択回路の出力するm行m列のマトリック
スの要素を乗算して積となる第2のm次元ベクトルを出
力するマトリックス乗算回路と、前記マトリックス乗算
回路の出力する第2のm次元ベクトルの要素を前記マト
リックスレジスタ群のいずれかのマトリックスレジスタ
に書き込むマトリックス書き込み回路とを具備すること
を特徴とするマトリックス乗算器。(1) A matrix register group that stores elements of a plurality of m rows and m columns of matrices, a matrix readout circuit that reads out the elements of any matrix held by the matrix register group, and m rows and m that the matrix readout circuit outputs. a matrix transposition circuit that swaps the rows and columns of elements of a column matrix; an element of an m-row, m-column matrix outputted by the matrix readout circuit; and an element of an m-row, m-column matrix outputted by the matrix transposition circuit. a multiplier matrix selection circuit to output, and a second m-dimensional vector that is the product of multiplying the input first m-dimensional vector by the elements of the m-row m-column matrix output from the multiplier matrix selection circuit; A matrix multiplier comprising: a matrix multiplication circuit; and a matrix write circuit for writing an element of a second m-dimensional vector output from the matrix multiplication circuit into one of the matrix registers of the matrix register group.
をm次元の行ベクトルとみなして、前記第1のm次元行
ベクトルに前記乗数マトリックス選択回路の出力するm
行m列マトリックスの要素を右から乗じ、積となる前記
第2のm次元ベクトルとしてm次元の行ベクトルを出力
し、前記マトリックス書き込み回路が前記第2のm次元
行ベクトルの各要素を、前記マトリックスレジスタ群の
いずれかのマトリックスレジスタのいずれかの行に、第
i要素(i=1、2、・・・、m)がその行の第i列要
素に対応するように書き込むことを特徴とする請求項1
記載のマトリックス乗算器。(2) A matrix multiplication circuit regards the first m-dimensional vector as an m-dimensional row vector, and outputs m from the multiplier matrix selection circuit to the first m-dimensional row vector.
The elements of the matrix with rows and m columns are multiplied from the right, and an m-dimensional row vector is output as the second m-dimensional vector that is the product, and the matrix writing circuit converts each element of the second m-dimensional row vector into the It is characterized by writing into any row of any matrix register of the matrix register group so that the i-th element (i=1, 2, ..., m) corresponds to the i-th column element of that row. Claim 1
The matrix multiplier described.
をm次元の列ベクトルとみなして、前記第1のm次元列
ベクトルに前記乗数マトリックス選択回路の出力するm
行m列マトリックスの要素を左から乗じ、積となる前記
第2のm次元ベクトルとしてm次元の列ベクトルを出力
し、前記マトリックス書き込み回路が前記第2のm次元
列ベクトルの各要素を、前記マトリックスレジスタ群の
いずれかのマトリックスレジスタのいずれかの列に、第
i要素(i=1、2、・・・、m)がその列の第i行要
素に対応するように書き込むことを特徴とする請求項1
記載のマトリックス乗算器。(3) A matrix multiplication circuit regards the first m-dimensional vector as an m-dimensional column vector, and outputs m from the multiplier matrix selection circuit to the first m-dimensional column vector.
The elements of the m-row, m-column matrix are multiplied from the left, and an m-dimensional column vector is output as the second m-dimensional vector to be the product, and the matrix writing circuit converts each element of the second m-dimensional column vector into the It is characterized by writing into any column of any matrix register of the matrix register group so that the i-th element (i=1, 2, ..., m) corresponds to the i-th row element of that column. Claim 1
The matrix multiplier described.
成される請求項1記載のマトリックス乗算器。(4) The matrix multiplier according to claim 1, wherein the matrix multiplier circuit is composed of m sets of product-sum calculation circuits.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63230422A JPH0277967A (en) | 1988-09-14 | 1988-09-14 | matrix multiplier |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63230422A JPH0277967A (en) | 1988-09-14 | 1988-09-14 | matrix multiplier |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0277967A true JPH0277967A (en) | 1990-03-19 |
Family
ID=16907643
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63230422A Pending JPH0277967A (en) | 1988-09-14 | 1988-09-14 | matrix multiplier |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0277967A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100416250B1 (en) * | 2001-02-05 | 2004-01-24 | 삼성전자주식회사 | Time-devision type matrix calculator |
-
1988
- 1988-09-14 JP JP63230422A patent/JPH0277967A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100416250B1 (en) * | 2001-02-05 | 2004-01-24 | 삼성전자주식회사 | Time-devision type matrix calculator |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7337205B2 (en) | Matrix multiplication in a vector processing system | |
| CN102053948B (en) | Method and system for transposing array data on simd multi-core processor architectures | |
| US6288723B1 (en) | Method and apparatus for converting data format to a graphics card | |
| US4719588A (en) | Matrix multiplication circuit for graphic display | |
| GB2240017A (en) | New, interpolated texture values are fed back to texture memories | |
| GB2240015A (en) | Texture memory addressing | |
| KR101202445B1 (en) | Processor | |
| US4764974A (en) | Apparatus and method for processing an image | |
| KR100249409B1 (en) | Signal processing system | |
| JPH08329261A (en) | Parameter curve generator | |
| JPH0277967A (en) | matrix multiplier | |
| Campeau | The synthesis and analysis of digital systems by Boolean matrices | |
| US5157517A (en) | Parallel interpolator for high speed digital image enlargement | |
| CA2164982A1 (en) | Real time active addressing display device and method utilizing fast walsh transform circuit | |
| JPS60211543A (en) | Coordinate converting system | |
| US20250298861A1 (en) | Acceleration unit configured for multi- dimensional block-scaled matrices | |
| JPH01293467A (en) | matrix multiplier | |
| JP3397838B2 (en) | Image processing apparatus and discrete cosine transform method | |
| JPH07141325A (en) | Signal processor | |
| Jones | Matrices: Tools for Manipulating Space | |
| Cheshire et al. | Parallelization in reservoir simulation | |
| JP2835366B2 (en) | Address information generator for fast Fourier transform | |
| JP2001118049A (en) | Image processing apparatus having matrix computing unit | |
| JPS62295174A (en) | Parallel data processor | |
| JPS6055837B2 (en) | graphic display device |