The present application is applicable to the technical field of integrated circuits and neural networks. Provided are a
matrix multiplication apparatus and method based on a
systolic array, and an electronic device. The
matrix multiplication apparatus based on a
systolic array comprises: a
systolic array formed by means of arranging
processing elements, wherein two adjacent
processing elements in each column are connected by a shift, each
processing element has transmission channels in a row direction, a column direction and a
diagonal direction, the row direction is used for inputting a
row vector of a first matrix, and the column direction and the
diagonal direction are used for inputting a
column vector of a second matrix; a plurality of first
control signal channels, which are used for inputting a first
control signal for controlling the operating state of each shift; and a plurality of second
control signal channels, which are used for inputting a second control
signal for controlling each
column vector of the second matrix to be input in the column direction or the
diagonal direction. Therefore, a
hardware structure taking into consideration a
sparse matrix multiplication operation and a dense
matrix multiplication operation is achieved, and the calculation complexity of matrix multiplication is reduced.