JPH05324700A - Matrix multiplication device - Google Patents

Matrix multiplication device

Info

Publication number
JPH05324700A
JPH05324700A JP4125767A JP12576792A JPH05324700A JP H05324700 A JPH05324700 A JP H05324700A JP 4125767 A JP4125767 A JP 4125767A JP 12576792 A JP12576792 A JP 12576792A JP H05324700 A JPH05324700 A JP H05324700A
Authority
JP
Japan
Prior art keywords
matrix
multiplication
elements
storage device
circuit
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
Application number
JP4125767A
Other languages
Japanese (ja)
Inventor
Noriaki Otake
紀明 大竹
Takahiro Sakurai
隆博 桜井
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.)
N T T DATA TSUSHIN KK
NTT Data Corp
Original Assignee
N T T DATA TSUSHIN KK
NTT Data Communications Systems 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 N T T DATA TSUSHIN KK, NTT Data Communications Systems Corp filed Critical N T T DATA TSUSHIN KK
Priority to JP4125767A priority Critical patent/JPH05324700A/en
Publication of JPH05324700A publication Critical patent/JPH05324700A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the number of times of the read-out of the element of a first matrix from a storage device by multiplying each element of the matrix, and accumulating and summing the multiplied result of each element of the same row of the first matrix. CONSTITUTION:One element of the matrix B and the elements of the matrix A are multiplied successively by a multiplication circuit 4, and results are stored in a multiplied result storage circuit 5, and the multiplied result and contents read out of a total added result storage circuit 9 to an added result storage circuit 6 are summed by an addition circuit 7, and after this result is stored temporarily in a temporary added result storage circuit 8, it is written in the total added result storage circuit 9. Thus, the multiplied result stored in the multiplied result storage circuit 5 and the contents read out of the total added result storage circuit 9 to the added result storage circuit 6 are summed by the addition circuit 7, and this result is written in the total added result storage circuit 9 after being stored temporarily in the temporary added result storage circuit 8.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、コンピュータに用いら
れ、行列乗算を行なう行列乗算装置に係わり、特に、行
列の乗算を高速に行なうのに好適な行列乗算装置に関す
るものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a matrix multiplication device used in a computer for performing matrix multiplication, and more particularly to a matrix multiplication device suitable for performing matrix multiplication at high speed.

【0002】[0002]

【従来の技術】コンピュータで科学技術計算などを処理
する場合、行列計算の処理に、多大の処理時間を費や
す。この行列計算の中には、行列の乗算も頻繁に出現す
る。このような行列の乗算を行なうコンピュータに関し
て、以下の図10〜図13を用いて説明する。
2. Description of the Related Art When a computer is used to process scientific and technological calculations, a great deal of processing time is spent in processing matrix calculations. Matrix multiplication frequently appears in this matrix calculation. A computer that performs such matrix multiplication will be described with reference to FIGS. 10 to 13 below.

【0003】図10は、行列の乗算の表記形態を示す説
明図であり、図11は、従来のコンピュータによる行列
の乗算手順を示す説明図である。行列A(l×m)と行
列B(m×n)、および、その行列Aと行列Bの積を行
列C(l×n)、また、行列A、B、Cのi行j列の要
素を、それぞれ、aij、bij、cijとすると、行
列の乗算は、図10に示す表記形態で表現される。コン
ピュータで、行列Aと行列Bの乗算を行ない、行列Cを
算出する場合、行列A、B、Cの各要素のデータは、記
憶装置(メモリなど)に格納される。行列Cの一つの要
素cijを求めるには、次の式(1)に示すように、図
11において、枠で囲まれた行列の部分に着目して、行
列Aの要素aik(k=1〜m)と、行列Bの要素bk
j(k=1〜m)のそれぞれ対応する要素どうしの乗算
を行ない、その乗算結果を累積加算する。
FIG. 10 is an explanatory diagram showing a notation form of matrix multiplication, and FIG. 11 is an explanatory diagram showing a matrix multiplication procedure by a conventional computer. The matrix A (l × m) and the matrix B (m × n), and the product of the matrix A and the matrix B is the matrix C (l × n), and the elements in the rows i and j of the matrices A, B and C Are respectively aij, bij, and cij, matrix multiplication is expressed in the notation form shown in FIG. When a computer multiplies the matrix A and the matrix B to calculate the matrix C, the data of each element of the matrices A, B, and C is stored in a storage device (memory or the like). To obtain one element cij of the matrix C, as shown in the following expression (1), paying attention to the part of the matrix surrounded by a frame in FIG. 11, the element aik (k = 1 to 1 of the matrix A is focused. m) and the element bk of the matrix B
The elements corresponding to j (k = 1 to m) are respectively multiplied, and the multiplication results are cumulatively added.

【0004】ここで、累積加算の途中結果を、計算が終
了する毎に、記憶装置に書き戻すのでは性能が上がらな
いので、処理装置(プロセッサなど)内のレジスタを使
用して、累積加算の途中結果を格納する。しかし、累積
加算の途中結果を格納するためのレジスタなどには制限
があるので、通常は、次の図12、および、図13で説
明するように、行列Cの要素を、一つずつ、逐次求めて
いく。
Here, since the performance cannot be improved by writing the intermediate result of the cumulative addition back to the storage device each time the calculation is completed, the register in the processing device (processor etc.) is used to perform the cumulative addition. Store the intermediate results. However, since there are restrictions on the registers and the like for storing the intermediate result of cumulative addition, normally, the elements of the matrix C are sequentially added one by one, as described in FIG. 12 and FIG. To seek.

【0005】図12は、従来の行列乗算を行なう処理装
置の構成を示すブロック図である。処理装置111は、
記憶装置110に記憶してある行列Aの要素112、お
よび、行列Bの要素113のそれぞれを読み出して格納
する行列A格納領域114、および、行列B格納領域1
15などからなるレジスタ群116と、このレジスタ群
116を用いて、行列Aと行列Bとの行列乗算を行な
い、その結果、すなわち、行列Cの要素117を、記憶
装置110に書き込む演算器118により構成されてい
る。尚、レジスタ群116には、演算器118による各
行列Aの要素112と行列Bの要素113のそれぞれの
乗算の結果を格納する乗算結果格納領域119と、演算
器118による乗算結果の累積加算の結果を格納する加
算結果格納領域120が設けられている。このような構
成の処理装置による行列Cの一つの要素cijを求める
時の動作を、次の図13を用いて説明する。
FIG. 12 is a block diagram showing the structure of a conventional processor for performing matrix multiplication. The processing device 111 is
The matrix A storage area 114 and the matrix B storage area 1 for reading and storing the elements 112 of the matrix A and the elements 113 of the matrix B stored in the storage device 110, respectively.
A register group 116 including 15 and the like, and a matrix multiplication of the matrix A and the matrix B using the register group 116, and the result, that is, the element 117 of the matrix C is written by the computing unit 118. It is configured. In the register group 116, a multiplication result storage area 119 for storing the result of multiplication of the element 112 of each matrix A and the element 113 of the matrix B by the arithmetic unit 118, and the cumulative addition of the multiplication result by the arithmetic unit 118. An addition result storage area 120 for storing the result is provided. The operation of the processing apparatus having such a configuration for obtaining one element cij of the matrix C will be described with reference to FIG.

