A multiplication and accumulation circuit
By directly converting the analog voltage output by the image sensor into a random number, the data conversion process is reduced, the problem of high energy consumption in the random calculation circuit structure is solved, the calculation efficiency and accuracy are improved, and the low-power multiplication-accumulation operation is realized.
Patent Information
- Application Number
- CN202110853005.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-27
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-07-27
AI Technical Summary
The proportion of conversion modules in the existing stochastic computing circuit structure is too large, resulting in high energy consumption and poor calculation accuracy, making it difficult to implement low-power multiplication-accumulation operations.
Design a multiply-accumulate operation circuit that directly converts the analog voltage output by the image sensor into a random number, omitting the mutual conversion process between analog signals and digital signals, retaining only the two data expression forms of analog voltage and random numbers, and reducing data Conversion module energy consumption.
It reduces the energy consumption of the entire system, improves calculation efficiency and accuracy, and realizes low-power multiplication-accumulation operations.
Smart Images

Figure CN113741857B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of circuits, and in particular to a multiplication-accumulation operation circuit. Background Art
[0002] Nowadays, artificial neural networks have been widely used and achieved excellent performance in the fields of pattern recognition, automatic control, financial analysis, biomedicine, etc. Among them, convolutional neural networks, as the most widely used type of artificial neural network, perform particularly well in image processing.
[0003] However, as the complexity of tasks continues to increase, the scale of neural networks continues to grow, and the number of parameters and computations in the network is also increasing, which means that the resources and power consumption of neural networks mapped to hardware are increasing. Among them, the most core and largest operation in convolutional neural networks is the multiplication and accumulation operation, so the key to realizing a low-power convolutional neural network lies in the design of a low-power multiplication and accumulation unit.
[0004] Stochastic computing is a special computing paradigm that uses random numbers as operands. It has the characteristics of using simple gate circuits to complete arithmetic operations with low power consumption and low hardware cost. Because convolutional neural networks require a large number of parameters and arithmetic operations, and stochastic computing can complete arithmetic operations with lower hardware cost and power consumption, applying stochastic computing to convolutional neural networks can greatly improve the energy consumption of convolutional neural networks deployed on hardware and reduce hardware costs.
[0005] However, there is a problem that the conversion module accounts for too large a proportion in the stochastic computing circuit structure. The conversion module processes data and converts signals, which will cause a lot of energy consumption problems, resulting in poor calculation accuracy. Therefore, how to reduce the energy consumption of the multiplication and accumulation unit in the stochastic computing circuit structure and improve the calculation efficiency and accuracy is a problem that needs to be solved urgently. Summary of the invention
[0006] The purpose of the present invention is to provide a multiplication-accumulation-addition operation circuit to solve the structural defects in the random calculation in the prior art and reduce the energy consumption in the random calculation circuit structure.
[0007] The present invention provides a multiplication-accumulation operation circuit, comprising: an image sensor, an analog-random number converter, and a random calculation module; the image sensor is used to receive pixel information of an image and convert the pixel information into an analog voltage; the analog-random number converter is connected to the image sensor and is used to obtain the analog voltage from the image sensor and decode the analog voltage to generate a random number; the random calculation module is connected to the analog-random number converter and is used to perform a multiplication-accumulation operation of a convolutional layer in a neural network according to the random number.
[0008] A multiplication-accumulation operation circuit provided according to the present invention further includes: a memory; the memory is connected to the analog-random number converter and is used to store the random number.
[0009] According to a multiplication-accumulation circuit provided by the present invention, the random calculation module is further used to: input the multiplication-accumulation operation result as an analog signal to the analog-random number converter.
[0010] According to a multiplication-accumulation operation circuit provided by the present invention, the analog-random number converter includes a sensitive amplifier and a selector; the input end of the sensitive amplifier is connected to the output end of the image sensor, the input end of the selector is connected to the output end of the sensitive amplifier, and the output end of the selector is connected to the random calculation module; the sensitive amplifier is used to input the analog voltage output by the image sensor through the non-phase input end, input the reference voltage through the inverting input end, compare the analog voltage and the reference voltage, and output the comparison result; the selector is used to output the corresponding random number according to the comparison result, and different comparison results correspond to different random numbers.
[0011] According to a multiplication-accumulation operation circuit provided by the present invention, the random calculation module is specifically used to: perform multiple AND gate multiplication logic operations based on the weight of the neural network and the random number, and output the operation results; accumulate the operation results and output the accumulated results.
[0012] According to a multiplication-accumulation operation circuit provided by the present invention, the random calculation module includes a positive number circuit and a negative number circuit; the positive number circuit is used to obtain the output voltage of all positive number multiplication-accumulation results; the negative number circuit is used to obtain the output voltage of all negative number multiplication-accumulation results; the output voltages of the positive number circuit and the negative number circuit are added, and the total output voltage after the addition is output.
[0013] According to a multiplication-accumulation operation circuit provided by the present invention, the positive number circuit includes a plurality of positive number charging units connected in parallel with each other; the positive number charging unit includes: an AND gate multiplier, a capacitor and a switch; the input end of the AND gate multiplier inputs the random number, the weight of the neural network and the SIGN signal, and the output end is connected in series with the capacitor; one end of the switch is connected between the AND gate multiplier and the capacitor of one of the positive number charging units, and the other end of the switch is connected between the AND gate multiplier and the capacitor of another positive number charging unit.
[0014] According to a multiplication-accumulation operation circuit provided by the present invention, the negative number circuit includes a plurality of negative number charging units connected in parallel with each other; the negative number charging unit includes: a NAND gate multiplier, a capacitor and a switch; the input end of the NAND gate multiplier is the random number, the weight of the neural network and the SIGN signal, and the output end is connected in series with the capacitor; one end of the switch is connected between the NAND gate multiplier and the capacitor of one of the negative number charging units, and the other end of the switch is connected between the NAND gate multiplier and the capacitor of another negative number charging unit.
[0015] According to a multiplication-accumulation-addition operation circuit provided by the present invention, the calculation formula of the output voltage of the positive number circuit is:
[0016]
[0017] Where Vp is the positive output voltage, Sp is the absolute value of the product of all positive multiplication and accumulation, N×M is the total capacitance, and VDD is the power supply voltage;
[0018] The calculation formula of the output voltage of the negative circuit is:
[0019]
[0020] Where Vn is the negative output voltage, Sn is the absolute value of the multiplication and accumulation of the negative part; N×M is the total capacitance, and VDD is the power supply voltage;
[0021] The calculation formula of the total output voltage is:
[0022]
[0023] The multiplication and accumulation circuit provided by the present invention is improved on the basis of the existing random calculation structure, and the binary-random number converter, analog-to-digital converter and random number-binary converter are removed, and the analog voltage output by the image sensor is directly converted into a random number, and then converted into a random number and stored. The improved device omits the mutual conversion between analog signals and digital signals and the mutual conversion between digital signals and random numbers, leaving only two data expression forms of analog voltage and random numbers, so that the analog voltage is directly converted into a random number, reducing a large number of data conversion processes, thereby reducing the energy consumption of the data conversion module, thereby reducing the energy consumption of the entire system, and improving the calculation efficiency and calculation accuracy of the entire system. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a working principle diagram of a random computing device in the prior art;
[0025] Figure 2It is a structural schematic diagram of the multiplication-accumulation-addition operation circuit provided by the present invention;
[0026] Figure 3 It is a working principle diagram of the multiplication-accumulation-addition operation circuit provided by the present invention;
[0027] Figure 4 It is a schematic diagram of the structure of an analog-to-random number converter in a multiplication-accumulation operation circuit provided by the present invention;
[0028] Figure 5 It is a schematic diagram of a positive number circuit of a random calculation module in a multiplication-accumulation-addition operation circuit provided by the present invention;
[0029] Figure 6 The negative number circuit diagram of the random calculation module in the multiplication and accumulation operation circuit provided by the present invention is shown. DETAILED DESCRIPTION
[0030] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] The steps of the random calculation structure in the prior art include six modules: an image sensor, an analog-to-digital converter, a memory, a binary-to-random number converter, a random calculation module, and a random number-to-binary converter.
[0032] like Figure 1 As shown in the figure, the working process of the structure is as follows: first, the image sensor converts the pixel information in the picture into an analog voltage of the corresponding level, and the analog voltage is converted into a digital voltage signal of a certain precision by an analog-to-digital converter and stored in the memory for subsequent processing. Next, the binary-to-random number converter reads the binary input value from the memory array and converts it into a random number, and the random calculation logic performs the multiplication and accumulation operation in the convolutional neural network. Finally, the operation result is converted back into a binary number by the random number-to-binary converter, stored in the memory array, and recalculated as a partial sum of the first layer of the network or the input of the next layer of the network.
[0033] In the random computing structure of the prior art, the random computing module accounts for a small proportion, while the data conversion module accounts for a large proportion. The data conversion module includes an analog-to-digital converter, a binary-random number converter, and a random number-binary converter. Therefore, the data conversion module occupies a large amount of energy consumption.
[0034] Combine the following Figure 2-Figure 6 The multiplication-accumulation-addition circuit of the present invention is described.
[0035] like Figure 2 As shown, an embodiment of the present invention provides a multiplication-accumulation operation circuit, comprising: an image sensor 1, an analog-to-random number converter 2, and a random calculation module 3;
[0036] The image sensor 1 is used to receive pixel information of an image and convert the pixel information into an analog voltage;
[0037] The analog-to-random number converter 2 is connected to the image sensor 1 and is used to obtain the analog voltage from the image sensor 1 and decode the analog voltage to generate a random number;
[0038] The random calculation module 3 is connected to the analog-to-random number converter 2, and is used to perform multiplication and accumulation operations of the convolution layer in the neural network according to the random number.
[0039] The present embodiment is described in detail below.
[0040] like Figure 3 As shown, the working process of the multiplication and accumulation circuit provided by the present invention is: first, image information is received, and pixel information in the image is converted into analog voltage of corresponding level through the image sensor; the analog voltage is converted into a random number signal through an analog-random number converter and stored in a memory; the random calculation module takes out the random number in the memory and calculates it as input, and the calculation result is used as part of the first layer network or as input for calculation again.
[0041] Specifically, an image sensor uses the photoelectric conversion function of a photoelectric device to convert the light image on the photosensitive surface into an electrical signal that is proportional to the light image. The image sensor is a functional device that divides the light image on its light-receiving surface into many small units and converts them into usable electrical signals. Therefore, an image sensor is a device that converts an optical image into an electronic signal and is widely used in digital cameras and other electronic optical devices.
[0042] The analog-to-random number converter directly converts the analog signal output by the image sensor into a random number, that is, there is no need to perform analog-to-digital conversion on the analog signal, and also omits the conversion between binary and random numbers of the digital signal.
[0043] The analog-to-random number converter directly converts analog signals into random numbers, saving a large amount of data processing and signal conversion equipment, thereby greatly saving the energy consumption of the entire random calculation module.
[0044] The random calculation module retrieves the random number in the memory for calculation. It should be noted that the calculation method of the random calculation module in this embodiment is different from the traditional pure digital random calculation, but a mixed calculation is performed, the multiplication adopts a digital method, and the addition adopts an analog method, that is, the product results of the multiplication are added to obtain the final output signal. The final output signal is an analog quantity, which can be directly used as the input of the analog-random number converter to perform the next round of multiplication and accumulation operations.
[0045] This embodiment is based on the existing random calculation structure, and is improved on the basis of the existing random calculation structure, removing the binary-random number converter, analog-to-digital converter and random number-binary converter, directly converting the analog signal output by the image sensor into a random number, and storing it. The improved device omits the mutual conversion between analog signals and digital signals and the mutual conversion between digital signals and random numbers, leaving only two data expressions of analog quantity and random numbers, so that the analog signal and random number can be directly converted to each other, reducing a large number of data conversion processes, thereby reducing the energy consumption of the data conversion module, thereby reducing the energy consumption of the entire system and improving the computing efficiency of the entire system.
[0046] In a preferred embodiment, it further includes: a memory; the memory is connected to the analog-to-random number converter and is used to store the random number code.
[0047] The memory can be set as a memory array, which is composed of a large number of memory cells, mostly static random access memory arrays (SRAM). Static means that as long as the memory remains powered, the data stored in it can be kept constant. SRAM needs to constantly refresh the circuit to save the data stored inside it, so it has higher performance. Figure 1 and Figure 3 As shown, the memory in the embodiment of the present invention is different from the memory in the prior art in that the memory in the prior art stores digital binary signals, while the memory in the embodiment of the present invention stores random numbers.
[0048] In a preferred embodiment, the random calculation module is further used to: input the multiplication and accumulation operation result as an analog signal to the analog-random number converter.
[0049] Specifically, since the convolutional neural network is a complex layered network, multiple random calculations are required to calculate the convolution results of each layer. The result of each convolution calculation will be used as a point in the output feature image, and after the feature image undergoes the convolution process, a new feature image will be output, so this requires multiple convolution calculations between the convolution kernel and the feature image.
[0050] In a preferred embodiment, Figure 4 As shown, the analog-to-random number converter includes a sensitive amplifier and a selector;
[0051] The input end of the sensitive amplifier is connected to the output end of the image sensor, the input end of the selector is connected to the output end of the sensitive amplifier, and the output end of the selector is connected to the random calculation module;
[0052] The sensitive amplifier is used to input the analog voltage output by the image sensor through a non-phase input terminal, input a reference voltage through an inverting input terminal, compare the analog voltage with the reference voltage, and output a comparison result;
[0053] The selector is used to output a corresponding random number according to the comparison result, and different comparison results correspond to different random numbers.
[0054] The present embodiment is described in detail below.
[0055] The number of sensitive amplifiers can be three, namely, sensitive amplifier SA1, sensitive amplifier SA2 and sensitive amplifier SA0; the output signals include Y0, Y1 and Y2, and different output coding combinations of Y0, Y1 and Y2 can reflect the working states of the sensitive amplifiers SA1, SA2 and SA0.
[0056] The input of the sensitive amplifier is the analog voltage signal output by the image sensor, which is input from input ports 1, 2 and 3 respectively, and three different reference voltages, which are input from input ports 4, 5 and 6 respectively. VREF0, VREF1 and VREF2 are selected as three reference voltages, which are used as an input end of the sensitive amplifier SA0, the sensitive amplifier SA1 and the sensitive amplifier SA2 respectively, and are input from input ports 4, 5 and 6 respectively. The relationship between VREF0, VREF1 and VREF2 and the power supply voltage VDD is: VDD / 4, VDD / 2 and 3VDD / 4 respectively. The output end of the sensitive amplifier SA0 corresponds to Y0; the output ends of the sensitive amplifier SA1 and the sensitive amplifier SA2 are connected to the input ends of the selector respectively, and the output ends of the two selectors correspond to the output signals Y1 and Y2 respectively. And the output results of Y0 and Y1 are connected to the sensitive amplifier SA1 and the sensitive amplifier SA2 respectively, as the power supply of the sensitive amplifier SA1 and the sensitive amplifier SA2. The function of the two selectors is equivalent to a double-throw switch, so that the output flows to different branches respectively.
[0057] As shown in the following table, the input and output results of the analog-to-random number converter are compared:
[0058] index Analog Input Output 0 0-VDD / 4 000 1 VDD / 4-VDD / 2 001 2 VDD / 2-3VDD / 4 011 3 3VDD / 4-VDD 111
[0059] From the data in the table, we can see that when the analog signal and the power supply voltage VDD are in different relationships, the output results are different. From the data in the table, we can see that when the output value of Y0 is 0, both Y1 and Y2 are 0, and the voltage at this time is between 0-VDD / 4. When the output value of Y1 is 0, the output value of Y2 must also be 0.
[0060] That is to say, when the voltage signal output by the image sensor is less than VDD / 4, it means that the analog voltage signal is weak at this time, and the working state of the sensitive amplifier and the selector can be controlled through the output signal of Y0, so that the sensitive amplifier SA1 and the sensitive amplifier SA2 stop working, and Y1 and Y2 directly output 0 through the selector.
[0061] When the voltage signal output by the image sensor is VDD / 4-VDD / 2, the output signal of Y0 is 1, and the output signal of Y1 is 0. At this time, the sense amplifier SA1 and the sense amplifier SA0 may work at the same time, but the sense amplifier SA2 does not work.
[0062] When the voltage signal output by the image sensor is greater than VDD3 / 4, the outputs of Y1 and Y0 are both 1, and the sensitive amplifiers SA0, SA1 and SA2 work simultaneously.
[0063] By setting a sensitive amplifier and a selector, the embodiment of the present invention can reduce the working state of the device in the analog-random number converter when the analog voltage output by the image sensor is small, reduce the power consumption generated by the sensitive amplifier, and thus improve the overall energy efficiency of the analog-random number converter.
[0064] In a preferred embodiment, Figure 5 and Figure 6 As shown, the random calculation module is specifically used for:
[0065] Based on the weight of the neural network and the random number, multiple AND gate multiplication logic operations are performed and the operation results are output; the operation results are accumulated and the accumulated results are output.
[0066] The random calculation module includes a positive number circuit and a negative number circuit;
[0067] The positive number circuit is used to obtain the output voltage of all positive number multiplication and accumulation results;
[0068] The negative number circuit is used to obtain the output voltage of all negative number multiplication and accumulation results;
[0069] The output voltages of the positive circuit and the negative circuit are accumulated, and the accumulated total output voltage is output.
[0070] Furthermore, if Figure 5 As shown, the positive circuit includes a plurality of positive charging units connected in parallel with each other;
[0071] The positive charging unit comprises: an AND gate multiplier, a capacitor and a switch;
[0072] The random number, the weight of the neural network and the SIGN signal are input into the input end of the AND gate multiplier, and the output end is connected in series with the capacitor;
[0073] One end of the switch is connected between the AND gate multiplier and the capacitor of one of the positive charging units, and the other end of the switch is connected between the AND gate multiplier and the capacitor of another positive charging unit.
[0074] Furthermore, if Figure 6 As shown, the negative number circuit includes a plurality of negative number charging units connected in parallel with each other;
[0075] The negative charging unit comprises: a NAND gate multiplier, a capacitor and a switch;
[0076] The input end of the NAND gate multiplier is the random number, the weight of the neural network and the SIGN signal, and the output end is connected in series with the capacitor;
[0077] One end of the switch is connected between the NAND gate multiplier and the capacitor of one of the negative charging units, and the other end of the switch is connected between the NAND gate multiplier and the capacitor of another negative charging unit.
[0078] The calculation formula of the output voltage of the positive circuit is:
[0079]
[0080] Where Vp is the positive output voltage, Sp is the absolute value of the product of all positive multiplication and accumulation, N×M is the total capacitance, and VDD is the power supply voltage;
[0081] Specifically, the three input terminals 1, 2 and 3 of the AND gate multiplier are respectively input to IN i [j], W i [j] and SIGN i , IN i [j] and W i [j] represents the input random number and the weight of the neural network respectively, and the output terminal outputs the logical operation result of the three input signals. i When is 1 (indicating a positive number), and IN i [j] and W iWhen [j] are both high, the capacitor will be charged, and the AND gate multiplier will perform the AND gate multiplication operation. The product obtained is fed into the capacitor array, and the analog addition operation is performed by accumulating the capacitor charges. When the calculation is completed, all switches can be closed to cut off the current between the AND gate multiplier and the capacitor, so that the entire circuit is reset to facilitate the next calculation.
[0082] The calculation formula of the output voltage of the negative circuit is:
[0083]
[0084] Where Vn is the negative output voltage, Sn is the absolute value of the multiplication and accumulation of the negative part; N×M is the total capacitance, and VDD is the power supply voltage;
[0085] Specifically, the three input terminals 4, 5 and 6 of the NAND gate multiplier are respectively input to IN i [j], W i [j] and SIGN i . IN i [j] and W i [j] represents the input random number and the weight of the neural network respectively, and the output terminal outputs the logical operation result of the three input signals. i is 0, and IN i [j] and W i When [j] is 1, the capacitor will not be charged to the power supply voltage. That is, when the absolute value of the negative product is 1, the capacitor will not be charged, otherwise, the capacitor will be charged. If the absolute value of the multiplication and accumulation of the negative part is Sn, then Sn capacitors will not be charged, and the remaining (N×M-Sn) capacitors will be charged to VDD. When the calculation is completed, all switches can be closed to cut off the current between the AND gate multiplier and the capacitor, so that the entire circuit is reset for the next calculation.
[0086] The calculation formula of the total output voltage is:
[0087]
[0088] The multiplication and accumulation result is determined according to the output voltage, and the corresponding relationship between the output voltage and the multiplication and accumulation analog quantity is obtained. The voltage is proportional to the multiplication and accumulation analog quantity. When V=1 / 2VDD, when the accumulation result is 0, the sum of the absolute values of positive numbers is equal to the sum of the absolute values of negative numbers. If V>1 / 2VDD, the multiplication and accumulation result is positive; if V<1 / 2VDD, the multiplication and accumulation result is negative.
[0089] This embodiment performs mixed operations on random numbers through a positive number circuit and a negative number circuit, and obtains the relationship between the voltage and the analog quantity after the mixed calculation by combining digital operations and analog operations.
[0090] Combined with the following table, the energy consumption of the structure proposed by the present invention is compared with that of the structure module in the prior art:
[0091]
[0092] It can be seen from the above table that the multiplication and accumulation circuit provided by the present invention, compared with the prior art, eliminates the energy conversion consumption of the two modules of the analog-to-digital converter and the random number-to-digital converter, and the energy consumption of the analog-to-random number converter is also much smaller than that of the digital-random number sensor, and the energy consumption of the mixed signal random calculation module is also smaller than that of the random calculation logic module.
[0093] Although the present invention has been described in detail above with general descriptions and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements may be made thereto based on the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection claimed by the present invention.
Claims
1. A multiplication and accumulation circuit, It is characterized in that include: Image sensor, analog-to-random number converter, and random calculation module; The image sensor is used to receive pixel information of an image and convert the pixel information into an analog voltage; The analog-to-random number converter is connected to the image sensor and is used to obtain the analog voltage from the image sensor and decode the analog voltage to generate a random number; The random calculation module is connected to the analog-to-random number converter and is used to perform a multiplication-accumulation operation of a convolutional layer in a neural network according to the random number; Wherein, the random calculation module includes a positive number circuit and a negative number circuit, the positive number circuit includes a plurality of positive number charging units connected in parallel; the positive number charging unit includes: an AND gate multiplier, a capacitor and a switch; the input end of the AND gate multiplier inputs the random number, the weight of the neural network and the SIGN signal, and the output end is connected in series with the capacitor; one end of the switch is connected between the AND gate multiplier and the capacitor of one of the positive number charging units, and the other end of the switch is connected between the AND gate multiplier and the capacitor of another positive number charging unit; The positive number circuit is used to obtain the output voltage of all positive number multiplication and accumulation results; The negative number circuit is used to obtain the output voltage of all negative number multiplication and accumulation results; The output voltages of the positive circuit and the negative circuit are accumulated, and the accumulated total output voltage is output.
2. The multiplication-accumulation operation circuit according to claim 1, It is characterized in that Also includes: Memory; The memory is connected to the analog-to-random number converter and is used to store the random number.
3. The multiplication-accumulation circuit according to claim 1, It is characterized in that The random calculation module is also used for: The multiplication-accumulation operation result is input into the analog-random number converter as an analog signal.
4. The multiplication-accumulation circuit according to claim 1, It is characterized in that The analog-to-random number converter includes a sense amplifier and a selector; The input end of the sensitive amplifier is connected to the output end of the image sensor, the input end of the selector is connected to the output end of the sensitive amplifier, and the output end of the selector is connected to the random calculation module; The sensitive amplifier is used to input the analog voltage output by the image sensor through a non-phase input terminal, input a reference voltage through an inverting input terminal, compare the analog voltage with the reference voltage, and output a comparison result; The selector is used to output a corresponding random number according to the comparison result, and different comparison results correspond to different random numbers.
5. The multiplication-accumulation operation circuit according to claim 1, It is characterized in that The random calculation module is specifically used for: Based on the weight of the neural network and the random number, multiple AND gate multiplication logic operations are performed, and the operation results are output; The operation results are accumulated and the accumulated results are output.
6. The multiplication-accumulation operation circuit according to claim 1, It is characterized in that The negative number circuit comprises a plurality of negative number charging units connected in parallel with each other; The negative charging unit comprises: a NAND gate multiplier, a capacitor and a switch; The input end of the NAND gate multiplier is the random number, the weight of the neural network and the SIGN signal, and the output end is connected in series with the capacitor; One end of the switch is connected between the NAND gate multiplier and the capacitor of one of the negative charging units, and the other end of the switch is connected between the NAND gate multiplier and the capacitor of another negative charging unit.
7. The multiplication-accumulation operation circuit according to claim 1, It is characterized in that The calculation formula of the output voltage of the positive circuit is: Where Vp is the positive output voltage, Sp is the absolute value of the product of all positive multiplication and accumulation, N×M is the total capacitance, and VDD is the power supply voltage; The calculation formula of the output voltage of the negative circuit is: Where Vn is the negative output voltage, Sn is the absolute value of the multiplication and accumulation result of the negative part; N×M is the total capacitance, VDD is the power supply voltage; The calculation formula of the total output voltage is:
