Multi-bit full adder based on memory calculation and multi-bit full addition operation control method

文档序号:1736957 发布日期:2019-12-20 浏览:23次 中文

阅读说明:本技术 基于存内计算的多比特全加器、多比特全加运算控制方法 (Multi-bit full adder based on memory calculation and multi-bit full addition operation control method ) 是由 康旺 张留洋 赵巍胜 张有光 于 2019-08-02 设计创作,主要内容包括:本发明提供一种基于存内计算的多比特全加器、多比特全加运算控制方法,该多比特全加器中,非易失性存储单元阵列存储数据并响应于控制信号对其内存储的数据、其上加载的数据执行逻辑运算;该行译码器、该列译码器对该非易失性存储单元阵列进行行列译码;该读写电路用于对该非易失性存储单元阵列进行读写操作;该移位寄存器用于对来自该读写电路的数据进行移位操作,进位寄存器用于暂存该多比特全加器执行全加过程中产生的最高位的进位,通过采用该多比特全加器结合运算控制方法,能够基于存内计算实现多比特操作数之间的全加运算,操作步骤简洁,所需控制信号简单,运算效率高,具有较低的时延和功耗以及电路复杂度。(The invention provides a multi-bit full adder based on memory calculation and a multi-bit full-addition operation control method, wherein in the multi-bit full adder, a nonvolatile memory cell array stores data and responds to a control signal to execute logic operation on the data stored in the nonvolatile memory cell array and the data loaded on the nonvolatile memory cell array; the column decoder and the row decoder perform row-column decoding on the nonvolatile memory cell array; the read-write circuit is used for performing read-write operation on the nonvolatile memory cell array; the shift register is used for shifting data from the read-write circuit, the carry register is used for temporarily storing carry of the highest bit generated in the process that the multi-bit full adder executes full addition, full addition operation among multi-bit operands can be realized based on memory calculation by adopting the multi-bit full adder and combining an operation control method, the operation steps are simple, required control signals are simple, the operation efficiency is high, and the time delay, the power consumption and the circuit complexity are lower.)

1. A memory computation based multi-bit full adder, comprising: the device comprises a nonvolatile memory cell array, a read-write circuit, a row decoder, a column decoder, a carry register and a shift register;

the nonvolatile memory cell array includes: a plurality of nonvolatile memory cells arranged in an array;

each row of nonvolatile memory cells is connected with the row decoder through a word line, each row of nonvolatile memory cells is connected with the row decoder through a bit line, the bit line and the source line of each row of nonvolatile memory cells are connected with the read-write circuit, and the read-write circuit and the carry register are connected with the shift register; wherein:

the nonvolatile memory cell array is used for storing data and responding to a control signal to perform logic operation on the data stored in the nonvolatile memory cell array and the data loaded on the nonvolatile memory cell array;

the row decoder and the column decoder are used for carrying out row-column decoding on the nonvolatile memory cell array;

the read-write circuit is used for performing read-write operation on the nonvolatile storage unit array;

the shift register is used for shifting the data from the read-write circuit and feeding the shifted data back to the read-write circuit;

the carry register is used for temporarily storing the carry of the highest bit generated in the process of executing full addition by the multi-bit full adder.

2. The memory computation-based multibit full adder according to claim 1, wherein the nonvolatile memory cell is a resistive memory cell.

3. The memory computation-based multi-bit full adder according to claim 2, wherein the resistive random access memory unit comprises: a spintronic memory cell, a ferroelectric memory cell, or a phase change memory cell.

4. The memory computation based multi-bit full adder according to claim 1, wherein the non-volatile memory unit comprises: a nonvolatile memory device and a switching element;

one end of the nonvolatile memory device is connected with the bit line, the other end of the nonvolatile memory device is connected with the first end of the switch element, the second end of the switch element is connected with the word line, and the third end of the switch element is connected with the source line.

5. The memory computation-based multi-bit full adder according to claim 4, wherein the non-volatile storage device comprises: a spintronic memory device, a ferroelectric memory device, or a phase change memory device, and other resistive memory devices.

6. A control method for realizing multi-bit full addition operation based on memory calculation is characterized by comprising the following steps:

a logic operation step: simultaneously storing binary addend signals into two rows of nonvolatile storage units, wherein each row of nonvolatile storage units stores the binary addend signals, and one bit of the binary addend signals is stored in each nonvolatile storage unit;

loading a binary addend signal and an exclusive-or operation instruction to a nonvolatile storage unit column with a binary addend signal stored therein so as to enable the nonvolatile storage unit column to execute exclusive-or operation of the binary addend signal and the binary addend signal, wherein the exclusive-or operation result is directly stored in the nonvolatile storage unit column;

loading a binary addend signal and an AND operation instruction to another nonvolatile storage unit column which stores the binary addend signal, so that the nonvolatile storage unit column executes the AND operation of the binary addend signal and the binary addend signal, wherein the AND operation result is directly stored in the nonvolatile storage unit column;

shifting the and operation result by one bit to the left;

judging whether a shift-out bit when the AND operation result is shifted left by one bit is 1 or not;

if yes, temporarily storing the shift-out bit to a carry register;

if not, after temporarily storing the shift-out bit to a carry register, judging whether the AND operation result after left shift by one bit is zero or not;

if the AND operation result after left shift by one bit is zero, obtaining a full addition operation result according to the data in the carry register and the XOR operation result;

and if the AND operation result after the left shift by one bit is not zero, taking the AND operation result after the left shift by one bit as a new binary addend signal, taking the XOR operation result as a new binary addend signal, and returning to the logic operation step.

7. The method of claim 6, wherein the loading the binary addend signal and the XOR operation instruction into a column of nonvolatile memory cells storing the binary addend signal comprises:

according to the binary addend signal, bit lines of all storage units in a non-volatile storage unit column in which a binary addend signal is stored are configured;

and configuring the source line of each memory cell in the nonvolatile memory cell column in which the binary addend signal is stored according to the exclusive-or operation instruction.

8. The method of claim 6, wherein the XOR operation instruction is obtained by inverting the binary addend.

9. The method of claim 6, wherein the loading the binary addend signal and the AND operation instruction to another column of nonvolatile memory cells storing the binary addend signal comprises:

according to the binary addend signal, arranging bit lines of all memory cells in another nonvolatile memory cell column with binary addends;

and loading and configuring the source line of each memory cell in the nonvolatile memory cell column with the binary addend according to the AND operation instruction.

10. A control method for realizing multi-bit full addition operation based on memory calculation is characterized by comprising the following steps:

a logic operation step: simultaneously storing binary addend signals into two rows of nonvolatile storage units, wherein each row of nonvolatile storage units stores the binary addend signals, and one bit of the binary addend signals is stored in each nonvolatile storage unit;

loading a binary addend signal and an exclusive-or operation instruction to a nonvolatile storage unit column with a binary addend signal stored therein so as to enable the nonvolatile storage unit column to execute exclusive-or operation of the binary addend signal and the binary addend signal, wherein the exclusive-or operation result is directly stored in the nonvolatile storage unit column;

loading a binary addend signal and an AND operation instruction to another nonvolatile storage unit column which stores the binary addend signal, so that the nonvolatile storage unit column executes the AND operation of the binary addend signal and the binary addend signal, wherein the AND operation result is directly stored in the nonvolatile storage unit column;

judging whether the AND operation result is zero or not;

if yes, obtaining a full addition operation result according to the data in the carry register and the XOR operation result;

if not, judging whether the highest bit of the AND operation result is 1;

if the highest bit of the AND operation result is 1, temporarily storing the highest bit of the AND operation result to a carry register;

judging whether the AND operation result after left shift by one bit is zero or not;

if the AND operation result after the left shift by one bit is zero, obtaining a full addition operation result according to the data in the carry register and the XOR operation result;

and if the AND operation result after the left shift by one bit is not zero or the highest bit of the AND operation result is not 1, taking the AND operation result after the left shift by one bit as a new binary addend signal, taking the XOR operation result as a new binary addend signal, and returning to the logic operation step.

11. The method of claim 10, wherein the loading the binary addend signal and the xor operation instruction into a column of nonvolatile memory cells storing the binary addend signal comprises:

according to the binary addend signal, bit lines of all storage units in a non-volatile storage unit column in which a binary addend signal is stored are configured;

and configuring the source line of each memory cell in the nonvolatile memory cell column in which the binary addend signal is stored according to the exclusive-or operation instruction.

12. The method of claim 10, wherein the XOR operation instruction is obtained by inverting the binary addend.

13. The method of claim 10, wherein the loading the binary addend signal and the and operation instruction to another column of nonvolatile memory cells storing the binary addend signal comprises:

according to the binary addend signal, arranging bit lines of all memory cells in another nonvolatile memory cell column with binary addends;

and loading and configuring the source line of each memory cell in the nonvolatile memory cell column with the binary addend according to the AND operation instruction.

Technical Field

The invention relates to the field of semiconductor integrated circuits, in particular to a multi-bit full adder based on memory calculation and a control method for realizing multi-bit full addition operation based on memory calculation.

Background

In a conventional von neumann computer architecture, a processor and a memory are separately disposed, and data exchange between the processor and the memory is performed through a bus.

With the rise of applications such as big data, the amount of data to be processed by a computer is rapidly expanding, and the phenomenon that a large amount of data exchange causes higher and higher computation delay and energy consumption ratio is called as a storage wall. Memory walls have become a huge bottleneck to the performance improvement of von neumann architecture computers.

Memory computing is one of the key technologies to solve the problem of memory walls. In-memory computation, as the name implies, is performed in memory. It can make the memory possess certain computing power on the basis of naturally having the storage function. The stored data is subjected to primary processing and then sent to other modules for other forms of operation, so that the serious calculation time delay and power consumption brought by data exchange can be remarkably reduced.

The general-purpose full-addition unit is one of the core components of a Central Processing Unit (CPU) of a computer, and a large number of operations can be decomposed into full-addition operations to be executed.

Currently, a complete set of boolean logic operations within a memory can be implemented by lightweight modifications to the memory array peripheral circuitry in conjunction with basic memory read and write operations. Even though the single-bit full addition operation is realized on a single storage unit by arranging and combining the logical operations, the calculation of full addition and carry needs to go through a plurality of steps, a plurality of registers are needed in the calculation process to store intermediate results, and the requirement on control signals is complex.

Though the multi-bit full adder operation can be realized by combining the single-bit full adders, extremely high time delay and circuit complexity are brought, and the characteristics of high memory calculation efficiency, low time delay and low power consumption cannot be embodied.

Disclosure of Invention

Aiming at the problems in the prior art, the invention provides a multi-bit full adder based on memory calculation and a control method for realizing multi-bit full addition operation based on memory calculation, which can at least partially solve the problems in the prior art.

In order to achieve the purpose, the invention adopts the following technical scheme:

in a first aspect, a multi-bit full adder based on memory computation is provided, including: the device comprises a nonvolatile memory cell array, a read-write circuit, a row decoder, a column decoder, a carry register and a shift register;

the nonvolatile memory cell array includes: a plurality of nonvolatile memory cells arranged in an array;

each row of nonvolatile memory cells is connected with the row decoder through a word line, each row of nonvolatile memory cells is connected with the row decoder through a bit line, the bit line and the source line of each row of nonvolatile memory cells are connected with the read-write circuit, and the read-write circuit and the carry register are connected with the shift register; wherein:

the nonvolatile memory cell array is used for storing data and responding to a control signal to perform logic operation on the data stored in the nonvolatile memory cell array and the data loaded on the nonvolatile memory cell array;

the row decoder and the column decoder are used for carrying out row-column decoding on the nonvolatile memory cell array;

the read-write circuit is used for performing read-write operation on the nonvolatile storage unit array;

the shift register is used for shifting the data from the read-write circuit and feeding the shifted data back to the read-write circuit;

the carry register is used for temporarily storing the carry of the highest bit generated in the process of executing full addition by the multi-bit full adder.

Further, the nonvolatile memory cell is a resistance change memory cell.

Further, the resistive random access memory unit includes: a spintronic memory cell, a ferroelectric memory cell, or a phase change memory cell.

Further, the nonvolatile memory cell includes: a nonvolatile memory device and a switching element;

one end of the nonvolatile memory device is connected with the bit line, the other end of the nonvolatile memory device is connected with the first end of the switch element, the second end of the switch element is connected with the word line, and the third end of the switch element is connected with the source line.

Further, the nonvolatile memory device includes: a spintronic memory device, a ferroelectric memory device, or a phase change memory device, and other resistive memory devices.

In a second aspect, a control method for implementing multi-bit full-addition operation based on in-memory computation is provided, including:

a logic operation step: simultaneously storing binary addend signals into two rows of nonvolatile storage units, wherein each row of nonvolatile storage units stores the binary addend signals, and one bit of the binary addend signals is stored in each nonvolatile storage unit;

loading a binary addend signal and an exclusive-or operation instruction to a nonvolatile storage unit column with a binary addend signal stored therein so as to enable the nonvolatile storage unit column to execute exclusive-or operation of the binary addend signal and the binary addend signal, wherein the exclusive-or operation result is directly stored in the nonvolatile storage unit column;

loading a binary addend signal and an AND operation instruction to another nonvolatile storage unit column which stores the binary addend signal, so that the nonvolatile storage unit column executes the AND operation of the binary addend signal and the binary addend signal, wherein the AND operation result is directly stored in the nonvolatile storage unit column;

shifting the and operation result by one bit to the left;

judging whether a shift-out bit when the AND operation result is shifted left by one bit is 1 or not;

if yes, temporarily storing the shift-out bit to a carry register;

if not, or after the shift-out bit is temporarily stored in the carry register, judging whether the AND operation result after left shift by one bit is zero or not;

if the AND operation result after left shift by one bit is zero, obtaining a full addition operation result according to the data in the carry register and the XOR operation result;

and if the AND operation result after the left shift by one bit is not zero, taking the AND operation result after the left shift by one bit as a new binary addend signal, taking the XOR operation result as a new binary addend signal, and returning to the logic operation step.

Further, the loading the binary addend signal and the xor operation instruction to a column of nonvolatile memory cells storing the binary addend signal includes:

according to the binary addend signal, bit lines of all storage units in a non-volatile storage unit column in which a binary addend signal is stored are configured;

and configuring the source line of each memory cell in the nonvolatile memory cell column in which the binary addend signal is stored according to the exclusive-or operation instruction.

Further, the exclusive or operation instruction is obtained by inverting the binary addend.

Further, the loading the binary addend signal and the and operation instruction to another column of nonvolatile memory cells storing the binary addend signal includes:

according to the binary addend signal, arranging bit lines of all memory cells in another nonvolatile memory cell column with binary addends;

and loading and configuring the source line of each memory cell in the nonvolatile memory cell column with the binary addend according to the AND operation instruction.

In a third aspect, a control method for implementing multi-bit full-addition operation based on in-memory computation is provided, including:

a logic operation step: simultaneously storing binary addend signals into two rows of nonvolatile storage units, wherein each row of nonvolatile storage units stores the binary addend signals, and one bit of the binary addend signals is stored in each nonvolatile storage unit;

loading a binary addend signal and an exclusive-or operation instruction to a nonvolatile storage unit column with a binary addend signal stored therein so as to enable the nonvolatile storage unit column to execute exclusive-or operation of the binary addend signal and the binary addend signal, wherein the exclusive-or operation result is directly stored in the nonvolatile storage unit column;

loading a binary addend signal and an AND operation instruction to another nonvolatile storage unit column which stores the binary addend signal, so that the nonvolatile storage unit column executes the AND operation of the binary addend signal and the binary addend signal, wherein the AND operation result is directly stored in the nonvolatile storage unit column;

judging whether the AND operation result is zero or not;

if yes, obtaining a full addition operation result according to the data in the carry register and the XOR operation result;

if not, judging whether the highest bit of the AND operation result is 1;

if the highest bit of the AND operation result is 1, temporarily storing the highest bit of the AND operation result to a carry register;

judging whether the AND operation result after left shift by one bit is zero or not;

if the AND operation result after the left shift by one bit is zero, obtaining a full addition operation result according to the data in the carry register and the XOR operation result;

and if the AND operation result after the left shift by one bit is not zero or the highest bit of the AND operation result is not 1, taking the AND operation result after the left shift by one bit as a new binary addend signal, taking the XOR operation result as a new binary addend signal, and returning to the logic operation step.

Further, the loading the binary addend signal and the xor operation instruction to a column of nonvolatile memory cells storing the binary addend signal includes:

according to the binary addend signal, bit lines of all storage units in a non-volatile storage unit column in which a binary addend signal is stored are configured;

and configuring the source line of each memory cell in the nonvolatile memory cell column in which the binary addend signal is stored according to the exclusive-or operation instruction.

