The invention belongs to the
digital signal processing field, and specifically relates to a
convolution calculating apparatus and method for a neural network. The
convolution calculating apparatus andmethod for a neural network aims at solving the problem that consumption of resources is great and the
utilization rate of the read in data is low during the process of
convolution calculation. The convolution calculating method for a neural network includes the steps: input data matrixes are processed in rows, and every two rows of data are input serially row by row into multiply accumulator arrays for carrying out multiply and accumulate operations; the multiply accumulator arrays perform deployment according to a convolution kernel dimension (M2, N2), and can process 2*M2*N2 times of multiplication in parallel; and by means of the convolution operation law, the two groups of multiply accumulator arrays can be shifted and added, and the data operation is accelerated. The convolution calculating apparatus and method for a neural network can excavate parallelism during the calculating process and improve the calculating efficiency of the
system, and at the same time can reuse the input data and directly put the calculation results into a
pooling unit, thus being able to reduce data reading and writing. Besides, the convolution calculating apparatus and method for a neural networkonly need one row
cushion space, thus having a small demand for resources, can realize calculation of different dimension convolution, and have the advantages of calculating flexibility, universality,
high effectiveness and low
power consumption property.