【0006】図13は、図12における処理装置の行列
乗算の動作を示すフローチャートである。まず、記憶装
置に格納されている行列Aの要素aikを、図12のレ
ジスタ群116の行列A格納領域114に読み出す(ス
テップ1201)。次に、記憶装置に格納されている行
列Bの要素bkjを、図12のレジスタ群116の行列
B格納領域115に読み出す(ステップ1202)。そ
して、行列A格納領域の内容と、行列B格納領域の内容
を、図12の演算器118で掛け算し、その結果を、図
12の乗算結果格納領域119に格納する(ステップ1
203)。この乗算結果格納領域の内容と、(k−1)
回目までの累積加算結果を格納している図12の加算結
果格納領域120の内容を、図12の演算器118で、
足し算して、その結果を、図12の加算結果格納領域1
20に書き戻す(ステップ1204)。この処理を、m
回繰り返した後に(ステップ1205)、図12の加算
結果格納領域120の内容を、行列Cの要素Cijとし
て、図12の記憶装置110に書き込む(ステップ12
06)。
FIG. 13 is a flow chart showing the operation of the matrix multiplication of the processing device in FIG. First, the element aik of the matrix A stored in the storage device is read into the matrix A storage area 114 of the register group 116 of FIG. 12 (step 1201). Next, the element bkj of the matrix B stored in the storage device is read into the matrix B storage area 115 of the register group 116 in FIG. 12 (step 1202). Then, the contents of the matrix A storage area and the contents of the matrix B storage area are multiplied by the arithmetic unit 118 of FIG. 12, and the result is stored in the multiplication result storage area 119 of FIG. 12 (step 1
203). The contents of this multiplication result storage area and (k-1)
The contents of the addition result storage area 120 of FIG. 12, which stores the cumulative addition results up to the first time, are calculated by the arithmetic unit 118 of FIG.
The result of addition is calculated and the result is added area 1 in FIG.
Write back to 20 (step 1204). This process is m
After repeating (step 1205), the content of the addition result storage area 120 of FIG. 12 is written in the storage device 110 of FIG. 12 as the element Cij of the matrix C (step 12).
06).

【0007】そして、この処理を、行列Cの要素数(l
×n)回繰り返して、行列C全体を求める。その結果、
行列C全体を求めるためには、2m×l×n回の記憶装
置からの行列要素の読み出しと、m×l×n回の乗算演
算、m×l×n回の加算演算、および、l×n回の記憶
装置への行列要素の書き込みの処理が必要になる。ま
た、コンピュータ上では、プログラム(ソフトウェア)
は、命令語に展開され、記憶装置に格納されている。そ
のため、上述の例では、記憶装置から(4m+1)×l
×n回の命令語の読み出しが必要になる。尚、アドレス
の更新、及び、ループ回数制御の命令語の読み出し回数
は含んでいない。
Then, this processing is performed by the number of elements of the matrix C (l
× n) times are repeated to obtain the entire matrix C. as a result,
In order to obtain the entire matrix C, the matrix elements are read out from the storage device 2m × l × n times, m × l × n multiplication operations, m × l × n addition operations, and l × The process of writing the matrix element to the storage device n times is required. Also, on the computer, the program (software)
Is expanded into an instruction word and stored in the storage device. Therefore, in the above example, (4m + 1) × l from the storage device
It is necessary to read the instruction word × n times. It does not include the number of times the address is updated and the instruction word for controlling the loop count is read.

【0008】このように、処理装置内部の演算より多く
の記憶装置へのアクセスがある。現状では、処理装置の
処理能力は、記憶装置と処理装置間のデータ転送能力よ
り高いので、全体の処理時間は、記憶装置と処理装置間
のデータ転送能力によって決定される。これは、フォン
ノイマンのボトルネックとよばれている部分である。
Thus, there are more accesses to the storage device than there are calculations within the processor. At present, since the processing capacity of the processing device is higher than the data transfer capacity between the storage device and the processing device, the entire processing time is determined by the data transfer capacity between the storage device and the processing device. This is what is called the von Neumann bottleneck.

【0009】このボトルネックを解消するために、例え
ば、スーパーコンピュータなどにおいては、ベクトル命
令の概念を採用している。このベクトル命令は、決まっ
た手順の繰り返しで処理するデータの転送と演算を、一
つの命令で指定するものである。現在のスーパーコンピ
ュータのアーキテクチャは、全て、このベクトル命令を
持っていることが特徴であり、これにより、行列演算な
どの高速化を図っている。尚、このベクトル命令に対し
て、通常のコンピュータの一つの命令をスカラー命令と
いう。
In order to eliminate this bottleneck, for example, in supercomputers and the like, the concept of vector instructions is adopted. This vector instruction specifies transfer and operation of data to be processed by repeating a predetermined procedure with one instruction. All current supercomputer architectures are characterized by having this vector instruction, which is intended to speed up matrix operations. In addition to this vector instruction, one instruction of a normal computer is called a scalar instruction.

【0010】また、スーパーコンピュータなどでは、記
憶装置とのデータ転送能力を、最大限に発揮できるよう
に、高速演算技術を採用している。このような高速化を
図る高速演算技術には、パイプライン処理や並列演算が
ある。さらに、昨今のデバイス技術の進歩により、大容
量の記憶装置(メモリなど)を、処理装置(プロセッサ
など)内部に格納できるようになり、記憶装置への高速
データ転送が可能となり、処理時間の短縮が図られてい
る。
Further, in supercomputers and the like, high-speed arithmetic technology is adopted so as to maximize the data transfer capability with the storage device. High-speed arithmetic techniques for achieving such high speed include pipeline processing and parallel arithmetic. Furthermore, due to recent advances in device technology, a large-capacity storage device (memory, etc.) can be stored inside a processing device (processor, etc.), enabling high-speed data transfer to the storage device and shortening processing time. Is being pursued.

【0011】尚、このようなパイプライン処理やベクト
ル命令などの処理装置の高速化技術に関しては、例え
ば、電子情報通信学会編「電子情報通信ハンドブック」
(1988年、オーム社発行)の第1627頁から第1
632頁に記載されている。
Regarding the speed-up technology of the processing device such as pipeline processing and vector instruction, for example, "Electronic Information and Communication Handbook" edited by The Institute of Electronics, Information and Communication Engineers.
(Published by Ohmsha, Ltd. in 1988), pages 1627 to 1
Page 632.

【0012】[0012]

【発明が解決しようとする課題】解決しようとする問題
点は、従来の技術では、行列の乗算を行なう場合に、処
理装置と記憶装置間のデータ転送回数が非常に多く、デ
ータ転送が、処理時間の多くを占めてしまい、高速な処
理を行なうことができない点である。本発明の目的は、
これら従来技術の課題を解決し、処理装置と記憶装置間
のデータ転送回数を削減し、かつ、パイプライン処理技
術、及び、並列演算技術の併用を容易とし、高速な行列
の乗算を可能とする行列乗算装置を提供することであ
る。
The problem to be solved by the present invention is that, in the conventional technique, when matrix multiplication is performed, the number of times of data transfer between the processing device and the storage device is very large, and the data transfer is It takes a lot of time and cannot perform high-speed processing. The purpose of the present invention is to
These conventional problems are solved, the number of data transfers between the processing device and the storage device is reduced, the pipeline processing technology and the parallel operation technology are easily used together, and high-speed matrix multiplication is enabled. A matrix multiplication device is provided.

【0013】[0013]