Further, the exclusive or operation instruction is obtained by inverting the binary addend.

Further, the loading the binary addend signal and the and operation instruction to another column of nonvolatile memory cells storing the binary addend signal includes:

according to the binary addend signal, arranging bit lines of all memory cells in another nonvolatile memory cell column with binary addends;

and loading and configuring the source line of each memory cell in the nonvolatile memory cell column with the binary addend according to the AND operation instruction.

The invention provides a multi-bit full adder based on memory calculation and a control method for realizing the multi-bit full adder based on the memory calculation, wherein in the multi-bit full adder, a nonvolatile memory cell array is used for storing data and responding to a control signal to execute logic operation on the data stored in the nonvolatile memory cell array and the data loaded on the nonvolatile memory cell array; the column decoder and the row decoder are used for performing row-column decoding on the nonvolatile memory cell array; the read-write circuit is used for performing read-write operation on the nonvolatile memory cell array; the shift register is used for shifting data from the read-write circuit and feeding the shifted data back to the read-write circuit, the carry register is used for temporarily storing carry of the highest bit generated in the process that the multi-bit full adder executes full addition, and the method comprises the following steps: a logic operation step: simultaneously storing binary addends into two rows of nonvolatile storage units, wherein each nonvolatile storage unit stores a bit binary number; loading binary addends to the two columns of nonvolatile storage units simultaneously, and loading an exclusive-or operation instruction and an and operation instruction to the two columns of nonvolatile storage units respectively so that the two columns of nonvolatile storage units perform exclusive-or operation and operation on the binary addends and the binary addends respectively; a judging step: judging whether the AND operation result is zero or not; if so, outputting the result of the exclusive or operation as a result of the full addition operation; if not, the AND operation result is shifted to the left by one bit and then is used as a new binary addend, the XOR operation result is used as a new binary addend, and the logic operation step is returned, wherein the full addition operation among the multi-bit operands is realized based on the memory calculation, the operation step is simple, the required control signal is simple, the operation rate is high, the time delay is low, the power consumption is low, the circuit complexity is low, and the effect is more obvious particularly for the application (such as encryption and decryption operation, neural network operation and the like) needing a large amount of addition operation.

In order to make the aforementioned and other objects, features and advantages of the invention comprehensible, preferred embodiments accompanied with figures are described in detail below.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. In the drawings:

FIG. 1 is a schematic diagram of a 1T1R nonvolatile memory cell used in an embodiment of the present invention;

FIG. 2 illustrates the principle of implementing a logical operation using a 1T1R nonvolatile memory cell employed in an embodiment of the present invention;

FIG. 3 illustrates a truth table for a 1T1R nonvolatile memory cell employed in an embodiment of the present invention;

FIG. 4 is a schematic diagram illustrating an embodiment of the present invention that implements a multi-bit full-add operation based on in-memory computation;

FIG. 5 is a circuit diagram of a multi-bit full adder based on memory calculation according to an embodiment of the present invention;

FIG. 6 is a flowchart illustrating a control method for implementing a multi-bit full-add operation based on memory computing according to an embodiment of the present invention;

FIG. 7 is a flowchart illustrating another control method for implementing multi-bit full-addition based on in-memory computation according to an embodiment of the present invention;

FIG. 8 illustrates a multi-bit full adder operation for M [0110] and N [0101] by using the in-memory computation-based multi-bit full adder provided by the embodiment of the present invention.

Detailed Description

In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

The detailed features and advantages of the present invention are described in detail in the following embodiments, which are sufficient for anyone skilled in the art to understand the technical content of the present invention and to implement the present invention, and the related objects and advantages of the present invention can be easily understood by anyone skilled in the art from the disclosure, the claims and the drawings of the present specification. The following examples further illustrate aspects of the present invention in detail, but are not intended to limit the scope of the invention in any way.

It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.

FIG. 1 is a schematic diagram of a 1T1R nonvolatile memory cell structure used in an embodiment of the present invention. As shown in fig. 1, for a new nonvolatile memory, such as a resistive random access memory (ReRAM), a spin torque transfer magnetic random access memory (STT-MRAM), a phase change memory (PCRAM), etc., a memory cell therein is composed of a transistor (denoted as T) for performing access control on the memory cell and a nonvolatile memory device (denoted as R) for storing binary data, which is referred to as a 1T1R nonvolatile memory cell, and a plurality of nonvolatile memory cells are organized in an array form by word lines, bit lines, and source lines.

The resistance of the nonvolatile memory device may have two states, one is a low resistance state and one is a high resistance state, which represent data bits "0" and "1", respectively, or vice versa. The gate of the transistor is connected with a word line, the drain is connected with a bit line after passing through the nonvolatile memory device, the source is connected with a source line, and the source line is generally connected with low level or grounded. The on/off of the transistor can be controlled by controlling the voltage of the word line, thereby controlling the selection of the memory cell. More specifically, when the word line is at a high level, the transistor is in a conducting state, and the memory cell is accessible and can be read and written; when the word line is low, the transistor is in a non-conductive state and the memory cell is inaccessible.

For a 1T1R nonvolatile memory cell as above, three signals typically need to be applied: (1) a write signal (denoted as a, typically applied from a bit line) for access control to the memory cell; (2) currently stored data (denoted as B)i) (ii) a (3) A write control signal (denoted C, typically applied from a source line, which may be a current or a voltage). According to the three signals (STT-MRAM is taken as an example), the data stored next by the memory cell (marked as B)i+1) Can be expressed asAs shown in fig. 2, the truth table is shown in fig. 3.

