A weighted summation in-memory calculation circuit and memory
Patent Information
- Application Number
- CN202310350594.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-04
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-04-04
Smart Images

Figure CN116451758B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of non-volatile memory and compute-in-memory in semiconductor and CMOS ultra-large scale integrated circuit (ULSI), and in particular to a weighted summation compute-in-memory circuit and a memory for performing vector matrix multiplication using a non-volatile memory array. Background Art
[0002] With the continuous development of artificial intelligence and deep learning technology, artificial neural networks have been widely used in natural language processing, image recognition, autonomous driving, graph neural networks and other fields. However, the increasing size of the network has led to a large amount of energy consumption in the transfer of data between memory and traditional computing devices such as CPU and GPU, which is called the von Neumann bottleneck. The most important calculation in the artificial neural network algorithm is the vector matrix multiplication calculation (Vector Matrix Multiplication). Compute-In-Memory based on non-volatile memory (Non-volatile Memory) stores weights in non-volatile memory units and simulates vector matrix multiplication calculations in the array, avoiding the frequent transfer of data between memory and computing units. It is considered to be a promising way to solve the von Neumann bottleneck.
[0003] At present, non-volatile memory devices such as RRAM, PCRAM, MRAM, FeRAM, FeFET, etc. store weights on the conductivity value of the device after the weights are written. The devices are organized in the form of an array, and the input voltage from one end is used as the input of the vector-matrix multiplication. The current obtained at the other end of the array is the summation result of the vector-matrix multiplication calculated by Ohm's law and Kirchhoff's law in the array, and the summation result is usually read out using an analog-to-digital converter (ADC). Since the area of the analog-to-digital converter does not match the length of the array unit area, a multiplexer (MUX) is usually used to allow multiple columns in the array to share an analog-to-digital converter.
[0004] Figure 1 A schematic diagram of vector-matrix multiplication based on a non-volatile device array is shown. Figure 2a and Figure 2b Two different forms of traditional vector-matrix multiplication circuits are shown. Figure 2aThe input uses the digital-to-analog converter to input the voltage, and the output uses the op amp to clamp the bit line voltage. After the current is summed on the bit line according to Kirchhoff's law, this current is converted into a voltage through a trans-impedance amplifier (TIA) composed of an op amp and a resistor, and finally read out through an analog-to-digital converter; Figure 2b In the process, the parasitic capacitance of the bit line (BL) is precharged to a fixed voltage, the source line is grounded, and an input pulse is applied to the word line. The amount of charge lost on the parasitic capacitance of the bit line is equal to the sum of the charges flowing through each device, so the bit line voltage drop is equal to the vector matrix multiplication result of the input multiplied by the weight, and finally the voltage is read out by the analog-to-digital converter.
[0005] It can be seen that the traditional in-memory computing circuit has the following problems: Figure 2a The solution in the above example has a DC process, which causes large currents in the array and the operational amplifier, affecting the further improvement of the system energy efficiency. Figure 2b Although there is no DC process in the scheme, the bit line parasitic capacitance is usually small and the number of rows turned on at the same time is small, which affects the parallelism of the calculation and increases the number of analog-to-digital converter operations. At the same time, due to the small parasitic capacitance of the bit line, the voltage on the bit line cannot be kept stable under different input and weight products, resulting in nonlinear calculation results. Summary of the invention
[0006] In view of the above problems, the purpose of the present invention is to provide a weighted summation in-memory calculation circuit and a memory to solve the problems of voltage instability in the existing in-memory calculation circuit, resulting in nonlinear calculation results and affecting system performance improvement.
[0007] The weighted summation in-memory calculation circuit provided by the present invention comprises: a first array and a second array that are symmetrically distributed, and a peripheral circuit; taking the use of the first array for in-memory calculation as an example: wherein, when the first array and the second array are disconnected through the peripheral circuit, a precharge voltage and a pulse signal are input to the first array, and a bitwise array vector multiplication operation is performed through the first array; when the first array and the second array are connected through the peripheral circuit, the first array and the second array form a switched capacitor circuit to obtain an analog summation and an analog weighted summation operation corresponding to the pulse signal through the second array, and output the operation result. When the second array is used for in-memory calculation, the process is similar to the above process, except that the first array and the second array are functionally swapped.
[0008] In addition, an optional technical solution is that the peripheral circuit includes a first peripheral circuit connected to the first array, a second peripheral circuit connected to the second array, and a multiplexing circuit; wherein the multiplexing circuit includes an operational amplifier, an analog-to-digital converter, a shift register, and an output register; the first peripheral circuit includes a first input register, a first pulse generator, a first word line driver, a first read-write circuit, a first switch and a pre-charge circuit, and a first switch circuit arranged corresponding to the first array; the second peripheral circuit includes a second input register, a second pulse generator, a second word line driver, a second read-write circuit, a second switch and a pre-charge circuit, and a second switch circuit arranged corresponding to the second array.
[0009] In addition, an optional technical solution is that in the first array and the second array, every 8 columns of storage cells are divided into a column segment, and an 8-bit weight is represented by a row of 8 storage cells in the column segment; and each column segment corresponds to a switch and pre-charge circuit, an operational amplifier, an analog-to-digital converter and a shift register.
[0010] In addition, an optional technical solution is that when the first array and the second array are disconnected through the peripheral circuit, the source line of the target column used for the current calculation in the first array is grounded, and all the source lines and bit lines of the remaining columns in the same column segment are short-circuited and precharged to the read voltage through the first switch and the precharge circuit; the equivalent capacitance between the bit line of the target column and the ground is: 8*C BL +7*C SL +C BS Among them, C BL Represents the parasitic capacitance between the bit line and ground, C SL Represents the parasitic capacitance between the source line and the ground, C BS Represents the parasitic capacitance from the bit line to the source line.
[0011] In addition, an optional technical solution is that when the precharge circuit between the first array and the read voltage is disconnected, a corresponding pulse signal is sent on the word line according to the weight in the first input register through an external pulse generator; wherein the number of pulse signals is proportional to the value in the first input register; the parasitic capacitor C on the bit line BL The charge on the first register is lost, and the amount of charge lost is equal to the dot product of the input pulse signal and the weight stored in the first register.
[0012] In addition, an optional technical solution is that when the first array and the second array are connected through a peripheral circuit, the negative input terminal of the operational amplifier in the multiplexing circuit is simultaneously connected to the bit line of the target column in the first array and the source line of the corresponding column in the second array, the output terminal of the operational amplifier is connected to the bit line of the second array, and the positive input terminal of the operational amplifier is connected to the read voltage; the first array, the second array and the operational amplifier form a switched capacitor circuit; the middle bit line voltage of the second array is: V BLB=Q*(C BL +C BS ) / (8*C BL +7*C SL +C BS ) / C BS Among them, C BL Represents the parasitic capacitance between the bit line and ground, C SL Represents the parasitic capacitance between the source line and the ground, C BS Represents the parasitic capacitance from the bit line to the source line.
[0013] In addition, an optional technical solution is that the middle line voltage of the second array is proportional to the amount of lost charge.
[0014] In addition, an optional technical solution is that the first array inputs a multi-value voltage through an external digital-to-analog converter, or inputs a binary voltage through a buffer; the output of the second array is converted through an analog-to-digital converter, and the converted digital quantity is stored in a shift register to complete the output.
[0015] In addition, an optional technical solution is that both the first array and the second array include N columns and M rows of storage units; and the storage units are 1T1R devices.
[0016] On the other hand, the present invention also provides a memory, comprising the above-mentioned weighted sum in-memory calculation circuit.
[0017] The weighted summation in-memory calculation circuit and memory are used to set a symmetrically distributed first array, a second array and a peripheral circuit; wherein, the connection between the first array and the second array can be disconnected first, a precharge voltage and a pulse signal are input to the first array, and a bitwise array vector multiplication operation is performed through the first array; then, the first array and the second array are connected through the peripheral circuit to form a switched capacitor circuit, and then analog summation and analog weighted summation operations are performed through the second array, and the operation result corresponding to the pulse signal is output, which can eliminate the area requirement for adding additional capacitors to complete the calculation process, reduce the number of times the ADC is turned on, and improve the energy efficiency and area efficiency of the system as a whole.
[0018] In order to achieve the above and related purposes, one or more aspects of the present invention include the features that will be described in detail later. The following description and the accompanying drawings describe some exemplary aspects of the present invention in detail. However, these aspects indicate only some of the various ways in which the principles of the present invention can be used. In addition, the present invention is intended to include all these aspects and their equivalents. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] By referring to the following description in conjunction with the accompanying drawings, and with a more comprehensive understanding of the present invention, other objects and results of the present invention will become more apparent and easy to understand. In the accompanying drawings:
[0020] Figure 1 A schematic diagram of matrix multiplication based on a non-volatile device array;
[0021] FIG2 is a circuit diagram of two conventional array calculation vector-matrix multiplications;
[0022] Figure 3 It is a structural schematic diagram of a weighted sum in-memory calculation circuit according to an embodiment of the present invention;
[0023] Figure 4 Schematic diagram of the switch and pre-charging circuit structure of the symmetrical array of an embodiment of the present invention;
[0024] Figure 5 Schematic diagram of step 1 of the working process of the weighted sum in-memory calculation circuit according to an embodiment of the present invention;
[0025] Figure 6 Schematic diagram of step 2 of the working process of the weighted sum in-memory calculation circuit according to an embodiment of the present invention;
[0026] Figure 7 Schematic diagram of step 3 of the working process of the weighted sum in-memory calculation circuit according to an embodiment of the present invention;
[0027] Figure 8 Schematic diagram of the weighted summation calculation principle using symmetrical array parasitic capacitance. DETAILED DESCRIPTION
[0028] In the following description, for the purpose of illustration, in order to provide a comprehensive understanding of one or more embodiments, many specific details are set forth. However, it is apparent that these embodiments may also be implemented without these specific details. In other examples, for ease of describing one or more embodiments, known structures and devices are shown in the form of block diagrams.
[0029] In the current in-memory computing scheme, due to the existence of the DC process, there are large currents in the array and the op amp, which affects the further improvement of the system energy efficiency; and, although the DC process can be omitted, the bit line parasitic capacitance is usually small, and the number of rows turned on at the same time is small, which affects the parallelism of the calculation and increases the number of analog-to-digital converter operations. At the same time, due to the small parasitic capacitance of the bit line, the voltage on the bit line cannot be kept stable under different input and weight products, resulting in nonlinearity in the calculation results. In order to solve the above problems, the present invention provides an in-memory calculation circuit that uses adjacent cells to increase bit line capacitance and uses symmetrical array parasitic capacitance to perform weighted summation. The circuit mainly includes two symmetrical arrays (a first array and a second array), and corresponding independent or multiplexed peripheral circuits. When the first array is used to perform bitwise matrix-vector multiplication calculations in a neural network, the second array is used to provide parasitic capacitance to implement weighted summation calculations. The calculated capacitance of the column bit line can be increased by using the adjacent column parasitic capacitance, thereby maintaining voltage stability and improving calculation accuracy. The symmetrical array is used to complete analog summation and analog weighted summation calculations, eliminating the area requirement for additional capacitance to complete this process, reducing the number of ADC startup times, and improving the energy efficiency and area efficiency of the system.
[0030] In the embodiment of the present invention, the first array inputs a multi-value voltage through an external digital-to-analog converter, or inputs a binary voltage through a buffer, and the output of the second array is converted through an analog-to-digital converter, and the converted digital quantity is stored in a shift register to complete the output. The first array and the second array both include N columns and M rows of storage units, specifically N and M can be positive integers, and the storage unit can be a 1T1R device, etc.
[0031] Since 1T1R devices can avoid the problem of write crosstalk, 1T1R devices are usually used in larger arrays. In the description of the present invention, it should be understood that the 1T1R device is used as an example for description. For this reason, in the agreed naming method, the line connecting the gate of the transistor is called the word line (Word Line, WL), the line connecting the source of the transistor is called the source line (Source Line, SL), and the line connecting one end of the device is called the bit line (Bit Line, BL).
[0032] In order to describe the weighted sum in-memory calculation circuit and the memory in the present invention in detail, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0033] Figure 3 The figure is a schematic diagram of the structure of the weighted sum in-memory calculation circuit according to an embodiment of the present invention.
[0034] like Figure 3As shown, the weighted summation in-memory calculation circuit implemented by the present invention includes a symmetrically distributed first array (array A) and a second array (array B), and a multiplexed or exclusive peripheral circuit; wherein the first array and the second array are disconnected or connected through the peripheral circuit, and when the first array and the second array are disconnected through the peripheral circuit, a precharge voltage and a pulse signal can be input to the first array, and a bitwise array vector multiplication operation can be performed through the first array; when the first array and the second array are connected through the peripheral circuit, the first array and the second array form a switched capacitor circuit, and then analog summation and analog weighted summation operations can be performed through the second array, and the operation result corresponding to the pulse signal is output, thereby realizing the in-memory calculation of the weighted summation.
[0035] Specifically, the peripheral circuit further includes a first peripheral circuit connected to the first array, a second peripheral circuit connected to the second array, and a multiplexing circuit; wherein the multiplexing circuit is located between the first array and the second array, and both the first array and the second array can be used, and it includes an operational amplifier, an analog-to-digital converter, a shift register, and an output register; the first peripheral circuit includes a first input register, a first pulse generator, a first word line driver, a first read-write circuit, a first switch and a pre-charge circuit, and a first switch circuit arranged corresponding to the first array; the second peripheral circuit includes a second input register, a second pulse generator, a second word line driver, a second read-write circuit, a second switch and a pre-charge circuit, and a second switch circuit arranged corresponding to the second array, and the first array and the second array realize switching between connected or disconnected states through the cooperation of the first switch circuit and the second switch circuit.
[0036] Furthermore, in the first array and the second array, each 8 columns of storage cells are divided into a column segment, and an 8-bit weight is represented by a row of 8 storage cells in the column segment; and each column segment corresponds to a switch and precharge circuit, an operational amplifier, an analog-to-digital converter, and a shift register. The operational amplifier and the analog-to-digital converter can be connected to the first array or the second array through the switch selection of the switch circuit (including the first switch circuit and the second switch circuit), and the digital quantity output by the analog-to-digital converter is stored in the shift register and finally sent to the output register.
[0037] As a specific example, Figure 4 The schematic structure of the switch and pre-charging circuit of the symmetrical array according to the embodiment of the present invention is shown.
[0038] like Figure 4As shown, the first array is used as an example for explanation. The gray dashed portion on the right side of the figure is a partially enlarged structure of the gray dashed portion on the left side, wherein in each column segment, all bit lines are connected to or grounded with common bit lines (GBLA1, GBLA2) through switches, and all source lines are connected to or grounded with common source lines (GSLA1, GSLA2) through switches. The common bit lines and common source lines in different column segments are not connected to each other. In the switch and precharge circuit on the outer side of the array (the first switch and precharge circuit on the upper side of the first array), the common bit line GBLA1 is connected to the precharge voltage through the switch on the corresponding side, the common bit line GBLA1 and the common source line GSLA1 are connected to the read-write circuit through the switch, and the common bit line GBLA1 and the common word line GSLA1 can be short-circuited through the switch. In the switch circuit on the inner side of the array (the first switch circuit on the lower side of the first array), the common bit line GBLA2 is connected to the negative input terminal, the output terminal or the input terminal of the analog-to-digital converter of the operational amplifier through a switch, the common source line GSLA2 is connected to the negative input terminal of the operational amplifier through a switch, and the common bit line and the common word line can also be short-circuited by the switch.
[0039] It should be noted that the second array is symmetrically distributed with the first array, and its internal structure can refer to the description of the first array, which will not be described one by one here.
[0040] As a specific example, the specific working principle (working process) of the weighted sum in-memory calculation circuit will be described in detail below.
[0041] Specifically, Figure 5 The schematic structure of the weighted sum in-memory calculation circuit in step 1 of the working process of the embodiment of the present invention is shown.
[0042] like Figure 5 As shown, in step 1 of the working process, when the first array is used to perform bitwise matrix-vector multiplication calculation in the neural network, the source line of the column currently used for calculation (i.e., the target column) in the column segment of the first array is grounded, and all source lines and bit lines of the remaining columns in the same column segment are short-circuited, and precharged to the read voltage V through the first switch and the precharge circuit. READ At this time, the equivalent capacitance between the bit line of the target column and the ground is: 8*C BL +7*C SL +C BS Among them, C BL Represents the parasitic capacitance between the bit line and ground, C SL Represents the parasitic capacitance between the source line and the ground, C BS Represents the parasitic capacitance from the bit line to the source line. This equivalent capacitance is much larger than the parasitic capacitance from the bit line to the ground used in the traditional method, thus increasing the precharge capacitance of the bit line and alleviating the problems of small number of open rows and nonlinearity caused by the small parasitic capacitance of the bit line in the traditional method.
[0043] also, Figure 6 The schematic structure of the weighted sum in-memory calculation circuit in step 2 of the working process of the embodiment of the present invention is shown.
[0044] like Figure 6 As shown, in step 2 of the working process, the first switch and the precharge switch in the precharge circuit are disconnected, and a certain number of pulse signals are sent on the word line according to the weight in the input register through an external pulse generator, that is, when the precharge circuit between the first array and the read voltage is disconnected, a corresponding pulse signal is sent on the word line according to the weight in the first input register through an external pulse generator; wherein the number of pulse signals is proportional to the value in the first input register; the parasitic capacitance C located on the bit line BL The charge on the first register will be lost, and the amount of charge lost Q is equal to the dot product of the input pulse signal and the weight stored in the first register.
[0045] also, Figure 7 The schematic structure of the weighted sum in-memory calculation circuit in step 3 of the working process of the embodiment of the present invention is shown.
[0046] like Figure 7 As shown, in step 3 of the working process, the bit line of the column currently used for calculation in the first array is disconnected from the other source lines and bit lines, and switches K1, K2 and K4 are turned on, that is, switches K1, K2 and K4 are turned on, and switches K3, K5 and K6 are turned off. The negative input of the operational amplifier is simultaneously connected to the bit line of the column currently used for calculation in the first array and the source line of a corresponding column in the second array, the output terminal of the operational amplifier is connected to the bit line in the second array, and the positive input terminal of the operational amplifier is connected to the read voltage V READ , the operational amplifier and the two arrays form a switched capacitor circuit.
[0047] In other words, when the first array and the second array are connected through the peripheral circuit, the negative input terminal of the operational amplifier in the multiplexing circuit is simultaneously connected to the bit line of the target column in the first array and the source line of the corresponding column in the second array, the output terminal of the operational amplifier is connected to the bit line of the second array, and the positive input terminal of the operational amplifier is connected to the read voltage; the first array, the second array and the operational amplifier form a switched capacitor circuit.
[0048] The charge lost by the bit line in the first array in step 2 is supplemented by the parasitic capacitor in the second array. Since the charge of the second array flows out from the source line, the bit line voltage is raised. At this time, assuming that the charge lost by the equivalent capacitor of the bit line in the first array in step 2 is Q, after step 3, the raised voltage of the bit line in the second array is: V BLB =Q*(C BL +C BS ) / (8*CBL +7*C SL +C BS ) / C BS Among them, C BL Represents the parasitic capacitance between the bit line and ground, C SL Represents the parasitic capacitance between the source line and the ground, C BS represents the parasitic capacitance from the bit line to the source line. This voltage is proportional to the calculated charge Q, which is proportional to the dot product of the input pulse and the weight.
[0049] Figure 8 The weighted sum calculation principle is shown using symmetrical array parasitic capacitance.
[0050] like Figure 8 As shown, a column segment includes 8 columns of storage cells or devices, and a row of 8 devices represents an 8-bit privileged value, represented as W[7:0]. In order to implement weighted sum calculation using the parasitic capacitance of array B, firstly, the above steps 1 to 3 are repeated three times. The first time is used to calculate the column representing W[2]. In the charge distribution process of step 3, 1 column of bit lines is connected in array B; the second time is used to calculate the column representing W[1]. In the charge distribution process of step 3, 2 columns of bit lines are connected in array B; the third time is used to calculate the column representing W[0]. In the charge distribution process of step 3, 4 columns of bit lines are connected in array B.
[0051] Then, after the above three processes are completed, one column is selected from each bit line in array B to hold the charge, and the remaining five columns are cleared, and finally the charge is averaged in eight columns in array B. Assuming that Q[2] is the charge lost by the equivalent capacitor on the bit line when array A calculates W[2], Q[1] is the charge lost by the equivalent capacitor on the bit line when array A calculates W[1], and Q[0] is the charge lost by the equivalent capacitor on the bit line when array A calculates W[0], the voltage V1 obtained in array B after the calculation is completed is expressed as: V1∝Q[2] / 8+Q[1] / 16+Q[0] / 32, and then this voltage is kept unchanged in the last column of array B, and the first seven columns are used to calculate W[5:3].
[0052] Specifically, the above steps 1 to 3 are repeated three times. The first time, the column representing W[5] is calculated, and one column of bit lines is connected in array B in the charge distribution process of step 3. The second time, the column representing W[4] is calculated, and two columns of bit lines are connected in array B in the charge distribution process of step 3. The third time, the column representing W[3] is calculated, and four columns of bit lines are connected in array B in the charge distribution process of step 3. Then, one column is selected from the bit lines in array B after the three processes are completed to keep the charge, and the column with voltage V1 saved after the previous round of calculation is added, and the charge of the remaining four columns is cleared. Finally, the charge of the eight columns in array B is averaged. Assuming that Q[5] is the charge lost by the equivalent capacitance of the bit line when array A calculates W[5], Q[4] is the charge lost by the equivalent capacitance of the bit line when array A calculates W[4], and Q[3] is the charge lost by the equivalent capacitance of the bit line when array A calculates W[3], the voltage V2 obtained in array B after the calculation is completed is expressed as: V2∝Q[5] / 8+Q[4] / 16+Q[3] / 32+Q[2] / 64+Q[1] / 128+Q[0] / 256,
[0053] Furthermore, the voltage V2 is kept unchanged in the last two columns of array B, and three of the first six columns are used to calculate W[7:6]. Steps 1 to 3 are repeated twice. The first time, the column representing W[7] is calculated, and one column of bit lines is connected in array B in the charge distribution process of step 3; the second time, the column representing W[6] is calculated, and two columns of bit lines are connected in array B in the charge distribution process of step 3. Then, one column is selected from each of the bit lines in array B after the two processes are completed to hold the charge, and the charge is averaged in these four columns, together with the two columns that hold the voltage V2 after the previous round of calculation. Assuming that Q[7] is the charge lost by the equivalent capacitor on the bit line when array A calculates W[7], and Q[6] is the charge lost by the equivalent capacitor on the bit line when array A calculates W[6], the voltage V3 obtained in array B after the calculation is expressed as: V3∝Q[7] / 4+Q[6] / 8+Q[5] / 16+Q[4] / 32+Q[3] / 64+Q[2] / 128+Q[1] / 256+Q[0] / 512, thus realizing the shift addition (i.e., binary weighted summation) calculation of different columns. The final obtained voltage V3 is connected to the analog-to-digital converter through switch K6, and the read digital quantity is stored in the shift register and finally stored in the output register to complete the output.
[0054] It should be noted that, since the first array and the second array are symmetrically distributed, the second array can also be used to perform bit-wise matrix-vector multiplication calculations in the neural network, and the first array is used to provide parasitic capacitance to achieve weighted sum calculations. The calculation process is the same as the above process, that is, the first array and the second array can be swapped in function, and the specific circuit working principles are the same, which will not be repeated here.
[0055] Corresponding to the above-mentioned weighted summation in-memory calculation circuit, the present invention also provides a memory, including the above-mentioned weighted summation in-memory calculation circuit; wherein the type of memory may include SRAM, DRAM, RRAM, PCRAM, MRAM, FeRAM, FeFET, etc.
[0056] It should be noted that the specific embodiments of the above-mentioned memory can refer to the description in the weighted sum in-memory calculation circuit embodiment, and will not be described in detail here.
[0057] According to the weighted sum in-memory calculation circuit and memory of the present invention, the area occupied by the additional capacitor to complete the calculation process can be eliminated, the number of times the ADC is turned on can be reduced, the parallelism of the calculation will not be affected, and the system's computing performance and area efficiency can be improved.
[0058] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0059] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A weighted summation in-memory calculation circuit, characterized in that: include: A first array and a second array that are symmetrically distributed, and a peripheral circuit; wherein, When the first array and the second array are disconnected through the peripheral circuit, a precharge voltage and a pulse signal are input to the first array, and a bitwise array vector multiplication operation is performed through the first array; When the first array and the second array are connected through the peripheral circuit, the first array and the second array form a switched capacitor circuit to obtain analog summation and analog weighted summation operations corresponding to the pulse signal through the second array, and output the operation results; The peripheral circuit includes a first peripheral circuit connected to the first array, a second peripheral circuit connected to the second array, and a multiplexing circuit; wherein, The multiplexing circuit includes an operational amplifier, an analog-to-digital converter, a shift register and an output register; The first peripheral circuit includes a first input register, a first pulse generator, a first word line driver, a first read / write circuit, a first switch and precharge circuit, and a first switch circuit arranged corresponding to the first array; The second peripheral circuit includes a second input register, a second pulse generator, a second word line driver, a second read / write circuit, a second switch and precharge circuit, and a second switch circuit which are arranged corresponding to the second array.
2. The weighted sum in-memory calculation circuit according to claim 1, characterized in that: In the first array and the second array, every 8 columns of storage cells are divided into a column segment, and an 8-bit weight is represented by a row of 8 storage cells in the column segment; Furthermore, each of the column segments corresponds to a switch and pre-charging circuit, an operational amplifier, an analog-to-digital converter and a shift register.
3. The weighted sum in-memory calculation circuit according to claim 2, characterized in that: When the first array and the second array are disconnected through the peripheral circuit, the source line of the target column currently calculated in the first array is grounded, and all source lines and bit lines of the remaining columns in the same column segment are short-circuited and precharged to a read voltage through the first switch and the precharge circuit; The equivalent capacitance between the bit line of the target column and ground is: 8*C BL +7*C SL +C BS ; Among them, C BL represents the parasitic capacitance between the bit line and ground, C SL represents the parasitic capacitance between the source line and ground, C BS Represents the parasitic capacitance from the bit line to the source line.
4. The weighted sum in-memory calculation circuit according to claim 3, characterized in that: When the precharge circuit between the first array and the read voltage is disconnected, a corresponding pulse signal is sent on the word line according to the weight in the first input register through an external pulse generator; wherein the number of the pulse signals is proportional to the value in the first input register; The parasitic capacitance C on the bit line BL The charge on the first input register is lost, and the amount of charge lost is equal to the dot product of the input pulse signal and the weight stored in the first input register.
5. The weighted sum in-memory calculation circuit according to claim 4, characterized in that: When the first array and the second array are connected through the peripheral circuit, the negative input terminal of the operational amplifier in the multiplexing circuit is simultaneously connected to the bit line of the target column in the first array and the source line of the corresponding column in the second array, the output terminal of the operational amplifier is connected to the bit line of the second array, and the positive input terminal of the operational amplifier is connected to the read voltage; The first array, the second array and the operational amplifier form a switched capacitor circuit; The midline voltage of the second array is: V BLB =Q*(C BL +C BS ) / (8*C BL +7*C SL +C BS ) / C BS ; Among them, C BL represents the parasitic capacitance between the bit line and ground, C SL represents the parasitic capacitance between the source line and ground, C BS Represents the parasitic capacitance from the bit line to the source line.
6. The weighted sum in-memory calculation circuit according to claim 5, characterized in that: The middle line voltage of the second array is proportional to the amount of lost charge.
7. The weighted sum in-memory calculation circuit according to claim 1, characterized in that: The first array inputs a multi-value voltage through an external digital-to-analog converter, or inputs a binary voltage through a buffer; The output of the second array is converted by the analog-to-digital converter, and the converted digital quantity is stored in the shift register to complete the output.
8. The weighted sum in-memory calculation circuit according to claim 1, characterized in that: The first array and the second array each include N columns and M rows of storage cells; The storage unit is a 1T1R device.
9. A memory comprising the weighted sum in-memory calculation circuit according to any one of claims 1 to 8.
Citation Information
Patent Citations
Storage and calculation integrated circuit, calculation system and calculation method
CN115640839A
In-memory calculation bit line clamping and summation peripheral circuit and application thereof
CN115794728A
