TWI828138B - Matrix multiplication circuit module and martrix mulitplication method - Google Patents

Matrix multiplication circuit module and martrix mulitplication method Download PDF

Info

Publication number
TWI828138B
TWI828138B TW111116755A TW111116755A TWI828138B TW I828138 B TWI828138 B TW I828138B TW 111116755 A TW111116755 A TW 111116755A TW 111116755 A TW111116755 A TW 111116755A TW I828138 B TWI828138 B TW I828138B
Authority
TW
Taiwan
Prior art keywords
row
matrix
electrical signal
unit
multiplication
Prior art date
Application number
TW111116755A
Other languages
Chinese (zh)
Other versions
TW202345018A (en
Inventor
闖 張
盧山
俊謀 張
陳一敏
王劍
成園林
Original Assignee
英屬開曼群島商臉萌有限公司
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 英屬開曼群島商臉萌有限公司 filed Critical 英屬開曼群島商臉萌有限公司
Priority to TW111116755A priority Critical patent/TWI828138B/en
Publication of TW202345018A publication Critical patent/TW202345018A/en
Application granted granted Critical
Publication of TWI828138B publication Critical patent/TWI828138B/en

Links

Images

Landscapes

  • Logic Circuits (AREA)
  • Tea And Coffee (AREA)

Abstract

A matrix multiplication circuit module and a matrix multiplication method are provided by the embodiments of the present disclosure. The circuit module includes one or more row-column calculation units for realizing row-column multiplication calculation. Each of the row-column calculation units comprises one or more multiplying units and an adding unit. Each of the one or more multiplying unit has an output end connected to an input end of the adding unit. Each of the multiplying units comprises an electrical signal regulating subunit and a load. The electrical signal regulating subunit is configured to regulate a magnitude of an input electrical signal. A multiplication operation is performed by the electrical signal regulating subunit and the load in response to an electrical signal inputted to the multiplying unit. The load has a fixed load value. By using a load with a fixed load value, regulating the duty cycle of the electrical signal to regulate the magnitude of the electrical signal, and applying the regulated electric signal to the load, the effect of multiplying the matrix elements can be realized, which is convenient to adapt to the change of the matrix elements. The structure of the circuit module for realizing matrix multiplication is simplified, and the complexity of the circuit module is reduced.

Description

一種矩陣乘法電路模組及方法A matrix multiplication circuit module and method

本發明涉及神經網路技術領域,尤其涉及一種使用硬體來實現矩陣乘法的矩陣乘法電路模組及方法。The present invention relates to the field of neural network technology, and in particular, to a matrix multiplication circuit module and method that uses hardware to implement matrix multiplication.

隨著技術發展,需要大量的計算操作。上述計算中會包括矩陣乘法。As technology develops, a large number of computing operations are required. The above calculations will include matrix multiplication.

上述矩陣乘法可以使用軟體程序實現。為了提高計算速度,可以使用硬體來實現矩陣乘法。The above matrix multiplication can be implemented using software programs. To increase calculation speed, matrix multiplication can be implemented in hardware.

提供該發明內容部分以便以簡要的形式介紹構思,這些構思將在後面的具體實施方式部分被詳細描述。該發明內容部分並不旨在標識要求保護的技術方案的關鍵特徵或必要特徵,也不旨在用於限制所要求的保護的技術方案的範圍。This Summary is provided to introduce in a simplified form concepts that are further described in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to be used to limit the scope of the claimed technical solution.

本發明實施例提供了一種矩陣乘法電路模組、矩陣實現方法。Embodiments of the present invention provide a matrix multiplication circuit module and a matrix implementation method.

第一方面,本發明實施例提供了一種矩陣乘法電路模組,包括:至少一個實現行列乘法計算的行列計算單元;所述行列計算單元包括至少一個乘法單元和加法單元;所述至少一個乘法單元的輸出端與所述加法單元的輸入端連接;所述乘法單元包括電訊號調節子單元和負載,其中所述電訊號調節子單元用於調節輸入電訊號的大小;其中由所述電訊號調節子單元與所述負載對輸入到所述乘法單元的電訊號進行響應,以實現乘法操作;其中上述負載的負載值固定。In a first aspect, an embodiment of the present invention provides a matrix multiplication circuit module, including: at least one row-row calculation unit that implements row-row multiplication calculation; the row-row calculation unit includes at least one multiplication unit and an addition unit; the at least one multiplication unit The output end is connected to the input end of the adder unit; the multiplication unit includes an electrical signal conditioning subunit and a load, wherein the electrical signal conditioning subunit is used to adjust the size of the input electrical signal; wherein the electrical signal is adjusted The subunit and the load respond to the electrical signal input to the multiplication unit to implement the multiplication operation; wherein the load value of the load is fixed.

第二方面,本發明實施例提供了一種矩陣乘法實現方法,應用於第一方面的電路模組,包括:獲取第一矩陣的一列的列矩陣元素,以及第二矩陣中與該列對應行的行矩陣元素,其中所述列矩陣元素由電訊號表示;將所述列矩陣元素對應的電訊號輸入到行列計算單元,利用電訊號調節子單元基於行矩陣元素的大小,對所述電訊號進行調節,其中,所述行列計算單元包括至少一個乘法單元和加法單元,所述乘法單元包括電訊號調節子單元和負載;將各乘法單元的響應訊號的累加和作為該行列計算單元對應的計算結果,其中,所述乘法單元的響應訊號基於經該乘法單元的所述電訊號調節子單元調節後的電訊號作用到該乘法單元的負載得到。In a second aspect, embodiments of the present invention provide a matrix multiplication implementation method, which is applied to the circuit module of the first aspect, including: obtaining a column matrix element of a column of the first matrix, and obtaining a column matrix element of a row corresponding to the column in the second matrix. Row matrix elements, wherein the column matrix elements are represented by electrical signals; the electrical signals corresponding to the column matrix elements are input to the row and column calculation unit, and the electrical signal is processed based on the size of the row matrix element by the electrical signal adjustment subunit. Adjustment, wherein the row and column calculation unit includes at least one multiplication unit and an addition unit, and the multiplication unit includes an electrical signal conditioning subunit and a load; the accumulated sum of the response signals of each multiplication unit is used as the corresponding calculation result of the row and column calculation unit , wherein the response signal of the multiplication unit is obtained based on the electrical signal adjusted by the electrical signal conditioning sub-unit of the multiplication unit acting on the load of the multiplication unit.

第三方面,本發明實施例提供了一種積體電路,該積體電路包括第一方面所述的矩陣乘法電路模組。In a third aspect, an embodiment of the present invention provides an integrated circuit, which includes the matrix multiplication circuit module described in the first aspect.

本發明實施例提供的矩陣乘法電路模組、矩陣乘法實現方法,藉由使用負載值固定的負載,由乘法單元的電訊號調節子單元對電訊號進行調節,由調節比例與負載共同實現行矩陣元素,將調節後的電訊號作用到負載上,實現用於表示列矩陣元素的電訊號與對應的行矩陣元素相乘的效果,上述方法便於與行矩陣元素的變化相適應。簡化了實現矩陣乘法的電路模組的結構,降低了電路模組的複雜度。The matrix multiplication circuit module and matrix multiplication implementation method provided by the embodiments of the present invention use a load with a fixed load value, and the electrical signal conditioning sub-unit of the multiplication unit regulates the electrical signal, and the row matrix is realized by the adjustment ratio and the load. Element, the adjusted electrical signal is applied to the load to achieve the effect of multiplying the electrical signal used to represent the column matrix element and the corresponding row matrix element. The above method is convenient for adapting to changes in the row matrix element. The structure of the circuit module that implements matrix multiplication is simplified and the complexity of the circuit module is reduced.

下面將參照附圖更詳細地描述本發明的實施例。雖然附圖中顯示了本發明的某些實施例,然而應當理解的是,本發明可以藉由各種形式來實現,而且不應該被解釋為限於這裏闡述的實施例,相反提供這些實施例是為了更加透徹和完整地理解本發明。應當理解的是,本發明的附圖及實施例僅用於示例性作用,並非用於限制本發明的保護範圍。Embodiments of the invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for A more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of the present invention.

應當理解,本發明的方法實施方式中記載的各個步驟可以按照不同的順序執行,和/或並行執行。此外,方法實施方式可以包括附加的步驟和/或省略執行示出的步驟。本發明的範圍在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present invention can be executed in different orders and/or in parallel. Furthermore, method embodiments may include additional steps and/or omit performance of illustrated steps. The scope of the invention is not limited in this respect.

本文使用的術語「包括」及其變形是開放性包括,即「包括但不限於」。術語「基於」是「至少部分地基於」。術語「一個實施例」表示「至少一個實施例」;術語「另一實施例」表示「至少一個另外的實施例」;術語「一些實施例」表示「至少一些實施例」。其他術語的相關定義將在下文描述中給出。As used herein, the term "include" and its variations are open-ended, meaning "including but not limited to." The term "based on" means "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; and the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below.

需要注意,本發明中提及的「第一」、「第二」等概念僅用於對不同的裝置、模組或單元進行區分,並非用於限定這些裝置、模組或單元所執行的功能的順序或者相互依存關係。It should be noted that concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the functions performed by these devices, modules or units. sequence or interdependence.

需要注意,本發明中提及的「一個」、「多個」的修飾是示意性而非限制性的,本領域技術人員應當理解,除非在上下文另有明確指出,否則應該理解為「一個或多個」。It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative and not restrictive. Those skilled in the art will understand that unless the context clearly indicates otherwise, it should be understood as "one or Multiple".

本發明實施方式中的多個裝置之間所交互的消息或者資訊的名稱僅用於說明性的目的,而並不是用於對這些消息或資訊的範圍進行限制。The names of messages or information exchanged between multiple devices in the embodiment of the present invention are only for illustrative purposes and are not used to limit the scope of these messages or information.

請參考圖1,其示出了根據本發明的矩陣乘法電路模組的一些實施例的結構示意圖。如圖1所示,該矩陣乘法電路模組,包括: 至少一個實現行列乘法計算的行列計算單元11。行列計算單元11包括至少一個乘法單元110和加法單元111。如圖1所示,乘法單元110包括電訊號調節子單元1101和負載1102。電訊號調節子單元1101用於調節輸入電訊號的大小。由所述電訊號調節子單元1101與所述負載1102對輸入到乘法單元110的電訊號進行響應,以實現乘法操作。 Please refer to FIG. 1 , which shows a schematic structural diagram of some embodiments of a matrix multiplication circuit module according to the present invention. As shown in Figure 1, the matrix multiplication circuit module includes: At least one row and column calculation unit 11 that implements row and column multiplication calculations. The row and column calculation unit 11 includes at least one multiplication unit 110 and an addition unit 111. As shown in FIG. 1 , the multiplication unit 110 includes an electrical signal conditioning subunit 1101 and a load 1102 . The electrical signal adjustment subunit 1101 is used to adjust the size of the input electrical signal. The electrical signal conditioning subunit 1101 and the load 1102 respond to the electrical signal input to the multiplication unit 110 to implement a multiplication operation.

至少一個乘法單元110的輸出端與加法單元111的輸入端連接。The output of at least one multiplication unit 110 is connected to the input of the addition unit 111 .

上述負載1102的負載值固定。也即負載1102負載值的大小不可調整。The load value of the load 1102 is fixed. That is, the load value of load 1102 cannot be adjusted.

在本實施例中,輸入至一個行列計算單元中的行列計算單元11的電訊號可以不相同。In this embodiment, the electrical signals input to the row and column calculation units 11 in one row and column calculation unit may be different.

在一些應用場景中,上述矩陣乘法實現的是神經網路中神經元輸出的特徵值矩陣與權重矩陣的乘法,上述電訊號可以表示神經元輸出的特徵值矩陣中矩陣元素。同一個行列計算單元中的不同電訊號可以表示特徵值矩陣中的不同矩陣元素。上述特徵值矩陣可以表示為電訊號矩陣。In some application scenarios, the above matrix multiplication realizes the multiplication of the eigenvalue matrix and the weight matrix output by the neurons in the neural network. The above electrical signal can represent the matrix elements in the eigenvalue matrix output by the neurons. Different electrical signals in the same row and column calculation unit can represent different matrix elements in the eigenvalue matrix. The above eigenvalue matrix can be expressed as an electrical signal matrix.

上述電訊號調節單元可以對電訊號的大小進行調節。以電壓訊號為例,上述電訊號調節單元可以調節輸入到行列計算單元的電壓訊號的大小。The above electrical signal adjustment unit can adjust the size of the electrical signal. Taking the voltage signal as an example, the above-mentioned electrical signal adjustment unit can adjust the size of the voltage signal input to the row and column calculation unit.

在一些可選的實現方式中,上述電訊號為電壓訊號,也可以為電流訊號。本發明以電訊號為電壓訊號為例進行說明。上述電訊號調節單元可以包括電壓訊號占空比調節單元。In some optional implementations, the electrical signal is a voltage signal or a current signal. The present invention is explained by taking the electrical signal as a voltage signal as an example. The above electrical signal adjustment unit may include a voltage signal duty cycle adjustment unit.

在這些可選的實現方式中,上述電訊號可以為脈衝訊號。上述脈衝訊號的周期可為T。藉由在周期T內調節脈衝訊號中的有效工作準位(例如高準位)的時長,來調脈衝訊號的占空比。在本實例中,可以藉由調節脈衝訊號的占空比,來實現對電壓訊號大小的調整。In these optional implementations, the electrical signal may be a pulse signal. The period of the above pulse signal may be T. By adjusting the duration of the effective operating level (such as the high level) in the pulse signal within the period T, the duty cycle of the pulse signal is adjusted. In this example, the size of the voltage signal can be adjusted by adjusting the duty cycle of the pulse signal.

本發明中,使用電訊號調節子單元與負載共同實現上述矩陣乘法中的權重。在保持負載的參數不變,而由電訊號調節子單元根據權重的變化來對電訊號的占空比進行調節。將調節後的電訊號作用到負載上,得到的響應訊號,與根據權重對負載的負載值進行調整後得到的響應訊號達到的效果相同。也即,根據權重對電訊號的占空比進行調整,藉由將占空比調節後的電訊號作用到上述負載中,從而達到權重的變化的效果。In the present invention, the electrical signal conditioning subunit and the load are used to jointly implement the weights in the above matrix multiplication. While keeping the parameters of the load unchanged, the electrical signal adjustment subunit adjusts the duty cycle of the electrical signal according to the change in weight. The response signal obtained by applying the adjusted electrical signal to the load has the same effect as the response signal obtained by adjusting the load value of the load according to the weight. That is, the duty cycle of the electrical signal is adjusted according to the weight, and the effect of changing the weight is achieved by applying the electrical signal with the adjusted duty cycle to the load.

相關技術中,為了實現將神經元輸出的特徵矩陣與權重矩陣的乘法,使用負載值可調的負載(例如電阻)來實現權重矩陣中的權重。對於不同的權重大小,將負載調整至相應的負載值。對於每一個行列計算單元,為了對該行列計算單元的負載的負載值進行調整,需要設置多個負載值固定的負載,將這些負載按照預設連接方式進行連接,然後再使用用於控制負載的負載值的邏輯電路、開關電路等。在這種藉由調節負載值來實現不同權重的電路實現中,結構比較複雜。In the related art, in order to realize the multiplication of the feature matrix output by the neuron and the weight matrix, a load with an adjustable load value (such as a resistor) is used to realize the weights in the weight matrix. For different weight sizes, adjust the load to the corresponding load value. For each row and column calculation unit, in order to adjust the load value of the load of the row and row calculation unit, it is necessary to set up multiple loads with fixed load values, connect these loads according to the preset connection method, and then use the method used to control the load. Load value logic circuits, switching circuits, etc. In this kind of circuit implementation that realizes different weights by adjusting the load value, the structure is relatively complicated.

本實施例提供的矩陣乘法電路模組,使用負載值固定的負載,根據權重矩陣的中的矩陣元素(權重)調節電訊號的占空比的方式來調節電訊號的大小,將大小被調節的電訊號作用到負載上,可以實現對應的權重與電訊號相乘的效果,上述方法便於與權重的變化相適應。簡化了實現矩陣乘法的電路模組的結構,降低了實現矩陣乘法的矩陣乘法電路模組的複雜度。The matrix multiplication circuit module provided in this embodiment uses a load with a fixed load value to adjust the size of the electrical signal by adjusting the duty cycle of the electrical signal according to the matrix elements (weights) in the weight matrix, and the adjusted size When the electrical signal is applied to the load, the corresponding weight can be multiplied by the electrical signal. The above method is easy to adapt to changes in the weight. The structure of the circuit module that implements matrix multiplication is simplified, and the complexity of the matrix multiplication circuit module that implements matrix multiplication is reduced.

作為一種實現方式,可以藉由脈寬調變技術(pulse width modulation ,PWM)來調節電壓訊號的占空比。As an implementation method, pulse width modulation (PWM) technology can be used to adjust the duty cycle of the voltage signal.

上述脈寬調變技術可以使用基於鎖相環的相位插入器(PLL based phase interposer)來生成控制訊號。將控制訊號作用到開關電路中,由上述控制訊號控制開關電路的導通或斷開,以實現對電訊號的占空比的調節。The above pulse width modulation technology can use a phase locked loop based phase interposer (PLL based phase interposer) to generate control signals. The control signal is applied to the switch circuit, and the control signal controls the on or off of the switch circuit to adjust the duty cycle of the electrical signal.

可選地,請參考圖2,圖2示出了圖1所示的矩陣乘法電路模組中的電訊號調節子單元的一種結構示意圖。如圖2所示,電訊號調節子單元1101(電壓訊號占空比調節單元)包括控制訊號發生電路1103和開關電路1104。控制訊號發生電路1103可以包括基於鎖相環的相位插入器。上述開關電路1104可以包括各種開關裝置。開關裝置包括實現開關功能的三極電晶體、場效應電晶體、閘極絕緣雙極型電晶體等。所述控制訊號發生電路生成的控制訊號藉由控制所述開關電路的導通或斷開,控制電壓訊號的占空比。Optionally, please refer to FIG. 2 , which shows a schematic structural diagram of the electrical signal conditioning subunit in the matrix multiplication circuit module shown in FIG. 1 . As shown in Figure 2, the electrical signal adjustment subunit 1101 (voltage signal duty cycle adjustment unit) includes a control signal generation circuit 1103 and a switch circuit 1104. The control signal generation circuit 1103 may include a phase interpolator based on a phase locked loop. The above-mentioned switching circuit 1104 may include various switching devices. Switching devices include three-pole transistors, field-effect transistors, gate-insulated bipolar transistors, etc. that implement switching functions. The control signal generated by the control signal generating circuit controls the duty cycle of the voltage signal by controlling the on or off of the switch circuit.

上述控制訊號發生電路可以根據權重矩陣中一個矩陣元素的值的變化,來調節控制訊號的有效工作訊號的在控制訊號的周期T1內中的有效工作訊號的時長。這裏的有效工作訊號可以使得開關裝置導通,在開關裝置導通裝置,電訊號作用在負載上。在周期T1內的非有效工作訊號持續時間內,上述開關裝置斷開,電訊號無法作用在上述負載中。例如,在控制訊號處於高準位時,開關電路導通;在控制訊號處於低準位時,開關電路斷開。上述開關電路的導通的時長與上述控制訊號的占空比正相關。藉由這種方式來調整施加在負載上的電訊號的占空比,從而調節電訊號的大小。The above control signal generating circuit can adjust the duration of the effective operating signal of the control signal within the period T1 of the control signal according to the change in the value of a matrix element in the weight matrix. The effective working signal here can make the switching device conductive. When the switching device conducts the device, the electrical signal acts on the load. During the duration of the inactive working signal in period T1, the above-mentioned switching device is turned off, and the electrical signal cannot act on the above-mentioned load. For example, when the control signal is at a high level, the switch circuit is turned on; when the control signal is at a low level, the switch circuit is turned off. The conduction time of the above-mentioned switch circuit is positively related to the duty cycle of the above-mentioned control signal. In this way, the duty cycle of the electrical signal applied to the load is adjusted, thereby adjusting the size of the electrical signal.

作為示意性說明,以電訊號的幅值為12V為例,占空比為1時,作用在上述負載上的電訊號為12V。可以藉由上述控制訊號使得作用在負載上的電訊號的占空比為1/2,實現作用在上述負載的上的電訊號為6V。As a schematic illustration, taking the amplitude of the electrical signal as 12V as an example, when the duty cycle is 1, the electrical signal acting on the load is 12V. The above control signal can be used to make the duty cycle of the electrical signal acting on the load be 1/2, so that the electrical signal acting on the above load is 6V.

進一步地,可以使用同一控制訊號發生電路1103(例如基於鎖相環的相位插入器)來生成與多個行列計算單元對應的控制訊號Cin。由同一基於鎖相環的相位插入器生成的多個控制訊號可以藉由多路選擇器分別輸入到對應的行列計算單元。行列計算單元中的上述開關電路的輸入端輸入由上述多路選擇器輸出的電訊號,開關電路的輸出端與負載連接。上述電訊號調節子單元藉由上述多路選擇器輸出預設占空比的控制訊號Cin之後,上述開關電路在上述脈衝訊號的作用下導通或者斷開。Furthermore, the same control signal generating circuit 1103 (for example, a phase interpolator based on a phase locked loop) can be used to generate control signals Cin corresponding to multiple row and column calculation units. Multiple control signals generated by the same phase interpolator based on phase locked loop can be respectively input to corresponding row and column calculation units through multiplexers. The input end of the switch circuit in the row and column calculation unit inputs the electrical signal output by the multiplexer, and the output end of the switch circuit is connected to the load. After the electrical signal conditioning subunit outputs the control signal Cin of the preset duty cycle through the multiplexer, the switch circuit is turned on or off under the action of the pulse signal.

使用同一控制訊號發生電路1103生成與多個行列計算單元對應的控制訊號Cin,可以進一步簡化實現矩陣乘法的電路模組的結構。Using the same control signal generating circuit 1103 to generate control signals Cin corresponding to multiple row and column calculation units can further simplify the structure of the circuit module that implements matrix multiplication.

在一些可選的實現方式中,同一行列計算單元11包括的至少一個乘法單元110使用相同參數的負載1102。各乘法單元使用相同參數的負載,意味著各乘法單元所使用的負載的參數值相同。以負載為電阻為例,各行列計算單元所使用的電阻的電阻值(或電導值)相同。In some optional implementations, at least one multiplication unit 110 included in the same row and column calculation unit 11 uses the load 1102 of the same parameters. Each multiplication unit uses a load with the same parameters, which means that the load used by each multiplication unit has the same parameter value. Taking the load as a resistor as an example, the resistance values (or conductance values) of the resistors used by each row and row calculation unit are the same.

在這些可選的實現方式中,行列計算單元的各乘法單元可以使用參數相同的負載1102。行列計算單元的各乘法單元對應的權重可以由各乘法單元的電訊號調節子單元與負載共同實現。In these alternative implementations, each multiplication unit of the row and column calculation unit may use the load 1102 with the same parameters. The weight corresponding to each multiplication unit of the row and column calculation unit can be realized by the electrical signal conditioning subunit of each multiplication unit and the load.

在這些可選的實現方式中,由於在同一行列計算單元中使用相同的負載,相對於在行列計算單元單路中製作不同的負載的方式,可以簡化負載製作的工藝,從而降低實現矩陣乘法的電路模組的製作工藝的複雜度,簡化實現矩陣乘法的電路的結構。In these optional implementations, since the same load is used in the same row and column computing unit, the process of making the load can be simplified compared to the method of making different loads in a single channel of the row and column computing unit, thereby reducing the time required to implement matrix multiplication. The complexity of the manufacturing process of the circuit module simplifies the structure of the circuit that implements matrix multiplication.

進一步可選地,對於至少一個實現行列乘法計算的行列計算單元,各行列計算單元分別對應的乘法單元可以使用參數相同的負載。各行列計算單元使用相同參數的負載,意味著各行列計算單元所使用的負載的負載值相同。以負載為電阻為例,各行列計算單元所使用的電阻的電阻值(或電導值)相同。可以進一步簡化負載製作的工藝,從而進一步降低實現矩陣乘法的電路模組的製作工藝的複雜度,Further optionally, for at least one row-row calculation unit that implements row-row multiplication calculation, the multiplication units corresponding to each row-row calculation unit may use the same load with the same parameters. Each row and row calculation unit uses the load with the same parameters, which means that the load used by each row and row calculation unit has the same load value. Taking the load as a resistor as an example, the resistance values (or conductance values) of the resistors used by each row and row calculation unit are the same. The load manufacturing process can be further simplified, thereby further reducing the complexity of the manufacturing process of the circuit module that implements matrix multiplication,

在一些應用場景中,請參考圖3,其示出了行列計算單元的一種實現方式的電路結構圖。如圖3所示,該行列計算單元中的負載為電阻。電訊號為電壓訊號。各乘法單元中的電阻值相等,均為R。In some application scenarios, please refer to Figure 3, which shows a circuit structure diagram of an implementation of the row and column calculation unit. As shown in Figure 3, the load in the row and column calculation unit is a resistor. Electrical signals are voltage signals. The resistance values in each multiplication unit are equal and are all R.

圖3所示的行列計算單元,電訊號矩陣的中的1列中包括2個矩陣元素Vin1和Vin2。權重矩陣中的1行中包括2個矩陣元素D11×(1/R)、D21×(1/R)。這裏的D11為由電訊號調節子單元1101調節出的電壓訊號Vin1的占空比實現的電壓訊號大小調節比例。這裏的D12為由電訊號調節子單元1101’調節後的電壓訊號Vin2的占空比實現的電壓訊號大小調節比例。 對於輸入訊號Vin1,經過乘法單元110後,由電阻1102(R)對輸入的Vin1進行響應,電阻1102輸出的響應訊號為電流訊號I1: (1); 對於輸入訊號Vin2,經過乘法單元110’後,由電阻1102’(R)對輸入的Vin2進行響應,電阻1102’輸出的響應訊號為電流訊號I2: (2); In the row-column calculation unit shown in Figure 3, one column of the electrical signal matrix includes two matrix elements Vin1 and Vin2. One row in the weight matrix includes two matrix elements D11×(1/R) and D21×(1/R). D11 here is the voltage signal size adjustment ratio achieved by the duty cycle of the voltage signal Vin1 adjusted by the electrical signal adjustment subunit 1101. D12 here is the voltage signal size adjustment ratio achieved by the duty cycle of the voltage signal Vin2 adjusted by the electrical signal adjustment subunit 1101'. For the input signal Vin1, after passing through the multiplication unit 110, the resistor 1102 (R) responds to the input Vin1, and the response signal output by the resistor 1102 is the current signal I1: (1); For the input signal Vin2, after passing through the multiplication unit 110', the resistor 1102' (R) responds to the input Vin2, and the response signal output by the resistor 1102' is the current signal I2: (2);

上述加法單元111藉由將乘法單元110和乘法單元110’並聯來實現。 乘法單元110和乘法單元110’並聯,上述行列計算單元的輸出out為上述電流訊號I1和電流訊號I2 的累加和。也即: (3); The above addition unit 111 is implemented by connecting the multiplication unit 110 and the multiplication unit 110' in parallel. The multiplication unit 110 and the multiplication unit 110' are connected in parallel, and the output out of the row-column calculation unit is the accumulated sum of the current signal I1 and the current signal I2. That is: (3);

圖3所示的行列計算單元,藉由固定負載的負載值,藉由電訊號調節子單元來調節輸入電壓訊號的占空比,根據權重的變化來對作用在負載上的電訊號的大小進行調節。藉由多個行列計算單元可以實現矩陣的乘法運算。由上述行列計算單元組成的實現矩陣乘法的電路模組的結構複雜度較低。The row and column calculation unit shown in Figure 3 fixes the load value of the load, adjusts the duty cycle of the input voltage signal through the electrical signal adjustment subunit, and adjusts the size of the electrical signal acting on the load according to the change in weight. Adjust. Matrix multiplication operations can be implemented through multiple row and column calculation units. The circuit module that implements matrix multiplication composed of the above row and column calculation units has a low structural complexity.

請參考圖4,其示出了行列計算單元的另一種實現方式的電路結構圖。如圖4所示,該行列計算單元中的負載為電容。電訊號為電壓訊號。各乘法單元的電容值相等,均為C。Please refer to Figure 4, which shows a circuit structure diagram of another implementation manner of the row and column calculation unit. As shown in Figure 4, the load in the row and column calculation unit is a capacitor. Electrical signals are voltage signals. The capacitance values of each multiplication unit are equal, both are C.

上述電訊號矩陣的中的1列中包括2個矩陣元素Vin1和Vin2。上述權重矩陣中的1行中包括2個矩陣元素D11×C、D21×C。這裏的D11由電訊號調節子單元1101調節出的電壓訊號Vin1的占空比實現的電壓訊號大小調節比例。這裏的D12由電訊號調節子單元1101’調節後的電壓訊號Vin2的占空比實現的電壓訊號大小調節比例。 對於輸入訊號Vin1,經過乘法單元110後,由電容1102(C)對輸入的Vin1進行響應,電容1102輸出的響應訊號為電荷訊號Q1: (4); 對於輸入訊號Vin2,經過乘法單元110’後,由電容1102’(R)對輸入的Vin2進行響應,電阻1102’輸出的響應訊號為電荷訊號Q2: (5); One column of the above electrical signal matrix includes two matrix elements Vin1 and Vin2. One row in the above weight matrix includes two matrix elements D11×C and D21×C. D11 here is the voltage signal size adjustment ratio achieved by the duty cycle of the voltage signal Vin1 adjusted by the electrical signal adjustment subunit 1101. D12 here is the voltage signal size adjustment ratio achieved by the duty cycle of the voltage signal Vin2 adjusted by the electrical signal adjustment sub-unit 1101'. For the input signal Vin1, after passing through the multiplication unit 110, the capacitor 1102 (C) responds to the input Vin1, and the response signal output by the capacitor 1102 is the charge signal Q1: (4); For the input signal Vin2, after passing through the multiplication unit 110', the capacitor 1102' (R) responds to the input Vin2, and the response signal output by the resistor 1102' is the charge signal Q2: (5);

上述加法單元111藉由將乘法單元110和乘法單元110’並聯來實現。乘法單元110和乘法單元110’並聯,上述行列計算單元的輸出out為上述電荷訊號Q1和電荷訊號Q2 的累加和。也即: (6); The above addition unit 111 is implemented by connecting the multiplication unit 110 and the multiplication unit 110' in parallel. The multiplication unit 110 and the multiplication unit 110' are connected in parallel, and the output out of the row-column calculation unit is the accumulated sum of the charge signal Q1 and the charge signal Q2. That is: (6);

圖4所示的行列計算單元,藉由固定負載的負載值,藉由電訊號調節子單元來調節輸入電壓訊號的占空比,根據權重的變化來對作用在負載上的電訊號的大小進行調節。藉由多個行列計算單元可以實現矩陣的乘法運算。由上述行列計算單元組成的矩陣乘法模組的結構複雜度較低。The row and column calculation unit shown in Figure 4 fixes the load value of the load, adjusts the duty cycle of the input voltage signal through the electrical signal adjustment subunit, and adjusts the size of the electrical signal acting on the load according to the change in weight. Adjust. Matrix multiplication operations can be implemented through multiple row and column calculation units. The matrix multiplication module composed of the above row and column calculation units has a low structural complexity.

本發明實施例還提供了一種積體電路。該積體電路包括圖1~圖4所示實施例的矩陣乘法電路模組。該積體電路可以是實現各種功能的積體電路。An embodiment of the present invention also provides an integrated circuit. The integrated circuit includes the matrix multiplication circuit module of the embodiment shown in FIGS. 1 to 4 . The integrated circuit may be an integrated circuit that implements various functions.

下面參考圖5,其示出了根據本發明的矩陣乘法實現方法的一些實施例的流程示意圖。該矩陣乘法實現方法用於圖1所示的矩陣乘法電路模組。Referring now to FIG. 5 , a schematic flowchart of some embodiments of a matrix multiplication implementation method according to the present invention is shown. This matrix multiplication implementation method is used in the matrix multiplication circuit module shown in Figure 1.

如圖5所示,矩陣乘法實現方法包括如下步驟: 步驟501,獲取第一矩陣的一列的列矩陣元素,以及第二矩陣中與該列對應行的行矩陣元素,其中所述列矩陣元素由電訊號表示。 As shown in Figure 5, the matrix multiplication implementation method includes the following steps: Step 501: Obtain the column matrix element of a column of the first matrix and the row matrix element of the row corresponding to the column in the second matrix, where the column matrix element is represented by an electrical signal.

矩陣乘法包括第一矩陣的各列矩陣元素與第二矩陣的對應的行矩陣元素分別進行行列乘法計算。本實施例以實現一行列相乘為例,來說明矩陣乘法的實現。Matrix multiplication includes performing row and column multiplication calculations on each column matrix element of the first matrix and the corresponding row matrix element of the second matrix. This embodiment takes the implementation of a row-row multiplication as an example to illustrate the implementation of matrix multiplication.

這裏的第一矩陣可以包括n×m個矩陣元素。也即包括n列、m行矩陣元素。n,m分別為大於等於1的整數。The first matrix here may include n×m matrix elements. That is, it includes n columns and m rows of matrix elements. n and m are integers greater than or equal to 1 respectively.

第二矩陣可以包括m×p個矩陣元素,也即包括m列、p行矩陣元素。m,p分別為大於等於1的整數。The second matrix may include m×p matrix elements, that is, include m columns and p rows of matrix elements. m and p are integers greater than or equal to 1 respectively.

第一矩陣中的矩陣元素可以表示為電訊號。也即,上述電訊號的大小可以用於表示矩陣元素的大小。這裏的電訊號可以包括電壓訊號或電流訊號。本發明以電訊號為電壓訊號為例進行說明。The matrix elements in the first matrix can be represented as electrical signals. That is, the size of the above electrical signal can be used to represent the size of the matrix element. The electrical signal here may include a voltage signal or a current signal. The present invention is explained by taking the electrical signal as a voltage signal as an example.

在一些應用場景中,上述第一矩陣為神經網路的神經元輸出的特徵矩陣。在這些應用場景中,第一矩陣中的一個矩陣元素,可以視為神經元輸出的特徵值。上述第二矩陣可以為權重矩陣。上述權重矩陣中的權重與特徵值一一對應。In some application scenarios, the above-mentioned first matrix is a feature matrix output by neurons of the neural network. In these application scenarios, a matrix element in the first matrix can be regarded as the eigenvalue of the neuron output. The above-mentioned second matrix may be a weight matrix. The weights in the above weight matrix correspond to the eigenvalues one-to-one.

步驟502,將所述列矩陣元素對應的電訊號輸入到行列計算單元,利用電訊號調節子單元基於行矩陣元素的大小,對所述電訊號進行調節,其中,所述行列計算單元包括至少一個乘法單元和加法單元,所述乘法單元包括電訊號調節子單元和負載,負載的負載值固定不變。Step 502: Input the electrical signal corresponding to the column matrix element into the row and column calculation unit, and use the electrical signal adjustment sub-unit to adjust the electrical signal based on the size of the row matrix element, wherein the row and column calculation unit includes at least one A multiplication unit and an addition unit, the multiplication unit includes an electrical signal conditioning subunit and a load, the load value of the load is fixed.

行列計算單元所包括的乘法單元的數量可以與第一矩陣中的一列所包括的矩陣元素的數量匹配。The number of multiplication units included in the row and column calculation units may match the number of matrix elements included in one column of the first matrix.

上述乘法單元用於實現第一矩陣中的一列中的一個列矩陣元素與第二矩陣與該列對應的一行中的一個行矩陣元素的乘積。The above-mentioned multiplication unit is used to realize the product of a column matrix element in a column in the first matrix and a row matrix element in a row of the second matrix corresponding to the column.

在本實施例中,上述負載的負載值固定不變。In this embodiment, the load value of the above load is fixed.

上述負載可以為電阻,也可以為電容。The above load can be a resistor or a capacitor.

上述電訊號包括電壓訊號,所述電訊號調節子單元包括電壓訊號占空比調節單元。所述電壓訊號占空比調節單元包括:控制訊號發生電路與開關電路;上述步驟502包括: 首先,利用所述控制訊號發生電路生成與所述行矩陣元素的大小匹配的控制訊號。 The above electrical signal includes a voltage signal, and the electrical signal adjustment subunit includes a voltage signal duty cycle adjustment unit. The voltage signal duty cycle adjustment unit includes: a control signal generating circuit and a switching circuit; the above step 502 includes: First, the control signal generating circuit is used to generate a control signal matching the size of the row matrix element.

其次,將所述控制訊號作用到所述開關電路中,藉由控制所述開關電路的導通或斷開,調節作用在負載上的電壓訊號的大小與所述行矩陣元素匹配。具體地說明可以參考圖2所示的電訊號調節子單元部分的說明,此次不贅述。Secondly, the control signal is applied to the switch circuit, and by controlling the on or off of the switch circuit, the magnitude of the voltage signal acting on the load is adjusted to match the row matrix element. For specific description, please refer to the description of the electrical signal conditioning subunit shown in FIG. 2 , which will not be described again this time.

對於每一個列矩陣元素與行矩陣元素的乘法實現的乘法單元,可以根據該行矩陣元素的大小使用電訊號調節子單元對用於表示列矩陣元素的電訊號大小進行調節。電訊號的調節比例與負載的共同作用可以與行矩陣元素的大小匹配。For each multiplication unit implemented by the multiplication of a column matrix element and a row matrix element, the electrical signal adjustment subunit can be used to adjust the size of the electrical signal used to represent the column matrix element according to the size of the row matrix element. The scaling of the electrical signal in combination with the load can be matched to the size of the row matrix elements.

對於神經網路而言,對於同一神經網路單元,該神經網路單元中可以對應多次矩陣乘法。每次矩陣乘法對應的權重矩陣中的矩陣元素可以不同。為了適應與多次矩陣乘法對應的權重會發生變化的問題,可以使用本發明提供的實現矩陣乘法的矩陣乘法電路模組以及本實施例提供的矩陣方法實現方法來完成矩陣乘法。藉由對輸入的電訊號進行調節,可以降低實現矩陣乘法的電路結構的複雜度。For neural networks, for the same neural network unit, the neural network unit can correspond to multiple matrix multiplications. The matrix elements in the weight matrix corresponding to each matrix multiplication can be different. In order to adapt to the problem that the weights corresponding to multiple matrix multiplications will change, the matrix multiplication circuit module for realizing matrix multiplication provided by the present invention and the matrix method implementation method provided by this embodiment can be used to complete the matrix multiplication. By adjusting the input electrical signal, the complexity of the circuit structure for implementing matrix multiplication can be reduced.

步驟503,將各乘法單元的響應訊號的累加和作為該行列計算單元對應的計算結果,其中,所述乘法單元的響應訊號基於經該乘法單元的所述電訊號調節子單元調節後的電訊號作用到該乘法單元的負載得到。Step 503: The accumulated sum of the response signals of each multiplication unit is used as the corresponding calculation result of the row and column calculation unit, wherein the response signal of the multiplication unit is based on the electrical signal adjusted by the electrical signal conditioning sub-unit of the multiplication unit. The load acting on the multiplication unit is obtained.

若上述負載為電阻,乘法單元輸出的響應訊號為電流訊號。 若負載為電容,乘法單元輸出的響應訊號為電荷訊號。If the above load is a resistor, the response signal output by the multiplication unit is a current signal. If the load is a capacitor, the response signal output by the multiplication unit is a charge signal.

以上描述僅為本發明的較佳實施例以及對所運用技術原理的說明。本領域技術人員應當理解,本發明中所涉及的發明範圍,並不限於上述技術特徵的特定組合而成的技術方案,同時也應涵蓋在不脫離上述發明構思的情為下,由上述技術特徵或其等同特徵進行任意組合而形成的其它技術方案。例如上述特徵與本發明中公開的(但不限於)具有類似功能的技術特徵進行互相替換而形成的技術方案。The above description is only an illustration of the preferred embodiments of the present invention and the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present invention is not limited to technical solutions formed by specific combinations of the above technical features. At the same time, it should also cover the above technical features without departing from the above inventive concept. or other technical solutions formed by any combination of equivalent features. For example, a technical solution is formed by replacing the above features with technical features with similar functions disclosed in the present invention (but not limited to).

此外,雖然採用特定次序描繪了各操作,但是這不應當理解為要求這些操作以所示出的特定次序或以順序次序執行來執行。在一定環境下,多任務和並行處理可能是有利的。同樣地,雖然在上面論述中包含了若干具體實現細節,但是這些不應當被解釋為對本發明的範圍的限制。在單獨的實施例的上下文中描述的某些特徵還可以組合地實現在單個實施例中。相反地,在單個實施例的上下文中描述的各種特徵也可以單獨地或以任何合適的子組合的方式實現在多個實施例中。Furthermore, although operations are depicted in a specific order, this should not be understood as requiring that these operations be performed in the specific order shown or performed in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.

儘管已經採用特定於結構特徵和/或方法邏輯動作的語言描述了本主題,但是應當理解所附申請專利範圍中所限定的主題未必局限於上面描述的特定特徵或動作。相反,上面所描述的特定特徵和動作僅僅是實現申請專利範圍的示例形式。Although the present subject matter has been described in language specific to structural features and/or methodological logical acts, it is to be understood that the subject matter defined in the scope of the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claimed scope.

11:行列計算單元 110、110’:乘法單元 111:加法單元 501、502、503:步驟 1101、1101’:電訊號調節子單元 1102、1102’:負載 1103:控制訊號發生電路 1104:開關電路 Cin:控制訊號 I1、I2:電流訊號 out:輸出 Q1、Q2:電荷訊號 R:電阻 Vin1、Vin2:輸入訊號 11: Row and column calculation unit 110, 110’: Multiplication unit 111: Addition unit 501, 502, 503: Steps 1101, 1101’: Electrical signal conditioning subunit 1102, 1102’: load 1103: Control signal generation circuit 1104: Switch circuit Cin: control signal I1, I2: current signal out: output Q1, Q2: charge signal R: Resistor Vin1, Vin2: input signal

圖1是根據本發明的矩陣乘法電路模組的一些實施例的結構示意圖。 圖2是圖1所示的實例中的電訊號調節子單元的一種結構示意圖。 圖3是圖1所示的電路模組中的行列計算單元的一些示意性結構圖。 圖4是圖1所示的電路模組中的行列計算單元的又一些示意性結構圖。 圖5是根據本發明的矩陣乘法實現方法的一些實施例的流程示意圖。 結合附圖並參考以下具體實施方式,本發明各實施例的上述和其他特徵、優點及方面將變得更加明顯。貫穿附圖中,相同或相似的附圖標記表示相同或相似的元素。應當理解附圖是示意性的,元件和元素不一定按照比例繪製。 Figure 1 is a schematic structural diagram of some embodiments of a matrix multiplication circuit module according to the present invention. FIG. 2 is a schematic structural diagram of the electrical signal conditioning subunit in the example shown in FIG. 1 . FIG. 3 is a schematic structural diagram of the row and column calculation units in the circuit module shown in FIG. 1 . FIG. 4 is another schematic structural diagram of the row and column calculation units in the circuit module shown in FIG. 1 . Figure 5 is a schematic flowchart of some embodiments of a matrix multiplication implementation method according to the present invention. The above and other features, advantages and aspects of various embodiments of the invention will become more apparent with reference to the following detailed description taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.

11:行列計算單元 110:乘法單元 111:加法單元 1101:電訊號調節子單元 1102:負載 11: Row and column calculation unit 110: Multiplication unit 111: Addition unit 1101: Electrical signal conditioning subunit 1102: Load

Claims (13)

一種矩陣乘法電路模組,包括:至少一個實現行列乘法計算的行列計算單元, 所述行列計算單元包括至少一個乘法單元和加法單元,所述至少一個乘法單元的輸出端與所述加法單元的輸入端連接, 所述乘法單元包括電訊號調節子單元和負載,其中所述電訊號調節子單元用於調節輸入電訊號的大小,其中由所述電訊號調節子單元與所述負載對輸入到所述乘法單元的電訊號進行響應,以實現乘法操作, 其中上述負載的負載值固定。 A matrix multiplication circuit module, including: at least one row-row calculation unit that implements row-row multiplication calculation, The row and column calculation unit includes at least one multiplication unit and an addition unit, the output end of the at least one multiplication unit is connected to the input end of the addition unit, The multiplication unit includes an electrical signal conditioning subunit and a load, wherein the electrical signal conditioning subunit is used to adjust the size of the input electrical signal, wherein the pair of the electrical signal conditioning subunit and the load is input to the multiplication unit to respond to the electrical signal to implement the multiplication operation, The load values of the above loads are fixed. 如請求項1所述的電路模組,其中同一行列計算單元包括的至少一個乘法單元使用相同參數的負載。The circuit module according to claim 1, wherein at least one multiplication unit included in the same row and column calculation unit uses a load with the same parameters. 如請求項1所述的電路模組,其中所述至少一個實現行列乘法計算的行列計算單元各自對應的乘法單元,使用相同參數的負載。The circuit module according to claim 1, wherein the corresponding multiplication units of the at least one row-column calculation unit that implements row-row multiplication calculation use loads with the same parameters. 如請求項1所述的電路模組,其中所述負載包括電阻或者電容。The circuit module according to claim 1, wherein the load includes a resistor or a capacitor. 如請求項1所述的電路模組,其中所述電訊號包括電壓訊號,所述電訊號調節子單元包括:電壓訊號占空比調節單元。The circuit module of claim 1, wherein the electrical signal includes a voltage signal, and the electrical signal adjustment subunit includes a voltage signal duty cycle adjustment unit. 如請求項5所述的電路模組,其中所述電壓訊號占空比調節單元包括:控制訊號發生電路與開關電路,所述控制訊號發生電路生成的控制訊號藉由控制所述開關電路的導通或斷開,控制電壓訊號的占空比。The circuit module according to claim 5, wherein the voltage signal duty cycle adjustment unit includes: a control signal generating circuit and a switching circuit, and the control signal generated by the control signal generating circuit is controlled by controlling the conduction of the switching circuit. Or disconnected to control the duty cycle of the voltage signal. 如請求項1所述的電路模組,其中所述電訊號為電壓訊號,所述負載為電阻, 所述行列計算單元的加法單元用於將各乘法單元輸出的電流訊號進行求和。 The circuit module of claim 1, wherein the electrical signal is a voltage signal, and the load is a resistor, The addition unit of the row-column calculation unit is used to sum the current signals output by each multiplication unit. 如請求項1所述的電路模組,其中所述電訊號為電壓訊號,所述負載為電容, 所述行列計算單元的加法單元用於將各乘法單元輸出的電荷訊號進行求和。 The circuit module of claim 1, wherein the electrical signal is a voltage signal, and the load is a capacitor, The addition unit of the row-column calculation unit is used to sum the charge signals output by each multiplication unit. 如請求項1所述的電路模組,其中所述電路模組用於實現神經網路中的權重矩陣與神經元輸出的特徵矩陣的卷積計算。The circuit module according to claim 1, wherein the circuit module is used to realize the convolution calculation of the weight matrix in the neural network and the feature matrix output by the neuron. 一種矩陣乘法實現方法,用於如請求項1至9中任一項所述的矩陣乘法電路模組,包括: 獲取第一矩陣的一列的列矩陣元素,以及第二矩陣中與該列對應行的行矩陣元素,其中所述列矩陣元素由電訊號表示; 將所述列矩陣元素對應的電訊號輸入到行列計算單元,利用電訊號調節子單元基於行矩陣元素的大小,對所述電訊號進行調節,其中所述行列計算單元包括至少一個乘法單元和加法單元,所述乘法單元包括電訊號調節子單元和負載;以及 將各乘法單元的響應訊號的累加和作為該行列計算單元對應的計算結果,其中所述乘法單元的響應訊號基於經該乘法單元的所述電訊號調節子單元調節後的電訊號作用到該乘法單元的負載得到。 A matrix multiplication implementation method for the matrix multiplication circuit module described in any one of claims 1 to 9, including: Obtaining a column matrix element of a column of the first matrix and a row matrix element of a row corresponding to the column in the second matrix, wherein the column matrix element is represented by an electrical signal; The electrical signal corresponding to the column matrix element is input to the row and column calculation unit, and the electrical signal is adjusted based on the size of the row matrix element using the electrical signal adjustment sub-unit, wherein the row and column calculation unit includes at least one multiplication unit and an addition unit. unit, the multiplication unit includes an electrical signal conditioning subunit and a load; and The accumulated sum of the response signals of each multiplication unit is used as the corresponding calculation result of the row and column calculation unit, wherein the response signal of the multiplication unit is based on the electrical signal adjusted by the electrical signal conditioning sub-unit of the multiplication unit. The load of the unit is obtained. 如請求項10所述的方法,其中所述電訊號包括電壓訊號,所述電訊號調節子單元包括電壓訊號占空比調節單元,所述電壓訊號占空比調節單元包括:控制訊號發生電路與開關電路, 所述將所述列矩陣元素對應的電訊號輸入到行列計算單元,利用電訊號調節子單元基於行矩陣元素的大小,對所述電訊號進行調節的步驟更包括: 利用所述控制訊號發生電路生成與所述行矩陣元素的大小匹配的控制訊號;以及 將所述控制訊號作用到所述開關電路中,藉由控制所述開關電路的導通或斷開,調節作用在負載上的電壓訊號的大小與所述行矩陣元素匹配。 The method of claim 10, wherein the electrical signal includes a voltage signal, the electrical signal adjustment subunit includes a voltage signal duty cycle adjustment unit, and the voltage signal duty cycle adjustment unit includes: a control signal generating circuit and switching circuit, The step of inputting the electrical signals corresponding to the column matrix elements into the row and column calculation unit, and using the electrical signal adjustment subunit to adjust the electrical signals based on the size of the row matrix elements further includes: utilizing the control signal generation circuit to generate a control signal matching the size of the row matrix element; and The control signal is applied to the switch circuit, and by controlling the on or off of the switch circuit, the magnitude of the voltage signal acting on the load is adjusted to match the row matrix element. 如請求項10或11所述的方法,其中所述第一矩陣為神經網路的神經元輸出的特徵矩陣,所述第二矩陣為權重矩陣。The method of claim 10 or 11, wherein the first matrix is a feature matrix output by neurons of the neural network, and the second matrix is a weight matrix. 一種積體電路,包括至少一個如請求項1至9中任一項所述的矩陣乘法電路模組。An integrated circuit includes at least one matrix multiplication circuit module as described in any one of claims 1 to 9.
TW111116755A 2022-05-04 2022-05-04 Matrix multiplication circuit module and martrix mulitplication method TWI828138B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW111116755A TWI828138B (en) 2022-05-04 2022-05-04 Matrix multiplication circuit module and martrix mulitplication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW111116755A TWI828138B (en) 2022-05-04 2022-05-04 Matrix multiplication circuit module and martrix mulitplication method

Publications (2)

Publication Number Publication Date
TW202345018A TW202345018A (en) 2023-11-16
TWI828138B true TWI828138B (en) 2024-01-01

Family

ID=89720340

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111116755A TWI828138B (en) 2022-05-04 2022-05-04 Matrix multiplication circuit module and martrix mulitplication method

Country Status (1)

Country Link
TW (1) TWI828138B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193050A1 (en) * 2001-03-21 2005-09-01 Apple Computer Inc. Matrix multiplication in a vector processing system
TW202001694A (en) * 2018-06-05 2020-01-01 美商光子智能股份有限公司 Computing system
US20200142441A1 (en) * 2018-11-02 2020-05-07 Lightmatter, Inc. Matrix multiplication using optical processing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050193050A1 (en) * 2001-03-21 2005-09-01 Apple Computer Inc. Matrix multiplication in a vector processing system
TW202001694A (en) * 2018-06-05 2020-01-01 美商光子智能股份有限公司 Computing system
US20200142441A1 (en) * 2018-11-02 2020-05-07 Lightmatter, Inc. Matrix multiplication using optical processing

Also Published As

Publication number Publication date
TW202345018A (en) 2023-11-16

Similar Documents

Publication Publication Date Title
KR102462792B1 (en) Method and system for performing analog complex vector-matrix multiplication
Liu et al. Global anti-synchronization of complex-valued memristive neural networks with time delays
CN104321964B (en) The integrated startup strengthened for dynamic error vector magnitude biases enhancing
Bao et al. Mapping equivalent approach to analysis and realization of memristor-based dynamical circuit
Rao et al. Artificial neural network and adaptive neuro fuzzy control of direct torque control of induction motor for speed and torque ripple control
CN108491567B (en) Simulink modeling method of magnetic flux control type memristor
TWI828138B (en) Matrix multiplication circuit module and martrix mulitplication method
WO2022235214A1 (en) Matrix multiplication circuit module and method
CN111125616A (en) Two-dimensional discrete Fourier transform operation circuit and operation method
CN114928024A (en) Hysteresis-adjustable over-temperature protection circuit and electronic equipment
Cortes et al. Robust sliding mode control for the boost converter
Shamsollahi et al. Direct neural adaptive control applied to synchronous generator
TW495731B (en) Reference voltage circuit and method with controllable temperature coefficients
Kayisli et al. A novel power factor correction system based on sliding mode fuzzy control
Khalil et al. A universal fractional-order memelement emulation circuit
Abolmasoumi et al. Chaos control in memristor-based oscillators using intelligent terminal sliding mode controller
US20220357924A1 (en) Circuit module and method for performing matrix multiplication
CN107710585A (en) Power-converting device
WO2021114701A1 (en) Processor, and power supply ripple reduction method
Chakrabarti et al. Analysis and synthesis of adaptive gradient algorithms in machine learning: The case of AdaBound and MAdamSSM
CN105306012A (en) Circuit and method for generating negative pulse signal
Li et al. The applications of memristor devices in next-generation cortical processor designs
RU2746798C1 (en) Method for controlling nonlinear dynamic processes in single-phase voltage inverters with sinusoidal bipolar reverse modulation
Diouf et al. Statically constrained nonlinear models with application to IC buffers
Palma et al. Linear, time-invariant model of the dynamics of a cmos cc-cp