【課題を解決するための手段】上記目的を達成するた
め、本発明の行列乗算装置は、(1)記憶装置に格納さ
れている第1および第2の二つの行列の乗算を行ない、
この乗算結果を、記憶装置に書き込む行列乗算装置であ
り、記憶装置から読み出した第1の行列の一つの要素毎
に、この要素に対応する第2の行列の全ての乗算要素
を、記憶装置から順次に読み出し、それぞれの掛け算を
行ない、第1の行列の各要素に対応する掛け算結果を累
積して加算する行列演算回路を設け、この行列演算回路
の加算結果を、記憶装置に書き込むことを特徴とする。
また、(2)上記(1)に記載の行列乗算装置におい
て、行列演算回路は、記憶装置から第1の行列の一つの
要素を読み出す第1の行列読み出し回路と、この第1の
行列読み出し回路で読み出した要素に対応する第2の行
列の全ての乗算要素を、記憶装置から順次に読み出す第
2の行列読み出し回路と、この第2の行列読み出し回路
で順次に読み出す各乗算要素と、第1の行列読み出し回
路で読み出した一つの要素との掛け算を、順次に行なう
乗算回路と、この乗算回路により、第1の行列読み出し
回路と第2の行列読み出し回路で順次に読み出す各要素
に対応して算出されたそれぞれの掛け算結果を、順次に
累積加算する加算回路とを具備し、この加算回路の加算
結果を、記憶装置に書き込むことを特徴とする。また、
(3)上記(2)に記載の行列乗算装置において、第1
の行列読み出し回路は、第1の行列の同じ列の要素群か
ら、一つの要素を順次に読み出すことを特徴とする。ま
た、(4)上記(2)に記載の行列乗算装置において、
第1の行列読み出し回路は、第1の行列の同じ行の要素
群から、一つの要素を順次に読み出すことを特徴とす
る。また、(5)上記(2)から(4)のいずれかに記
載の行列乗算装置において、第2の行列読み出し回路
は、第2の行列の同じ列の要素群から、乗算要素を順次
に読み出すことを特徴とする。また、(6)上記(2)
から(4)のいずれかに記載の行列乗算装置において、
第2の行列読み出し回路は、第2の行列の同じ行の要素
群から、乗算要素を順次に読み出すことを特徴とする。
また、(7)上記(1)から(6)のいずれかに記載の
行列乗算装置において、行列演算回路は、加算結果を格
納する部分加算結果格納回路を具備し、この部分加算結
果格納回路に格納した加算結果が、それぞれ対応する要
素間の行列乗算を全て完了した時点で、この加算結果
を、記憶装置に順次に書き込むことを特徴とする。ま
た、(8)上記(1)から(6)のいずれかに記載の行
列乗算装置において、行列演算回路は、全ての要素間の
行列乗算を完了するまで、加算結果を格納する全加算結
果格納回路を具備し、全ての要素間の行列乗算を完了し
た時点で、この全加算結果格納回路に格納した全ての加
算結果を、まとめて、記憶装置に書き込むことを特徴と
する。また、(9)上記(1)から(8)のいずれかに
記載の行列乗算装置において、少なくとも、行列演算回
路による第2の行列の各要素の記憶装置からの読み出し
と、乗算および加算とを含む動作を、パイプライン処理
する制御回路を具備することを特徴とする。また、(1
0)上記(1)から(9)のいずれかに記載の行列乗算
装置において、記憶装置に格納されている第1および第
2の二つの行列の乗算を、任意に分割された単位で、そ
れぞれ、並列に行なう複数個の行列演算回路を設けるこ
とを特徴とする。
In order to achieve the above object, the matrix multiplication device of the present invention (1) multiplies two first and second matrices stored in a storage device,
This is a matrix multiplication device that writes this multiplication result in a storage device, and for each element of the first matrix read from the storage device, all multiplication elements of the second matrix corresponding to this element are stored in the storage device. A matrix arithmetic circuit for sequentially reading out, performing each multiplication, accumulating and adding the multiplication results corresponding to each element of the first matrix is provided, and the addition result of the matrix arithmetic circuit is written to a storage device. And
(2) In the matrix multiplication device according to (1) above, the matrix operation circuit includes a first matrix read circuit that reads one element of the first matrix from the storage device, and the first matrix read circuit. A second matrix read circuit that sequentially reads from the storage device all the multiplication elements of the second matrix that correspond to the elements that were read in step 1, and each multiplication element that is sequentially read by the second matrix read circuit; Of the matrix read circuit, and a multiplication circuit for sequentially performing multiplication with one element read by the matrix read circuit, and this multiplication circuit corresponds to each element sequentially read by the first matrix read circuit and the second matrix read circuit. The present invention is characterized by including an adder circuit for sequentially accumulatively adding the calculated multiplication results, and writing the addition result of the adder circuit to a storage device. Also,
(3) In the matrix multiplication device according to (2), the first
The matrix read circuit of 1 is characterized in that one element is sequentially read from the element group of the same column of the first matrix. (4) In the matrix multiplication device according to (2) above,
The first matrix reading circuit is characterized in that one element is sequentially read from the element group in the same row of the first matrix. (5) In the matrix multiplication device according to any one of (2) to (4), the second matrix reading circuit sequentially reads the multiplication elements from the element group in the same column of the second matrix. It is characterized by Also, (6) above (2)
In the matrix multiplication device according to any one of (4) to (4),
The second matrix read circuit is characterized in that the multiplication elements are sequentially read from the element groups in the same row of the second matrix.
(7) In the matrix multiplication device according to any one of (1) to (6), the matrix operation circuit includes a partial addition result storage circuit that stores an addition result, and the partial addition result storage circuit includes: It is characterized in that the stored addition results are sequentially written in the storage device when the matrix multiplication between the corresponding elements is completed. (8) In the matrix multiplication device according to any one of (1) to (6), the matrix operation circuit stores the addition result until the matrix multiplication between all the elements is completed. The present invention is characterized by including a circuit, and when the matrix multiplication between all the elements is completed, all the addition results stored in the full addition result storage circuit are collectively written in the storage device. (9) In the matrix multiplication device according to any one of (1) to (8), at least reading of each element of the second matrix by the matrix calculation circuit from the storage device and multiplication and addition are performed. It is characterized by comprising a control circuit for carrying out pipeline processing of the operation including. Also, (1
0) In the matrix multiplication device according to any one of (1) to (9), the multiplication of the first and second two matrices stored in the storage device is performed in arbitrarily divided units, respectively. , A plurality of matrix operation circuits that are operated in parallel are provided.

【0014】[0014]

【作用】本発明においては、行列乗算装置は、第1の行
列の一つの要素毎に、対応する第2の行列の全ての乗算
要素を読み出して、行列の各要素の乗算を行なう。そし
て、第1の行列の同列の各要素のそれぞれの乗算結果
を、累積して加算する。このことにより、第1の行列の
要素の記憶装置からの読み出し回数を削減することがで
きる。さらに、行列乗算装置内でパイプライン処理を行
なうことにより、行列の乗算を高速に処理できる。ま
た、行列演算回路を複数個設け、それぞれ並列に使用す
ることにより、さらに、行列乗算処理を高速化すること
ができる。
In the present invention, the matrix multiplication device reads all the multiplication elements of the corresponding second matrix for each element of the first matrix and performs the multiplication of each element of the matrix. Then, the multiplication results of the respective elements in the same column of the first matrix are accumulated and added. This makes it possible to reduce the number of times the elements of the first matrix are read from the storage device. Further, by performing pipeline processing in the matrix multiplication device, matrix multiplication can be processed at high speed. Further, by providing a plurality of matrix operation circuits and using them in parallel, it is possible to further speed up the matrix multiplication process.

【0015】[0015]

【実施例】以下、本発明の実施例を、図面により詳細に
説明する。図1は、本発明を施した行列乗算装置の本発
明に係わる構成の第1の実施例を示すブロック図であ
る。本実施例の行列乗算装置11は、記憶装置1から、
本発明の第2の行列としての行列Aの要素1aを読み出
して格納する本発明の第2の行列読み出し回路としての
行列A格納回路3と、記憶装置1から、本発明の第1の
行列としての行列Bの要素1bを読み出して格納する本
発明の第1の行列読み出し回路としての行列B格納回路
2と、これらの行列A格納回路3および行列B格納回路
2の内容を掛け算する本発明に係わる乗算回路4と、こ
の乗算回路4によって掛け算された結果を格納する乗算
結果格納回路5と、行列計算において求める行列の全て
の要素の累積加算の途中結果を格納する本発明に係わる
全加算結果格納回路9と、この全加算結果格納回路9の
内容を読み出して格納する加算結果格納回路6と、この
加算結果格納回路6の内容と、乗算結果格納回路5の内
容とを足し算する本発明に係わる加算回路7と、この加
算回路7によって足し算された結果を、全加算結果格納
回路9に書き込む前に、一時的に格納する仮加算格納回
路8と、行列乗算装置11の全体制御と、記憶装置1へ
のアクセス制御、および、本発明に係わるパイプライン
処理制御などを行なう制御回路10とにより構成されて
いる。尚、この制御回路10を除く各回路により、本発
明の行列演算回路が構成され、その乗算結果である行列
Cの要素1cは、制御回路10の制御に基づき、記憶装
置1に書き込まれる。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 1 is a block diagram showing a first embodiment of a configuration according to the present invention of a matrix multiplication device according to the present invention. The matrix multiplication device 11 of the present embodiment is
The matrix A storage circuit 3 as the second matrix reading circuit of the present invention that reads and stores the element 1a of the matrix A as the second matrix of the present invention, and the storage device 1 as the first matrix of the present invention. The matrix B storage circuit 2 as the first matrix readout circuit of the present invention for reading and storing the element 1b of the matrix B of the above, and the present invention for multiplying the contents of these matrix A storage circuit 3 and matrix B storage circuit 2 The related multiplication circuit 4, the multiplication result storage circuit 5 for storing the result of multiplication by the multiplication circuit 4, and the full addition result according to the present invention for storing the intermediate result of cumulative addition of all the elements of the matrix obtained in the matrix calculation. The storage circuit 9, the addition result storage circuit 6 for reading and storing the contents of the full addition result storage circuit 9, the contents of the addition result storage circuit 6, and the contents of the multiplication result storage circuit 5 are added. The addition circuit 7 according to the present invention, the temporary addition storage circuit 8 for temporarily storing the result of addition by the addition circuit 7 before writing it in the full addition result storage circuit 9, and the overall control of the matrix multiplication device 11. , A control circuit 10 for controlling access to the storage device 1 and controlling pipeline processing according to the present invention. Each circuit except the control circuit 10 constitutes a matrix operation circuit of the present invention, and the element 1c of the matrix C which is the multiplication result is written in the storage device 1 under the control of the control circuit 10.

