The present application relates to the technical field of integrated circuits, relates to a computing-in-memory circuit based on BNN
algorithm acceleration, and solves the problems in the prior art of a large circuit area,
high energy consumption, and low energy efficiency of computing-in-memory. The circuit comprises: selecting a first
algorithm network and a second
algorithm network from a flexible RRAM storage array; inputting a plurality of rows of data into the first algorithm network and a multiply-accumulate module to obtain a multiply-accumulate result, and inputting the multiply-accumulate result into a shifter; the shifter shifting the multiply-accumulate result, outputting the shifting result to an
adder-
subtractor to obtain a sum-calculation result and outputting the sum-calculation result to a
comparator; the
comparator performing binarization on the sum-calculation result, outputting the binarized sum-calculation result to a second algorithm network, performing recalculation to output a column accumulate current, and sending the column accumulate current to a maximum value
comparator output module; and the maximum value comparator output module determining a column having the maximum column sum as a
classification result. While keeping the original network precision, the required circuit area is greatly reduced, the
energy consumption is reduced, and the energy efficiency of the entire computing-in-memory circuit is improved.