The invention discloses a multiply-accumulate operation method and device, a neural
network processing device and
electronic equipment, and the method comprises the steps: encoding input activation data into encoding activation data, and encoding original weight data into a
weight unit after encoding
processing; a multiplication result can be obtained only by selecting a shift operation in the storage array, a
complex multiplier circuit is replaced, and the calculation
power consumption is remarkably reduced; the second intermediate result is obtained by carrying out shift accumulation on the first intermediate result, and accurate compensation is carried out by utilizing the compensation code based on calculation, so that the result
correctness is ensured, the additional cycle overhead and the complex circuit generated by
processing unsigned data or symbol extension in the traditional scheme are avoided, and the accuracy of the result is improved. Therefore, on the basis of improving the calculation
throughput rate, the calculation power is effectively enhanced, the
power consumption is optimized, and finally the energy efficiency ratio and the overall
processing efficiency of the multiply-accumulate operation are comprehensively improved.