【0016】このような構成により、本実施例の行列乗
算装置11は、行列Aと行列Bとの乗算において、行列
の要素の記憶装置1からの読み出し回数を削減し、高速
化することができる。以下、図2〜図4に示す行列の乗
算式を用いて、行列乗算装置11の動作を説明する。
尚、行列の乗算(C=AB)の行列Cの各要素の計算 において、行列Cのj列の要素を算出する場合を用いて
説明する。
With such a configuration, the matrix multiplication device 11 of this embodiment can reduce the number of times of reading the elements of the matrix from the storage device 1 and speed up the multiplication of the matrix A and the matrix B. .. The operation of the matrix multiplication device 11 will be described below using the matrix multiplication formulas shown in FIGS.
Calculation of each element of matrix C of matrix multiplication (C = AB) In the above, a case where the element of the j-th column of the matrix C is calculated will be described.

【0017】図2〜図4は、それぞれ、図1における行
列乗算装置の本発明に係わる行列の乗算手順の一実施例
を示す説明図である。まず、図2に示すように、各行列
A、B、Cに対して、枠で囲まれた部分に着目する。す
なわち、行列Bの一つの要素b1jと、行列Aの要素a
k1(k=1〜l)を、図1の乗算回路4で逐次掛け算
し、その結果を、図1の乗算結果格納回路5に格納す
る。そして、その乗算結果と、図1の全加算結果格納回
路9から加算結果格納回路6に読み出した内容(初期値
は「0」)とを、図1の加算回路7で加算して、その結
果を、一時的に、図1の仮加算結果格納回路8に格納し
た後、図1の全加算結果格納回路9に書き込む。
2 to 4 are explanatory views showing one embodiment of the matrix multiplication procedure according to the present invention of the matrix multiplication apparatus in FIG. First, as shown in FIG. 2, for each matrix A, B, and C, pay attention to the portion surrounded by a frame. That is, one element b1j of matrix B and element a of matrix A
k1 (k = 1 to 1) is sequentially multiplied by the multiplication circuit 4 of FIG. 1, and the result is stored in the multiplication result storage circuit 5 of FIG. Then, the multiplication result and the content (initial value “0”) read from the full addition result storage circuit 9 of FIG. 1 to the addition result storage circuit 6 are added by the addition circuit 7 of FIG. Is temporarily stored in the temporary addition result storage circuit 8 of FIG. 1 and then written in the full addition result storage circuit 9 of FIG.

【0018】次に、図3に示すように、各行列A、B、
Cに対して、枠で囲まれた部分に着目する。すなわち、
行列Bの一つの要素b2jと、行列Aの要素ak2(k
=1〜l)を、図1の乗算回路4で逐次掛け算し、その
結果を、図1の乗算結果格納回路5に格納する。そし
て、その乗算結果と、図1の全加算結果格納回路9から
加算結果格納回路6に読み出した内容とを、図1の加算
回路7で加算して、その結果を、一時的に、図1の仮加
算結果格納回路8に格納した後、図1の全加算結果格納
回路9に書き込む。
Next, as shown in FIG. 3, each matrix A, B,
For C, pay attention to the part surrounded by the frame. That is,
One element b2j of matrix B and element ak2 (k of matrix A
= 1 to 1) are sequentially multiplied by the multiplication circuit 4 of FIG. 1, and the result is stored in the multiplication result storage circuit 5 of FIG. Then, the multiplication result and the contents read from the full addition result storage circuit 9 of FIG. 1 to the addition result storage circuit 6 are added by the addition circuit 7 of FIG. 1, and the result is temporarily shown in FIG. 1 is stored in the temporary addition result storage circuit 8 and then written in the full addition result storage circuit 9 in FIG.

【0019】このように、i回目の処理は、図4に示す
ように、各行列A、B、Cに対して、枠で囲まれた部分
に着目して、行列Bの一つの要素bijと、行列Aの要
素aki(=j)(k=1〜l)を、図1の乗算回路4
で逐次掛け算し、その結果を、図1の乗算結果格納回路
5に格納し、その乗算結果と、図1の全加算結果格納回
路9から加算結果格納回路6に読み出した内容((i−
1)回目までの累積加算結果)とを、図1の加算回路7
で加算して、その結果を、一時的に、図1の仮加算結果
格納回路8に格納した後、図1の全加算結果格納回路9
に書き込む。このような処理を、行列Cの列の数(n
回)繰り返して行列C全体が求められる。
As described above, in the i-th processing, as shown in FIG. 4, for each matrix A, B, and C, paying attention to the portion surrounded by the frame, one element bij of the matrix B and , The element aki (= j) (k = 1 to 1) of the matrix A is multiplied by the multiplication circuit 4 of FIG.
1 and the result is stored in the multiplication result storage circuit 5 of FIG. 1, and the multiplication result and the contents read from the full addition result storage circuit 9 of FIG. 1 to the addition result storage circuit 6 ((i-
1) cumulative addition result up to the first time) and the addition circuit 7 in FIG.
1 and the result is temporarily stored in the temporary addition result storage circuit 8 of FIG. 1, and then the full addition result storage circuit 9 of FIG.
Write in. Such processing is performed by the number of columns of the matrix C (n
The entire matrix C is obtained repeatedly.

【0020】次に、図5、および、図6を用いて、図1
の行列乗算装置11の動作を、さらに詳しく説明する。
図5、および、図6は、図1における行列乗算装置の本
発明に係わる動作の一実施例を示すフローチャートであ
る。まず、図5に示すように、記憶装置に格納されてい
る行列Bの要素bkjを、図1の行列B格納回路2に読
み出す(ステップ501)。次に、記憶装置に格納され
ている行列Aの要素aijを、図1の行列A格納回路3
に読み出す(ステップ502)。そして、行列A格納回
路の内容と、行列B格納回路の内容を、図1の乗算回路
4で掛け算する(ステップ503)。その掛け算の結果
を、図1の乗算結果格納回路5に格納する(ステップ5
04)。
Next, referring to FIG. 5 and FIG. 6, FIG.
The operation of the matrix multiplication device 11 will be described in more detail.
5 and 6 are flowcharts showing an embodiment of the operation of the matrix multiplication apparatus in FIG. 1 according to the present invention. First, as shown in FIG. 5, the element bkj of the matrix B stored in the storage device is read into the matrix B storage circuit 2 of FIG. 1 (step 501). Next, the element aij of the matrix A stored in the storage device is stored in the matrix A storage circuit 3 of FIG.
(Step 502). Then, the contents of the matrix A storage circuit and the contents of the matrix B storage circuit are multiplied by the multiplication circuit 4 in FIG. 1 (step 503). The result of the multiplication is stored in the multiplication result storage circuit 5 of FIG. 1 (step 5).
04).