By the data B stored next to the memory celli+1As can be seen from the analysis, the write signal C can be regarded as a logic function selection signal, which determines the function of the logic calculation, such as when C is equal to "0", "1", andwhen the next data B is stored in the storage uniti+1Are respectively equal to("AND" logic), A + Bi("OR" logic) and("exclusive or" logic). The result of the final calculation (i.e. B)i+1) Directly stored in the memory unit. The logic calculation operation is basically consistent with the normal read-write operation of the memory. Other logic calculation functions can be combined by the above three logic function functions.

Those skilled in the art will appreciate that for other non-volatile memory cells, the A, C signal may be different, or the corresponding logic expressions may be different, but similar in-memory computing functionality may be implemented.

Through a great deal of derivation operations, the inventor finds that multi-bit full addition operation can be realized by combining and using the exclusive or and operation of the memory calculation. Fig. 4 is a schematic diagram illustrating an implementation of a multi-bit full-add operation based on memory computing according to an embodiment of the present invention.

As shown in fig. 4, taking the example of performing the full addition operation on the operand M, N, one of M and N is stored in two columns of nonvolatile memory cells at the same time (data writing is performed by controlling the voltage difference between the bit line and the source line) as data already stored in the nonvolatile memory cells (corresponding to B described above)i) Then, bit lines of a row of nonvolatile memory cells are arranged according to the other of M and N as write signals (corresponding to A) of the nonvolatile memory cells, and then the corresponding exclusive-OR operation is performed according to an exclusive-OR operation command (corresponding to write control signal C, described above) of the nonvolatile memory cells) Configuring a source line of the column of nonvolatile memory cells to enable the column of nonvolatile memory cells to realize the exclusive-OR logic operation of M and N; after that, the bit lines of a column of nonvolatile memory cells are arranged in accordance with the other of M and N as write signals (equivalent to those of nonvolatile memory cells)A) as described above, then configuring the source line of the row of nonvolatile memory cells according to an and operation instruction (corresponding to the write control signal C, where C corresponding to the operation is 0), so that the row of nonvolatile memory cells performs an and operation of M and N, reads the and operation result into a shift register, shifts the and operation result by one bit to the left, and determines whether the shift-out result is 1 when shifting left, if so, stores the shift-out bit into a carry register for temporary storage, and then determines whether the and operation result after shifting left by one bit is zero; if not, directly judging whether the AND operation result after left shift by one bit is zero or not; if the AND operation result after the left shift by one bit is zero, obtaining a full addition operation result of M and N according to the shifted bit and the XOR operation result; and if the AND operation result after the left shift by one bit is not 0, taking the AND operation result after the left shift by one bit as a new addend, taking the XOR operation result of the M and the N times as a new addend, respectively performing the XOR operation and the AND operation again, and executing the judging step until the judging condition is met.

The result of the full addition of M and N is obtained by combining the shift-out bit temporarily stored in the carry register with the result of the xor operation, for example, if the temporarily stored shift-out bit is 1, and the result of the xor operation is 0001, the final result is 1000.

Fig. 5 is a circuit diagram of a multi-bit full adder based on memory calculation according to an embodiment of the present invention. As shown in fig. 5, the memory computation based multi-bit full adder includes: the nonvolatile memory cell array comprises a nonvolatile memory cell array 1, a read-write circuit 4, a row decoder 3, a column decoder 2, a shift register 5 and a carry register 6;

the nonvolatile memory cell array includes: a plurality of nonvolatile memory cells arranged in an array;

each row of nonvolatile memory cells is connected with the row decoder through a word line WL, each row of nonvolatile memory cells is connected with the row decoder through a bit line BL, the bit line and the source line of each row of nonvolatile memory cells are connected with the read-write circuit, and the read-write circuit and the carry register are connected with the shift register; wherein:

the nonvolatile memory cell array is used for storing data and responding to a control signal to perform logic operation on the data stored in the nonvolatile memory cell array and the data loaded on the nonvolatile memory cell array;

the row decoder and the column decoder are used for carrying out row-column decoding on the nonvolatile memory cell array;

the read-write circuit is used for performing read-write operation on the nonvolatile storage unit array;

the shift register is used for shifting the data from the read-write circuit and feeding the shifted data back to the read-write circuit;

the carry register is used for temporarily storing the carry of the highest bit generated in the process of executing full addition by the multi-bit full adder.

According to the technical scheme, the shift register is arranged in the multi-bit full adder and used for shifting data, the carry register is arranged and used for temporarily storing the highest-order carry generated in the full addition process executed by the multi-bit full adder, and the multi-bit full addition operation can be realized by matching the non-volatile storage unit array.

In an alternative embodiment, the nonvolatile memory cell is a resistive memory cell, such as a spintronics memory cell, a ferroelectric memory cell, or a phase change memory cell.

In an alternative embodiment, the non-volatile memory cell comprises: a nonvolatile memory device and a switching element; one end of the nonvolatile memory device is connected with the bit line, the other end of the nonvolatile memory device is connected with the first end of the switch element, the second end of the switch element is connected with the word line, and the third end of the switch element is connected with the source line.

The nonvolatile memory device can be a spintronic memory device, a ferroelectric memory device or a phase change memory device and other resistive memory devices.

In an optional embodiment, the multi-bit full adder may further include: and the input module is connected with the shift register and is used for receiving input data (such as addends, control signals and the like) and inputting the input data into the shift register, and the shift register is transmitted to the read-write circuit.

Fig. 6 is a flowchart illustrating a control method for implementing a multi-bit full-addition operation based on memory computing according to an embodiment of the present invention. As shown in fig. 6, the control method for implementing multi-bit full-addition operation based on memory calculation may include the following steps:

step S1000: and simultaneously storing the binary addend signals into two columns of nonvolatile memory cells.