【0021】次に、累積加算結果を格納している図1の
全加算結果格納回路9から、(k−1)回目までの加算
結果を、図1の加算結果格納回路6に読みだす(ステッ
プ505)。この加算結果格納回路の内容と、ステップ
503において格納した乗算結果格納回路の内容とを、
図1の加算回路7で足し算する(ステップ506)。そ
して、その加算結果を、図1の仮加算結果格納回路8に
書き込み(ステップ507)、さらに、この仮加算結果
格納回路の内容を、図1の全加算結果格納回路9に書き
込む(ステップ508)。
Next, the (k-1) th addition result is read from the addition result storage circuit 9 of FIG. 1 which stores the cumulative addition result to the addition result storage circuit 6 of FIG. 1 (step 505). The contents of this addition result storage circuit and the contents of the multiplication result storage circuit stored in step 503 are
The addition circuit 7 of FIG. 1 performs addition (step 506). Then, the addition result is written to the temporary addition result storage circuit 8 of FIG. 1 (step 507), and the content of the temporary addition result storage circuit is written to the full addition result storage circuit 9 of FIG. 1 (step 508). ..

【0022】そして、図6に示すように、ステップ50
2〜508のループを、l回繰り返し(ステップ50
9)、行列Bの一つの要素、例えば、図2に示すよう
に、要素b1jと、この要素b1jに対応する行列Aの
全ての乗算要素(a11〜al1)との乗算を行ない、
要素b1jに対する行列Cの各要素(c1j〜clj)
を得る。このようにして、行列Bの一つの要素に対応し
て、行列Cの各要素を得たならば、ステップ501に戻
り、次の行列Bの一要素、例えば、図3に示す要素b2
jを読み出し、以下、ステップ501〜508のループ
を、l回繰り返す。このことにより、要素b1jに対す
る行列Cの各要素(c1j〜clj)と、要素b2jに
対する行列Cの各要素(c1j〜clj)との累積結果
を得ることができる。
Then, as shown in FIG. 6, step 50
The loop of 2 to 508 is repeated 1 times (step 50
9), one element of the matrix B, for example, as shown in FIG. 2, the element b1j is multiplied by all the multiplication elements (a11 to al1) of the matrix A corresponding to this element b1j,
Each element of the matrix C for the element b1j (c1j to clj)
To get In this way, when each element of the matrix C is obtained corresponding to one element of the matrix B, the process returns to step 501 and one element of the next matrix B, for example, the element b2 shown in FIG.
j is read, and then the loop of steps 501 to 508 is repeated l times. As a result, the cumulative result of each element (c1j to clj) of the matrix C for the element b1j and each element (c1j to clj) of the matrix C for the element b2j can be obtained.

【0023】次の行列Bの要素に対しても、同様の処理
を繰り返し、ステップ501〜509のループを、m回
繰り返す(ステップ510)。このことにより、行列B
の一つの列の全要素、例えば、図2〜図4における各要
素(b1j〜bmj)に対する行列Aの各乗算要素(a
11〜alm)の乗算と累積加算を行ない、行列Cの一
つの列の全要素(c1j〜clj)を得ることができ
る。このようにして、行列Bの一つの列の全要素に対応
して、行列Cの一列分の全要素を得たならば、ステップ
501に戻り、行列Bの次の列の一要素、例えば、図2
〜図4に示す要素b1nを読み出す。
The same processing is repeated for the next element of the matrix B, and the loop of steps 501 to 509 is repeated m times (step 510). This gives the matrix B
Of all the elements in one column, for example, each multiplication element (a of the matrix A for each element (b1j to bmj) in FIGS. 2 to 4).
11 to alm) and cumulative addition are performed to obtain all the elements (c1j to clj) in one column of the matrix C. In this way, when all the elements of one column of the matrix C are obtained corresponding to all the elements of one column of the matrix B, the process returns to step 501 and one element of the next column of the matrix B, for example, Figure 2
~ The element b1n shown in FIG. 4 is read.

【0024】以下、ステップ502〜508のループの
l回の繰り返しと、ステップ501〜509のループの
m回の繰り返しを行ない、行列Bの次の列の全要素に対
応して、行列Cの一つの列の全要素(c1n〜cln)
を得ることができる。そして、行列Aと行列Bの各要素
に対して、ステップ502〜508のループのl回の繰
り返しと、ステップ501〜509のループのm回の繰
り返しを、n回繰り返すことにより(ステップ51
1)、行列Cの全ての要素(c11〜cln)を得るこ
とができる。
After that, the loop of steps 502-508 is repeated 1 times and the loop of steps 501-509 is repeated m times, and one of the matrix C corresponds to all elements in the next column of the matrix B. All elements in one row (c1n to cln)
Can be obtained. Then, for each element of the matrix A and the matrix B, the loop of steps 502-508 is repeated 1 times and the loop of steps 501-509 is repeated m times (step 51
1), all the elements (c11 to cln) of the matrix C can be obtained.

【0025】このようにして図1の全加算結果格納回路
9に格納された行列Cの全ての要素(c11〜cln)
を、記憶装置に書き込む(ステップ512)み、処理を
終了する。この結果、m×(l+1)×n回の記憶装置
からの行列要素の読み出しと、m×l×n回の乗算演算
および加算演算、そして、l×n回の記憶装置への行列
要素の書き込みとなり、従来技術に比較して、記憶装置
からの行列の要素の読み出し回数を削減することができ
る。すなわち、従来は、2m×l×n回であり、その差
は、2m×l×n−m×(l+1)×n=mn(l−
1)となり、l>1の条件で、2m×l×n−m×(l
+1)×n>0、故に、2m×l×n>m×(l+1)
×nとなる。
In this way, all the elements (c11 to cln) of the matrix C stored in the full addition result storage circuit 9 of FIG.
Is written in the storage device (step 512), and the process ends. As a result, m × (l + 1) × n times of reading of matrix elements from the storage device, m × l × n times of multiplication and addition operations, and 1 × n times of writing of the matrix elements to the storage device. Therefore, the number of times of reading the elements of the matrix from the storage device can be reduced as compared with the conventional technique. That is, conventionally, it is 2m × l × n times, and the difference is 2m × l × n−m × (l + 1) × n = mn (l−
1), and under the condition of l> 1, 2m × l × n−m × (l
+1) × n> 0, therefore 2m × l × n> m × (l + 1)
Xn.

【0026】次に、図7を用いて、上述のステップ50
2〜508の処理に対するパイプライン処理の適用を説
明する。図7は、図1における行列乗算装置の本発明に
係わるパイプライン処理の一実施例を示す説明図であ
る。本図において、61a〜61cは、記憶装置から行
列A格納回路への、行列Aの読み出し処理であり、図
中、例えば、AMR(k)は、記憶装置から行列A格納
回路への、行列Aの、k番目の読み出し処理を表わし、
図5のステップ502に対応する。また、62a〜62
cは、行列Aと行列Bの掛け算、及び、この乗算結果
の、図1の乗算結果格納回路5への書き込み処理であ
り、図中、例えば、MUX(k)は、k番目の行列Aと
行列Bの掛け算と書き込み処理を表わし、それぞれ、図
5のステップ503、504に対応する。
Next, referring to FIG. 7, the above step 50 is performed.
The application of pipeline processing to the processing of 2 to 508 will be described. FIG. 7 is an explanatory diagram showing an embodiment of pipeline processing according to the present invention of the matrix multiplication device in FIG. In the figure, reference numerals 61a to 61c denote a process of reading the matrix A from the storage device to the matrix A storage circuit. In the figure, for example, AMR (k) is the matrix A from the storage device to the matrix A storage circuit. Represents the k-th reading process of
This corresponds to step 502 in FIG. Also, 62a to 62
c is a multiplication of the matrix A and the matrix B, and a writing process of the multiplication result to the multiplication result storage circuit 5 of FIG. 1. For example, in the figure, MUX (k) is the kth matrix A The multiplication and the writing process of the matrix B are shown, which correspond to steps 503 and 504 of FIG. 5, respectively.

【0027】また、63a〜63cは、図1の全加算結
果格納回路9から、加算結果格納回路6への累積加算結
果の読み出し処理であり、図中、例えば、ARR(k)
は、(k−1)回目までの累積加算結果の読み出し処理
を表わし、図5のステップ505に対応する。また、6
4a〜64cは、図1の乗算結果格納回路5の内容と加
算結果格納回路6の内容の足し算、及び、この加算結果
の図1の仮加算結果格納回路8への書き込み処理であ
り、図中、例えば、ADD(k)は、k番目の乗算結果
格納回路の内容と(k−1)回目までの加算結果格納回
路の内容の足し算と書き込み処理を表わし、それぞれ、
図5のステップ506、507に対応する。また、65
a〜65cは、図1の仮加算結果格納回路8の内容の全
加算結果格納回路9への書き込み処理であり、図中、例
えば、ARW(k)は、k番目の仮加算結果格納回路の
内容の全加算結果格納回路への書き込み処理を表わし、
図5のステップ508に対応する。
Reference numerals 63a to 63c denote a process of reading the cumulative addition result from the full addition result storage circuit 9 of FIG. 1 to the addition result storage circuit 6, for example, ARR (k).
Represents the process of reading the cumulative addition result up to the (k-1) th time and corresponds to step 505 in FIG. Also, 6
Reference numerals 4a to 64c denote addition of the contents of the multiplication result storage circuit 5 and the contents of the addition result storage circuit 6 of FIG. 1, and a writing process of the addition result to the temporary addition result storage circuit 8 of FIG. For example, ADD (k) represents addition and writing processing of the contents of the kth multiplication result storage circuit and the contents of the addition result storage circuit up to (k-1) th time, and respectively.
This corresponds to steps 506 and 507 in FIG. Also, 65
a to 65c are processes for writing the contents of the temporary addition result storage circuit 8 of FIG. 1 to the full addition result storage circuit 9. In the figure, for example, ARW (k) is the kth temporary addition result storage circuit. Represents the process of writing the contents to the full addition result storage circuit,
This corresponds to step 508 in FIG.

【0028】このように、本実施例においては、図5に
おけるステップ502〜508の処理を、三つの独立し
た処理に分割する。このことにより、図1における行列
乗算装置11の演算速度を高速化することができる。さ
らに、行列を分割して行列の乗算を行なうことにより、
処理の高速化を図ることができ、以下、次の図8、図9
を用いて、その行列乗算装置の構成と動作を説明する。
As described above, in this embodiment, the processing of steps 502 to 508 in FIG. 5 is divided into three independent processings. As a result, the calculation speed of the matrix multiplication device 11 in FIG. 1 can be increased. Furthermore, by dividing the matrix and performing matrix multiplication,
Since the processing speed can be increased, the following FIG. 8 and FIG.
The configuration and operation of the matrix multiplication device will be described using.

【0029】図8は、本発明に係わる行列の分割形態の
一実施例を示す説明図である。本実施例においては、行
列A71を行方向にL分割する。そして、例えば、分割
した行列A71のI番目の行列aI72(図中の斜線部
分)の要素群と、行列B73全体(斜線部分)を処理す
ると、行列A71の他の行列の要素に関係なく、行列C
のI番目の行列cI74(斜線部分)の要素群が求めら
れる。ここで、次の図9に示すように、行列A71のそ
れぞれの行列に対応して、図1で説明した行列演算回路
を複数個設けて、各行列毎に、独立して処理を行なうこ
とができる。
FIG. 8 is an explanatory view showing an embodiment of a matrix division mode according to the present invention. In the present embodiment, the matrix A71 is divided into L in the row direction. Then, for example, when the element group of the I-th matrix aI72 (hatched portion in the drawing) of the divided matrix A71 and the entire matrix B73 (hatched portion) are processed, the matrix is transformed regardless of the elements of other matrices of the matrix A71. C
The element group of the I-th matrix cI74 (hatched portion) of is calculated. Here, as shown in FIG. 9 below, a plurality of matrix operation circuits described in FIG. 1 are provided corresponding to each matrix of the matrix A71, and processing can be performed independently for each matrix. it can.

【0030】図9は、図1における行列乗算装置の本発
明に係わる構成の第2の実施例を示すブロック図であ
る。本実施例においては、複数の行列演算回路81〜8
4で、それぞれ、図8に示す行列A71のa1〜aLま
での各行列と、行列B73との乗算を、並列して行なう
構成となっている。このように、行列Aの分割数(L
個)だけ、行列演算回路81〜84を設け、図8の行列
A71を分割した各行列a1〜aLの要素群と、行列B
全体とを、各行列演算回路81〜84に、並列に処理さ
せることにより、行列の乗算を、さらに高速に行なうこ
とができる。
FIG. 9 is a block diagram showing a second embodiment of the configuration according to the present invention of the matrix multiplication device in FIG. In this embodiment, a plurality of matrix operation circuits 81 to 8 are provided.
4, each of the matrices a1 to aL of the matrix A71 shown in FIG. 8 and the matrix B73 are multiplied in parallel. Thus, the number of divisions of the matrix A (L
), Matrix operation circuits 81 to 84 are provided, and the element group of each matrix a1 to aL obtained by dividing the matrix A71 of FIG.
By causing the matrix operation circuits 81 to 84 to process the whole in parallel, the matrix multiplication can be performed at a higher speed.

【0031】以上、図1〜図9を用いて説明したよう
に、本実施例の行列乗算装置では、行列の乗算におい
て、一方の行列の一つの要素毎に、他方の行列の全ての
乗算要素の乗算を行なう。このことにより、記憶装置に
格納されている行列の要素の読み出し回数を削減するこ
とができる。また、行列乗算装置内部の演算技術に、パ
イプライン処理技術を用いることにより、処理時間を短
縮化できる。また、行列を分割して、並列処理が容易と
なるために、さらに、処理速度を高速化することができ
る。
As described above with reference to FIGS. 1 to 9, in the matrix multiplication apparatus of the present embodiment, in the matrix multiplication, every one element of one matrix has all the multiplication elements of the other matrix. Multiplication of. This makes it possible to reduce the number of times the matrix elements stored in the storage device are read out. Moreover, the processing time can be shortened by using the pipeline processing technique as the arithmetic technique inside the matrix multiplication device. Further, since the matrix is divided to facilitate parallel processing, the processing speed can be further increased.

【0032】尚、本発明は、図1〜図9を用いて説明し
た実施例に限定されるものではない。例えば、図1〜図
6で説明した実施例においては、列単位で行列の乗算と
累積加算を行なっているが、行単位で行なっても良い。
また、行列乗算が全て完了するまで、全ての結果を、全
加算結果格納回路に格納し、まとめて、記憶装置に書き
込む動作で説明したが、例えば、本発明の部分加算結果
格納回路を用いることにより、加算結果が完了した要素
毎に、順次、記録装置への書き込みを行なうものでも良
い。
The present invention is not limited to the embodiment described with reference to FIGS. For example, in the embodiments described with reference to FIGS. 1 to 6, matrix multiplication and cumulative addition are performed in column units, but they may be performed in row units.
Further, the operation of storing all the results in the full addition result storage circuit and collectively writing the results in the storage device until the matrix multiplication is completed is explained. For example, the partial addition result storage circuit of the present invention is used. Thus, the writing to the recording device may be sequentially performed for each element for which the addition result is completed.

【0033】[0033]

【発明の効果】本発明によれば、処理装置と記憶装置間
のデータ転送回数を削減することができ、さらに、パイ
プライン処理技術、及び、並列演算技術を採用すること
により、行列の乗算を高速に処理することが可能とな
る。
According to the present invention, it is possible to reduce the number of times of data transfer between the processing device and the storage device. Furthermore, by adopting the pipeline processing technology and the parallel operation technology, the matrix multiplication can be performed. It becomes possible to process at high speed.

【0034】[0034]

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

【図1】本発明を施した行列乗算装置の本発明に係わる
構成の第1の実施例を示すブロック図である。
FIG. 1 is a block diagram showing a first embodiment of a configuration according to the present invention of a matrix multiplication device according to the present invention.

【図2】図1における行列乗算装置の本発明に係わる行
列の乗算手順の一実施例を示す説明図である。
FIG. 2 is an explanatory diagram showing an embodiment of a matrix multiplication procedure according to the present invention of the matrix multiplication device in FIG.

【図3】図1における行列乗算装置の本発明に係わる行
列の乗算手順の一実施例を示す説明図である。
FIG. 3 is an explanatory diagram showing an embodiment of a matrix multiplication procedure according to the present invention of the matrix multiplication device in FIG.