Specifically, the binary addend signal is loaded to the shift register, the read-write circuit reads data in the shift register, and then the voltage difference between the bit line and the source line is configured according to the data so as to write the binary addend signal into the storage unit.

Wherein each column of nonvolatile memory cells stores the binary addend signal, and each nonvolatile memory cell stores a one-bit binary number (equivalent to B above)i)。

Specifically, the data writing is realized by controlling the row decoder and the column decoder to gate the required nonvolatile memory cells and controlling the voltage difference between the bit lines and the source lines of the gated nonvolatile memory cells.

It should be noted that one end of the nonvolatile memory device in the nonvolatile memory unit is used as an access control end for receiving an operation instruction (corresponding to C described above), the other end is connected to the first end of the switch element, and the second end of the switch element is used as a write end for writing or loading data.

It should be noted that, as will be apparent to those skilled in the art, the switching element may be implemented by a transistor, and the transistor may be a field effect transistor, an enhancement type field effect transistor, a depletion type field effect transistor, or the like.

Of course, the first terminal of the transistor provided in the embodiment of the present invention may be a drain, the second terminal is a gate, and the third terminal is a source, or the first terminal may be a source, the second terminal is a gate, and the third terminal is a drain.

Step S2000: loading a binary addend signal and an exclusive-or operation instruction to a nonvolatile storage unit column in which a binary addend signal is stored, so that the nonvolatile storage unit column executes exclusive-or operation of the binary addend signal and the binary addend signal;

wherein the XOR operation result is directly stored in the non-volatile memory cell column.

Specifically, the binary addend signal is loaded to a shift register and sent to a read-write circuit, and the read-write circuit configures bit lines of all storage units in a nonvolatile storage unit column storing the binary addend according to the binary addend signal; and loading the decoded XOR operation instruction to a read-write circuit, and configuring the source line of each storage unit in the nonvolatile storage unit row with the binary addend by the read-write circuit according to the instruction so as to execute the XOR operation of the binary addend and the binary addend.

The row decoder and the column decoder are controlled to gate a column of nonvolatile storage units in which binary addends are stored, and the read-write circuit is controlled to load binary addend signals to the column of nonvolatile storage units.

It will be understood by those skilled in the art that the binary bits stored in the non-volatile memory cells and loaded thereon are the corresponding bits when performing a full addition operation on the addend and the addend.

Specifically, the binary addend is loaded to the bit line of each memory cell in a non-volatile memory cell column in which a binary addend is stored; and simultaneously, loading the XOR operation instruction to a source line of each storage unit in the nonvolatile storage unit column in which the binary addend is stored.

It should be noted that the XOR operation instruction is the write signal C as described above, and the XOR operation instruction corresponds toBiThe addend stored for the non-volatile memory cell, namely: and obtaining the XOR operation instruction by inverting the binary addend.

S3000: and loading a binary addend signal and an AND operation instruction to another nonvolatile storage unit column which stores the binary addend signal, so that the nonvolatile storage unit column executes the AND operation of the binary addend signal and the binary addend signal.

Wherein the AND operation result is directly stored in the non-volatile memory cell column.

Specifically, a binary addend signal is loaded to a shift register and sent to a read-write circuit, and the read-write circuit configures bit lines of all storage units in a nonvolatile storage unit column storing binary addends according to the binary addend signal; and loading the decoded AND operation instruction to a read-write circuit, configuring the source line of each storage unit in the nonvolatile storage unit column with the binary addend by the read-write circuit according to the instruction, and executing the AND operation of the binary addend and the binary addend.

The and operation instruction is the write signal C as described above, and C corresponding to the operation instruction is 0, that is, the and operation instruction may be an all-zero array or an all-one array, and is set according to circuit requirements.

It should be noted that the sequence of step S200 and step S300 may be interchanged.

Step S4000: the and result is shifted left by one bit.

Specifically, the data in a row of nonvolatile memory cells performing an and operation, i.e., an and operation result, is read by controlling the row decoder, the column decoder, and the read/write circuit, and loaded into the shift register, and the and operation result is shifted by one bit to the left under the control of the shift register.

Step S5000: judging whether a shift-out bit is 1 when the left shift is performed by one bit;

if yes, go to step S6000; otherwise, execute step S7000;

the shift-out bit is the carry of the highest bit generated in the process of executing full addition.

Step S6000: temporarily storing the shift-out bit to a carry register;

specifically, assuming that the and operation result is 1100, after left shifting by one bit, the most significant bit "1" overflows and is stored in the carry register, and finally the bit is complemented by "0", and the shifted data is 1000.

Step S7000: judging whether the AND operation result after left shift by one bit is zero or not;

if yes, executing step S9000; otherwise, executing step S8000;

step S8000: and shifting the AND operation result by one bit to the left to serve as a new binary addend signal, taking the XOR operation result as a new binary addend signal, and returning to the step S1000.

Specifically, the shifted and operation result is sent to the read-write circuit, and the read-write circuit takes the shifted and operation result as a new binary addition number and simultaneously writes the new binary addition number into two rows of nonvolatile storage units, wherein the addresses of the two rows of nonvolatile storage units are different from the addresses of the storage unit rows in which the exclusive-or operation result is stored (the exclusive-or operation result cannot be deleted because the exclusive-or operation result is required to be used subsequently); then reading the result of the XOR operation as a new summand; applying the new addend and the XOR operation instruction to a row of nonvolatile memory cells in which a new binary addend is stored together, and performing XOR operation on the new addend and the new addend; and then, the new addend and the operation instruction are applied to another nonvolatile memory cell column in which a new binary addend is stored, and the new addend are subjected to AND operation, and the judgment step is carried out, and the steps are repeated until the AND operation result is zero.

Step S9000: and obtaining a full addition operation result according to the data in the carry register and the XOR operation result.

Specifically, assuming that the carry stored in the carry register is "1" and the xor operation result is "0001", the full addition operation result is 10001, that is, the carry bit in the carry register is the highest bit, the xor operation result is the next bit, and the value obtained by splicing together is the full addition operation result.

When the circuit is implemented, the splicing process can be realized by reading logic.

By adopting the technical scheme, full addition operation among the multi-bit operands can be realized based on memory calculation, the operation steps are simple, the required control signals are simple, the operation efficiency is high, the time delay is low, the power consumption is low, the circuit complexity is low, and the effect is more obvious especially for applications (such as encryption and decryption operation, neural network operation and the like) needing a large amount of addition operation.

Fig. 7 is a flowchart illustrating another control method for implementing multi-bit full-addition based on memory computing according to an embodiment of the present invention. As shown in fig. 7, the control method for implementing multi-bit full-addition operation based on memory calculation may include the following steps:

step S100: and simultaneously storing the binary addend signals into two columns of nonvolatile memory cells.

Specifically, the binary addend signal is loaded to the shift register, the read-write circuit reads data in the shift register, and then the voltage difference between the bit line and the source line is configured according to the data so as to write the binary addend signal into the storage unit.

Wherein each column of nonvolatile memory cells stores the binary addend signal, and each nonvolatile memory cell stores a one-bit binary number (equivalent to B above)i)。

Specifically, the data writing is realized by controlling the row decoder and the column decoder to gate the required nonvolatile memory cells and controlling the voltage difference between the bit lines and the source lines of the gated nonvolatile memory cells.

It should be noted that one end of the nonvolatile memory device in the nonvolatile memory unit is used as an access control end for receiving an operation instruction (corresponding to C described above), the other end is connected to the first end of the switch element, and the second end of the switch element is used as a write end for writing or loading data.

It should be noted that, as will be apparent to those skilled in the art, the switching element may be implemented by a transistor, and the transistor may be a field effect transistor, an enhancement type field effect transistor, a depletion type field effect transistor, or the like.

Of course, the first terminal of the transistor provided in the embodiment of the present invention may be a drain, the second terminal is a gate, and the third terminal is a source, or the first terminal may be a source, the second terminal is a gate, and the third terminal is a drain.

Step S200: loading a binary addend signal and an exclusive-or operation instruction to a nonvolatile storage unit column in which a binary addend signal is stored, so that the nonvolatile storage unit column executes exclusive-or operation of the binary addend signal and the binary addend signal;

wherein the XOR operation result is directly stored in the non-volatile memory cell column.

Specifically, the binary addend signal is loaded to a shift register and sent to a read-write circuit, and the read-write circuit configures bit lines of all storage units in a nonvolatile storage unit column storing the binary addend according to the binary addend signal; and loading the decoded XOR operation instruction to a read-write circuit, and configuring the source line of each storage unit in the nonvolatile storage unit row with the binary addend by the read-write circuit according to the instruction so as to execute the XOR operation of the binary addend and the binary addend.

The row decoder and the column decoder are controlled to gate a column of nonvolatile storage units in which binary addends are stored, and the read-write circuit is controlled to load binary addend signals to the column of nonvolatile storage units.

It will be understood by those skilled in the art that the binary bits stored in the non-volatile memory cells and loaded thereon are the corresponding bits when performing a full addition operation on the addend and the addend.

Specifically, the binary addend is loaded to the bit line of each memory cell in a non-volatile memory cell column in which a binary addend is stored; and simultaneously, loading the XOR operation instruction to a source line of each storage unit in the nonvolatile storage unit column in which the binary addend is stored.

It should be noted that the XOR operation instruction is the write signal C as described above, and the XOR operation instruction corresponds toBiThe addend stored for the non-volatile memory cell, namely: and obtaining the XOR operation instruction by inverting the binary addend.

S300: and loading a binary addend signal and an AND operation instruction to another nonvolatile storage unit column which stores the binary addend signal, so that the nonvolatile storage unit column executes the AND operation of the binary addend signal and the binary addend signal.

Wherein the AND operation result is directly stored in the non-volatile memory cell column.

Specifically, a binary addend signal is loaded to a shift register and sent to a read-write circuit, and the read-write circuit configures bit lines of all storage units in a nonvolatile storage unit column storing binary addends according to the binary addend signal; and loading the decoded AND operation instruction to a read-write circuit, configuring the source line of each storage unit in the nonvolatile storage unit column with the binary addend by the read-write circuit according to the instruction, and executing the AND operation of the binary addend and the binary addend.

The and operation instruction is the write signal C as described above, and C corresponding to the operation instruction is 0, that is, the and operation instruction may be an all-zero array or an all-one array, and is set according to circuit requirements.

It should be noted that the sequence of step S200 and step S300 may be interchanged.

Step S400: and whether the and operation result is zero is judged.

Specifically, the data in a column of nonvolatile memory cells performing an and operation, that is, an and operation result, is read out by controlling the read/write circuit, and then it is determined whether the and operation result is zero.

If yes, go to step S900; if not, go to step S500.

Step S500: judging whether the highest bit of the AND operation result is 1;

if yes, go to step S600; otherwise, go to step S800;

the most significant bit of the AND operation result is the carry of the most significant bit generated in the process of executing the full addition.

Step S600: temporarily storing the highest bit of the AND operation result to a carry register;

the most significant bit of the AND operation result is temporarily stored to a carry register through the cooperation of the row decoder, the column decoder and the read-write circuit.

Specifically, assuming that the and operation result is 1100, after left shifting by one bit, the most significant bit "1" overflows and is stored in the carry register, and finally the bit is complemented by "0", and the shifted data is 1000.