【図4】図1における行列乗算装置の本発明に係わる行
列の乗算手順の一実施例を示す説明図である。
4 is an explanatory diagram showing an example of a matrix multiplication procedure according to the present invention of the matrix multiplication device in FIG.

【図5】図1における行列乗算装置の本発明に係わる動
作の一実施例を示すフローチャートである。
5 is a flowchart showing an embodiment of the operation of the matrix multiplication device in FIG. 1 according to the present invention.

【図6】図1における行列乗算装置の本発明に係わる動
作の一実施例を示すフローチャートである。
FIG. 6 is a flowchart showing an embodiment of the operation of the matrix multiplication device in FIG. 1 according to the present invention.

【図7】図1における行列乗算装置の本発明に係わるパ
イプライン処理の一実施例を示す説明図である。
7 is an explanatory diagram showing an example of pipeline processing according to the present invention of the matrix multiplication device in FIG. 1. FIG.

【図8】本発明に係わる行列の分割形態の一実施例を示
す説明図である。
FIG. 8 is an explanatory diagram showing an example of a matrix division mode according to the present invention.

【図9】本発明を施した行列乗算装置の本発明に係わる
構成の第2の実施例を示すブロック図である。
FIG. 9 is a block diagram showing a second embodiment of the configuration of the matrix multiplication device according to the present invention according to the present invention.

【図10】行列の乗算の表記形態を示す説明図である。FIG. 10 is an explanatory diagram showing a notation form of matrix multiplication.

【図11】従来のコンピュータによる行列の乗算手順を
示す説明図である。
FIG. 11 is an explanatory diagram showing a matrix multiplication procedure by a conventional computer.

【図12】従来の行列乗算を行なう処理装置の構成を示
すブロック図である。
FIG. 12 is a block diagram showing a configuration of a conventional processing device for performing matrix multiplication.

【図13】図12における処理装置の行列乗算の動作を
示すフローチャートである。
13 is a flowchart showing an operation of matrix multiplication of the processing device in FIG.

【符号の説明】[Explanation of symbols]

1 記憶装置 1a 行列Aの要素 1b 行列Bの要素 1c 行列Cの要素 2 行列B格納回路 3 行列A格納回路 4 乗算回路 5 乗算結果格納回路 6 加算結果格納回路 7 加算回路 8 仮加算格納回路 9 全加算結果格納回路 10 制御回路 11 行列乗算装置 61a〜61c 行列Aの読み出し処理 62a〜62c 行列Aと行列Bの掛け算と書き込み処
理 63a〜63c 累積加算結果の読み出し処理 64a〜64c 乗算結果格納回路の内容と加算結果格
納回路の内容の足し算と書き込み処理 65a〜65c 全加算結果格納回路への書き込み処理 71 行列A 72 行列AのI番目の行列aI 73 行列B 74 行列CのI番目の行列cI 81〜84 行列演算回路 110 記憶装置 111 処理装置 112 行列Aの要素 113 行列Bの要素 114 行列A格納領域 115 行列B格納領域 116 レジスタ群 117 行列Cの要素 118 演算器 119 乗算結果格納領域 120 加算結果格納領域
1 storage device 1a element of matrix A 1b element of matrix B 1c element of matrix C 2 matrix B storage circuit 3 matrix A storage circuit 4 multiplication circuit 5 multiplication result storage circuit 6 addition result storage circuit 7 addition circuit 8 temporary addition storage circuit 9 Full addition result storage circuit 10 Control circuit 11 Matrix multiplication device 61a to 61c Matrix A reading process 62a to 62c Multiplying matrix A and matrix B and writing process 63a to 63c Cumulative addition result reading process 64a to 64c Of multiplication result storage circuit Addition of contents and contents of addition result storage circuit and write processing 65a to 65c Write processing to full addition result storage circuit 71 Matrix A 72 I-th matrix aI 73 of matrix A 73 B 74 I-th matrix of matrix C 81 -84 matrix operation circuit 110 storage device 111 processing device 112 element of matrix A 113 element of matrix B 1 4 matrix A storage area 115 matrix B storage area 116 of the register group 117 matrix C elements 118 calculator 119 multiplies the result storage area 120 addition result storage area

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 記憶装置に格納されている第1および第
2の二つの行列の乗算を行ない、該乗算結果を、上記記
憶装置に書き込む行列乗算装置であり、上記記憶装置か
ら読み出した上記第1の行列の一つの要素毎に、該要素
に対応する上記第2の行列の全ての乗算要素を、上記記
憶装置から順次に読み出し、それぞれの掛け算を行な
い、上記第1の行列の各要素に対応する上記掛け算結果
を累積して加算する行列演算手段を設け、該行列演算手
段の加算結果を、上記記憶装置に書き込むことを特徴と
する行列乗算装置。
1. A matrix multiplication device that multiplies two first and second matrices stored in a storage device and writes the multiplication result into the storage device, wherein the first and second matrices are read from the storage device. For each element of one matrix, all the multiplication elements of the second matrix corresponding to the element are sequentially read from the storage device, and each multiplication is performed to obtain each element of the first matrix. A matrix multiplication device characterized by comprising matrix operation means for accumulating and adding corresponding multiplication results, and writing the addition result of the matrix operation means to the storage device.
【請求項2】 請求項1に記載の行列乗算装置におい
て、上記行列演算手段は、上記記憶装置から上記第1の
行列の一つの要素を読み出す第1の行列読み出し手段
と、該第1の行列読み出し手段で読み出した要素に対応
する上記第2の行列の全ての乗算要素を、上記記憶装置
から順次に読み出す第2の行列読み出し手段と、該第2
の行列読み出し手段で順次に読み出す各乗算要素と、上
記第1の行列読み出し手段で読み出した一つの要素との
掛け算を、順次に行なう乗算手段と、該乗算手段によ
り、上記第1の行列読み出し手段と第2の行列読み出し
手段で順次に読み出す各要素に対応して算出されたそれ
ぞれの掛け算結果を、順次に累積加算する加算手段とを
具備し、該加算手段の加算結果を、上記記憶装置に書き
込むことを特徴とする行列乗算装置。
2. The matrix multiplication device according to claim 1, wherein the matrix calculation means includes first matrix reading means for reading one element of the first matrix from the storage device, and the first matrix. Second matrix reading means for sequentially reading from the storage device all the multiplication elements of the second matrix corresponding to the elements read by the reading means;
Multiplication means for sequentially multiplying each of the multiplication elements sequentially read by the matrix reading means and one element read by the first matrix reading means, and the first matrix reading means by the multiplication means. And an adding means for sequentially accumulatively adding the respective multiplication results calculated corresponding to the respective elements sequentially read by the second matrix reading means, and the addition results of the adding means are stored in the storage device. A matrix multiplication device characterized by writing.
【請求項3】 請求項2に記載の行列乗算装置におい
て、上記第1の行列読み出し手段は、上記第1の行列の
同じ列の要素群から、上記一つの要素を順次に読み出す
ことを特徴とする行列乗算装置。
3. The matrix multiplication device according to claim 2, wherein the first matrix reading means sequentially reads the one element from an element group in the same column of the first matrix. Matrix multiplication device.
【請求項4】 請求項2に記載の行列乗算装置におい
て、上記第1の行列読み出し手段は、上記第1の行列の
同じ行の要素群から、上記一つの要素を順次に読み出す
ことを特徴とする行列乗算装置。
4. The matrix multiplication device according to claim 2, wherein the first matrix reading means sequentially reads the one element from an element group in the same row of the first matrix. Matrix multiplication device.
【請求項5】 請求項2から請求項4のいずれかに記載
の行列乗算装置において、上記第2の行列読み出し手段
は、上記第2の行列の同じ列の要素群から、上記乗算要
素を順次に読み出すことを特徴とする行列乗算装置。
5. The matrix multiplication device according to any one of claims 2 to 4, wherein the second matrix reading means sequentially outputs the multiplication elements from an element group in the same column of the second matrix. A matrix multiplication device characterized in that it is read out to.
【請求項6】 請求項2から請求項4のいずれかに記載
の行列乗算装置において、上記第2の行列読み出し手段
は、上記第2の行列の同じ行の要素群から、上記乗算要
素を順次に読み出すことを特徴とする行列乗算装置。
6. The matrix multiplication device according to any one of claims 2 to 4, wherein the second matrix reading means sequentially outputs the multiplication elements from an element group in the same row of the second matrix. A matrix multiplication device characterized in that it is read out to.
【請求項7】 請求項1から請求項6のいずれかに記載
の行列乗算装置において、上記行列演算手段は、上記加
算結果を格納する部分加算結果格納手段を具備し、該部
分加算結果格納手段に格納した加算結果が、それぞれ対
応する要素間の行列乗算を全て完了した時点で、該加算
結果を、上記記憶装置に順次に書き込むことを特徴とす
る行列乗算装置。
7. The matrix multiplication device according to claim 1, wherein the matrix calculation means comprises a partial addition result storage means for storing the addition result, and the partial addition result storage means. The matrix multiplication device characterized in that when the addition results stored in [3] are all matrix multiplied between corresponding elements, the addition results are sequentially written to the storage device.
【請求項8】 請求項1から請求項6のいずれかに記載
の行列乗算装置において、上記行列演算手段は、全ての
要素間の行列乗算を完了するまで、上記加算結果を格納
する全加算結果格納手段を具備し、全ての要素間の行列
乗算を完了した時点で、該全加算結果格納手段に格納し
た全ての上記加算結果を、まとめて、上記記憶装置に書
き込むことを特徴とする行列乗算装置。
8. The matrix multiplication device according to claim 1, wherein the matrix calculation means stores the addition result until the matrix multiplication between all the elements is completed. Matrix multiplication characterized by comprising storage means and, when the matrix multiplication between all the elements is completed, all the addition results stored in the full addition result storage means are collectively written in the storage device. apparatus.
【請求項9】 請求項1から請求項8のいずれかに記載
の行列乗算装置において、少なくとも、上記行列演算手
段による上記第2の行列の各要素の上記記憶装置からの
読み出しと、上記乗算および加算とを含む動作を、パイ
プライン処理する制御手段を具備することを特徴とする
行列乗算装置。
9. The matrix multiplication device according to claim 1, wherein at least each element of the second matrix is read from the storage device by the matrix calculation means, and the multiplication and A matrix multiplying device comprising a control means for pipeline processing of operations including addition.
【請求項10】 請求項1から請求項9のいずれかに記
載の行列乗算装置において、上記記憶装置に格納されて
いる第1および第2の二つの行列の乗算を、任意に分割
された単位で、それぞれ、並列に行なう複数個の上記行
列演算手段を設けることを特徴とする行列乗算装置。
10. The matrix multiplication device according to claim 1, wherein the multiplication of the first and second matrices stored in the storage device is an arbitrarily divided unit. The matrix multiplying device is characterized in that a plurality of matrix calculating means are provided in parallel.
JP4125767A 1992-05-19 1992-05-19 Matrix multiplication device Pending JPH05324700A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4125767A JPH05324700A (en) 1992-05-19 1992-05-19 Matrix multiplication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4125767A JPH05324700A (en) 1992-05-19 1992-05-19 Matrix multiplication device