Step S700: judging whether the AND operation result after left shift by one bit is zero or not;

if yes, go to step S900; otherwise, go to step S800;

step S800: and shifting the and operation result by one bit to the left to serve as a new binary addend signal, taking the exclusive or operation result as a new binary addend signal, and returning to the step S100.

Specifically, the read-write circuit is controlled to output the and operation result to the shift register, the shift register shifts the and operation result by one bit to the left, then the shifted and operation result is sent to the read-write circuit, the read-write circuit takes the shifted and operation result as a new binary addition number and writes the new binary addition number into two rows of nonvolatile storage units, and the addresses of the two rows of nonvolatile storage units are different from the address of the storage unit row in which the exclusive-or operation result is stored (the exclusive-or operation result cannot be deleted because the exclusive-or operation result is required to be used subsequently); then reading the result of the XOR operation as a new summand; applying the new addend and the XOR operation instruction to a row of nonvolatile memory cells in which a new binary addend is stored together, and performing XOR operation on the new addend and the new addend; and then, the new addend and the operation instruction are applied to another nonvolatile memory cell column in which a new binary addend is stored, and the new addend are subjected to AND operation, and the judgment step is carried out, and the steps are repeated until the AND operation result is zero.

Step S900: and obtaining a full addition operation result according to the data in the carry register and the XOR operation result.

Specifically, assuming that the carry stored in the carry register is "1" and the xor operation result is "0001", the full addition operation result is 10001, that is, the carry bit in the carry register is the highest bit, the xor operation result is the next bit, and the value obtained by splicing together is the full addition operation result.

When the circuit is implemented, the splicing process can be realized by reading logic.

By adopting the technical scheme, full addition operation among the multi-bit operands can be realized based on memory calculation, the operation steps are simple, the required control signals are simple, the operation efficiency is high, the time delay is low, the power consumption is low, the circuit complexity is low, and the effect is more obvious especially for applications (such as encryption and decryption operation, neural network operation and the like) needing a large amount of addition operation.

In order to make those skilled in the art better understand the present invention, the following takes the procedure of performing multi-bit full-add operation on M [0110] and N [0101] as an example, and describes the procedure of implementing full-add operation by using the multi-bit full-adder for memory computation and the control method for implementing multi-bit full-add operation based on memory computation provided in the embodiment of the present invention, and refer to fig. 8:

(1) by using the read-write circuit, the row decoder and the column decoder to cooperate with each other, M [0110] is converted into a digital signal]Address A in the write memory arrayiAnd Ai+1The memory cell column of (1);

(2) by using the cooperation of read-write circuit, row decoder and column decoder to convert N [0101]]Load to address AiCorresponding to the memory cell of the memory cell row, and an XOR operation instruction (or write control signal) [1001 ]]Load to address AiSo that the memory cell is corresponding to the memory cell of the memory cell columnElement column pair M [0110]And N [0101]]Performing an XOR operation, the result of which [0011 ]]Directly stored at address AiIn the memory cell column (c).

(3) By using the cooperation of read-write circuit, row decoder and column decoder to convert N [0101]]Load to address Ai+1The corresponding memory cell of the memory cell row, and the AND operation instruction (or called write control signal) [0000 ]]Load to address Ai+1Such that the memory cell column pair M [0110] corresponds to the memory cell of the memory cell column of]And N [0101]]Performing an AND operation, and the result [0100] of the AND operation]Directly stored at address Ai+1In the memory cell column (c).

(4) Read-write circuit, row decoder and column decoder are used together to read address Ai+1And operation result [0100] in corresponding memory cell of memory cell column of]In this case, the and operation result is not 0.

(5) The AND operation result [0100] is input to the shift register by the read-write circuit, the AND operation result [0100] is shifted to the left by the shift register to obtain a shifted AND operation result [1000], and the shifted AND operation result is fed back to the read-write circuit.

(6) The shifted AND operation result [1000] is obtained by using the cooperation of read-write circuit, row decoder and column decoder]The write address is not AiTwo columns of memory cells (e.g., address a)i+1And Ai+2) In (because the address is A)iThe column of memory cells in which the result of the exclusive or operation is stored, which is subsequently used).

(7) The address is A by using the cooperation of read-write circuit, row decoder and column decoderiIs stored in the memory cell column of [0011 ]]And (6) reading.

(8) The read-write circuit, the row decoder and the column decoder are matched to carry out XOR operation on the result [0011 ]]Load to address Ai+1The corresponding memory cell of the memory cell row, and at the same time, the XOR operation instruction (or called write control signal) [0111 ]]Load to address Ai+1So that the memory cell column pair exclusive OR operation result [0011 ]]And the shifted AND operation result [1000]Performing an XOR operation, the result of the XOR operation[1011]Directly stored at address Ai+1In the memory cell column (c).

(9) The read-write circuit, the row decoder and the column decoder are matched to carry out XOR operation on the result [0011 ]]Load to address Ai+2The corresponding memory cell of the memory cell row, and the AND operation instruction (or called write control signal) [0000 ]]Load to address Ai+2So that the memory cell column pair exclusive OR operation result [0011 ]]And the shifted AND operation result [1000]Performing an AND operation, the result of the AND operation [0000 ]]Directly stored at address Ai+2In the memory cell column (c).

(10) The address is A by using the cooperation of read-write circuit, row decoder and column decoderi+2And operation result [0000 ] stored in the memory cell column of (1)]At this time, the AND operation result is zero, and the XOR operation result [1011 ] is obtained]As a final operation result.

The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Although the present invention has been described with reference to the preferred embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, but may be embodied or carried out by various modifications, equivalents and changes without departing from the spirit and scope of the invention.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:模块化多位加法器及计算系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类