Publications (1)

Publication Number Publication Date
JPH05324700A true JPH05324700A (en) 1993-12-07

Family

ID=14918329

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4125767A Pending JPH05324700A (en) 1992-05-19 1992-05-19 Matrix multiplication device

Country Status (1)

Country Link
JP (1) JPH05324700A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009026308A (en) * 2007-07-19 2009-02-05 Itt Manufacturing Enterprises Inc High speed and efficient matrix multiplication hardware module
CN104238993A (en) * 2013-06-11 2014-12-24 亚德诺半导体技术公司 Vector matrix product accelerator for microprocessor integration
JP2015007546A (en) * 2013-06-24 2015-01-15 株式会社堀場製作所 Device for measuring particle size distribution
JP2015007547A (en) * 2013-06-24 2015-01-15 株式会社堀場製作所 Device for measuring particle size distribution
KR20170103949A (en) * 2015-02-06 2017-09-13 후아웨이 테크놀러지 컴퍼니 리미티드 Data processing systems, compute nodes and data processing methods
JP2018036277A (en) * 2017-11-06 2018-03-08 株式会社堀場製作所 Device for measuring particle size distribution
CN112214726A (en) * 2017-07-07 2021-01-12 华为技术有限公司 Operation accelerator
JP2022506418A (en) * 2018-10-31 2022-01-17 アドバンスト・マイクロ・ディバイシズ・インコーポレイテッド Matrix multiplier with submatrix ordering

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009026308A (en) * 2007-07-19 2009-02-05 Itt Manufacturing Enterprises Inc High speed and efficient matrix multiplication hardware module
CN104238993A (en) * 2013-06-11 2014-12-24 亚德诺半导体技术公司 Vector matrix product accelerator for microprocessor integration
CN104238993B (en) * 2013-06-11 2018-05-04 亚德诺半导体集团 The vector matrix product accelerator of microprocessor integrated circuit
JP2015007546A (en) * 2013-06-24 2015-01-15 株式会社堀場製作所 Device for measuring particle size distribution
JP2015007547A (en) * 2013-06-24 2015-01-15 株式会社堀場製作所 Device for measuring particle size distribution
US10408726B2 (en) 2013-06-24 2019-09-10 Horiba, Ltd. Particle size distribution measuring apparatus
JP2018508887A (en) * 2015-02-06 2018-03-29 華為技術有限公司Huawei Technologies Co.,Ltd. Data processing system, calculation node, and data processing method
KR20170103949A (en) * 2015-02-06 2017-09-13 후아웨이 테크놀러지 컴퍼니 리미티드 Data processing systems, compute nodes and data processing methods
US10567494B2 (en) 2015-02-06 2020-02-18 Huawei Technologies Co., Ltd. Data processing system, computing node, and data processing method
CN112214726A (en) * 2017-07-07 2021-01-12 华为技术有限公司 Operation accelerator
CN112214726B (en) * 2017-07-07 2024-05-03 华为技术有限公司 Operation accelerator
JP2018036277A (en) * 2017-11-06 2018-03-08 株式会社堀場製作所 Device for measuring particle size distribution
JP2022506418A (en) * 2018-10-31 2022-01-17 アドバンスト・マイクロ・ディバイシズ・インコーポレイテッド Matrix multiplier with submatrix ordering

Similar Documents

Publication Publication Date Title
EP0240032A2 (en) Vector processor with vector data compression/expansion capability
JPH0312739B2 (en)
CN110826719A (en) Quantum program processing method and device, storage medium and electronic device
JPH05324700A (en) Matrix multiplication device
CN115328439A (en) Incremental matrix multiplication accelerator applied to HPC/AI
US5422836A (en) Circuit arrangement for calculating matrix operations in signal processing
JPH0792790B2 (en) Vector parallel computer
KR102653014B1 (en) Methods for data placement for in-memory-compute and memory module to which the method is applied
JPH06274528A (en) Vector operation processor
JP7251354B2 (en) Information processing device, information processing program, and information processing method
JPH0154746B2 (en)
US5928350A (en) Wide memory architecture vector processor using nxP bits wide memory bus for transferring P n-bit vector operands in one cycle
JPS6150359B2 (en)
US11249724B1 (en) Processing-memory architectures performing atomic read-modify-write operations in deep learning systems
JPH07239843A (en) Parallel arithmetic processors
US20230161557A1 (en) Compute-in-memory devices and methods of operating the same
JP2643110B2 (en) A fast method for solving simultaneous linear equations using an auxiliary storage device
US20230177106A1 (en) Computational circuit with hierarchical accumulator
JP3198977B2 (en) Arithmetic device, arithmetic method, and recording medium storing program for executing the same
CN116339680A (en) Real-time multiport parallel read-write near-memory processor
Nakano et al. Optimal Triangulation on the High Bandwidth Memory Model
JP3296489B2 (en) Operation method in associative memory device
JP2549838B2 (en) Data control device
CN115809024A (en) Winograd-based storage method of accelerator for correlation algorithm
JP2895892B2 (en) Data processing device