An in-memory approximate full adder

By designing an approximate full adder in a digital in-memory computing system, using XOR gate circuit and AND gate circuit to reduce the number of transistors, the problem of high power consumption and large area of ​​the full adder is solved, and low power consumption and Highly accurate in-memory calculation approximate full adder.

CN117331527BActive Publication Date: 2024-12-03NANJING INST OF INTELLIGENT TECH INST OF MICROELECTRONICS OF THE CHINESE ACAD OF
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311297074.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-09
Publication Date
2024-12-03
Estimated Expiration
2043-10-09

AI Technical Summary

Technical Problem

The full adder in the existing digital in-memory computing system has high power consumption and large area, resulting in low overall energy efficiency and area efficiency, becoming a bottleneck in system development.

Method used

Design an in-memory computing approximate full adder, adopting XOR gate circuit, NGO circuit and AND gate circuit. Through the combination of 6 PMOS transistors and 8 NMOS transistors, an approximate full add operation is achieved, reducing the number of transistors and reducing the number of transistors. Power consumption.

Benefits of technology

It realizes the approximate full adder with low power consumption, small area and full swing characteristics. It reduces power consumption by 69.6% compared to traditional full adder, and maintains high accuracy under input conditions. It is suitable for in-memory computing systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117331527B_ABST
    Figure CN117331527B_ABST
Patent Text Reader

Abstract

The invention discloses an in-memory computing approximate full adder, comprising an XOR gate circuit for receiving a local input signal A and a local input signal B and performing an XOR operation to generate an XOR operation result; a NOT gate circuit for receiving a carry input signal CI and performing a NOT operation to generate a NOT operation result; a first AND gate circuit for receiving the XOR operation result, the NOT operation result and the carry input signal CI and performing an AND operation to generate a local output signal S; a second AND gate circuit for receiving the XOR operation result, the NOT operation result and the carry input signal CI and performing an AND operation to generate a carry output signal CO; the invention can greatly reduce the power consumption and area of ​​the full adder, and at the same time, the full swing output ensures that the full adder can work stably in an addition tree.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an in-memory computing approximate full adder, belonging to the technical field of integrated circuits. Background Art

[0002] In digital in-memory computing systems, the weight data of the neural network is stored in the memory cell array, and the input stimulus is multiplied with the weight data in the memory to obtain several single-bit multiplication results on the same column of memory. These multiplication results are then accumulated through the adder tree and shifted through the shift accumulator to finally obtain a multiplication-addition result. In this process, the power consumption and area of ​​the adder tree account for a large proportion, which reduces the overall energy efficiency and area efficiency of the in-memory computing system and becomes a bottleneck restricting the development of digital in-memory computing systems. Designing a low-power and small-area full adder to replace the original high-power and large-area full adder can improve the system energy efficiency and speed up the computing process. Summary of the invention

[0003] The purpose of the present invention is to overcome the deficiencies in the prior art and provide an in-memory computing approximate full adder to solve the technical problems of high power consumption and large area of ​​the existing full adder.

[0004] To achieve the above object, the present invention is implemented by adopting the following technical solutions:

[0005] In a first aspect, the present invention provides an in-memory computing approximate full adder, comprising:

[0006] The XOR gate circuit is used to receive the local input signal A and the local input signal B and perform XOR operation to generate an XOR operation result;

[0007] A NOT gate circuit is used for receiving a carry input signal CI and performing a NOT operation to generate a NOT operation result;

[0008] A first AND gate circuit is used for receiving an XOR operation result, a NOT operation result and a carry input signal CI and performing an AND operation to generate a local output signal S;

[0009] The second AND gate circuit is used for receiving the XOR operation result, the NOT operation result and the carry input signal CI and performing an AND operation to generate a carry output signal CO.

[0010] Optionally, the XOR gate circuit includes a transistor P1, a transistor P2, a transistor P3, a transistor N1, a transistor N2 and a transistor N3; the gate of the transistor P1 is connected to a local input signal A, a gate of the transistor N1, and sources of the transistors P2 and N2, the drain of the transistor P1 is connected to the gate of the transistor P2, and the source of the transistor P1 is connected to the source of the transistor N1, the transistor N2 and the drain of the transistor P2; the drain of the transistor N1 is connected to the gate of the transistor N2, the drain of the transistor P3 and the drain of the transistor N3; the source of the transistor P3 is connected to a power supply voltage VDD, the gate of the transistor P3 is connected to a local input signal B and a gate of the transistor N3; the source of the transistor N3 is connected to a ground voltage VSS; the common end of the sources of the transistors P1 and N1 and the drains of the transistors N2 and P2 serves as the output end of the XOR gate circuit.

[0011] Optionally, when the local input signal A and the local input signal B are both 0, the transistor N2 is turned on, the transistor N1, the transistor P1, and the transistor P2 are turned off, and the output end of the XOR gate circuit outputs a low level; when the local input signal A is 0 and the local input signal B is 1, the transistor P1 is turned on, the transistor N1, the transistor N2, and the transistor P2 are turned off, and the output end of the XOR gate circuit outputs a high level; when the local input signal A is 1 and the local input signal B is 0, the transistor N2 and the transistor P2 are turned on, the transistor N1 and the transistor P1 are turned off, and the output end of the XOR gate circuit outputs a high level; when the local input signal A and the local input signal B are both 1, the transistor N1 is turned on, the transistor N2, the transistor P1, and the transistor P2 are turned off, and the output end of the XOR gate circuit outputs a low level.

[0012] Optionally, the NOT gate circuit includes a transistor P4 and a transistor N4, the source of the transistor P4 is connected to the power supply voltage VDD, the gate of the transistor P4 is connected to the carry input signal CI and the gate of the transistor N4, the drain of the transistor P4 is connected to the drain of the transistor N4; the source of the transistor N4 is connected to the ground voltage VSS; the common end of the drains of the transistor P4 and the transistor N4 serves as the output end of the NOT gate circuit.

[0013] Optionally, the first AND gate circuit includes a transistor P5, a transistor N5 and a transistor N7, the gate of the transistor P5 is connected to the carry input signal CI and the gate of the transistor N7, the source of the transistor P5 is connected to the output of the XOR gate circuit and the source of the transistor N5, the drain of the transistor P5 is connected to the drain of the transistor N5 and the source of the transistor N7; the source of the transistor N7 is connected to the ground voltage VSS; the gate of the transistor N5 is connected to the output of the NOT gate circuit; the common end of the drains of the transistor P5, the transistor N5 and the transistor N7 serves as the output of the first AND gate circuit.

[0014] Optionally, when the carry input signal CI is 0, the transistor N5 and the transistor P5 are turned on, the transistor N7 is turned off, and the output end of the first AND gate circuit is consistent with the output end of the XOR gate circuit; when the carry input signal CI is 1, the transistor N5 and the transistor P5 are turned off, the transistor N7 is turned on, and the output end of the first AND gate circuit outputs a low level.

[0015] Optionally, the second AND gate circuit includes a transistor P6, a transistor N6 and a transistor N8, the gate of the transistor N6 is connected to the carry input signal CI, the source of the transistor N6 is connected to the output of the XOR gate circuit and the source of the transistor P6, the drain of the transistor N6 is connected to the drains of the transistor P6 and the transistor N8; the source of the transistor N8 is connected to the ground voltage VSS; the gate of the transistor P6 is connected to the output of the NOT gate circuit and the gate of the transistor N8; the common end of the drains of the transistor P6, the transistor N6 and the transistor N8 serves as the output of the second AND gate circuit.

[0016] Optionally, when the carry input signal CI is 1, the transistor N6 and the transistor P6 are turned on, the transistor N8 is turned off, and the output end of the second AND gate circuit is consistent with the output end of the XOR gate circuit; when the carry input signal CI is 0, the transistor N6 and the transistor P6 are turned off, the transistor N8 is turned on, and the output end of the second AND gate circuit outputs a low level.

[0017] Compared with the prior art, the present invention has the following beneficial effects:

[0018] The present invention provides an in-memory computing approximate full adder, which includes 6 PMOS transistors and 8 NMOS transistors. A small number of transistors are used, and they are connected in a preset connection mode to realize an approximate full addition operation function. The structure has the characteristics of low power consumption, small area and full swing. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1The invention discloses a circuit schematic diagram of an in-memory computing approximate full adder provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0021] Embodiment 1:

[0022] like Figure 1 As shown, an in-memory computing approximate full adder includes an XOR gate circuit, a NOT gate circuit, a first AND gate circuit, a second AND gate circuit, a base input signal A, a base input signal B, a carry input signal CI, a base output signal S and a carry output signal CO.

[0023] 1. An XOR gate circuit, for receiving a local input signal A and a local input signal B and performing an XOR operation to generate an XOR operation result; specifically in this embodiment, the XOR gate circuit includes a transistor P1, a transistor P2, a transistor P3, a transistor N1, a transistor N2 and a transistor N3; the gate of the transistor P1 is connected to the local input signal A, the gate of the transistor N1, the sources of the transistor P2 and the transistor N2, the drain of the transistor P1 is connected to the gate of the transistor P2, the source of the transistor P1 is connected to the source of the transistor N1, the transistor N2 and the drain of the transistor P2; the drain of the transistor N1 is connected to the gate of the transistor N2, the drain of the transistor P3 and the drain of the transistor N3; the source of the transistor P3 is connected to the power supply voltage VDD, the gate of the transistor P3 is connected to the local input signal B and the gate of the transistor N3; the source of the transistor N3 is connected to the ground voltage VSS; the common end of the sources of the transistors P1 and N1 and the drains of the transistors N2 and P2 serves as the output end of the XOR gate circuit.

[0024] The working principle of the XOR gate circuit is as follows:

[0025] (1) When the local input signal A and the local input signal B are both 0, transistor N2 is turned on, transistor N1, transistor P1, and transistor P2 are turned off, and the output end of the XOR gate circuit outputs a low level;

[0026] (2) When the local input signal A is 0 and the local input signal B is 1, transistor P1 is turned on, transistor N1, transistor N2, and transistor P2 are turned off, and the output end of the XOR gate circuit outputs a high level;

[0027] (3) When the local input signal A is 1 and the local input signal B is 0, transistors N2 and P2 are turned on, transistors N1 and P1 are turned off, and the output end of the XOR gate circuit outputs a high level;

[0028] (4) When both the local input signal A and the local input signal B are 1, transistor N1 is turned on, transistor N2, transistor P1, and transistor P2 are turned off, and the output end of the XOR gate circuit outputs a low level;

[0029] Thus, the XOR operation is realized using 6 transistors.

[0030] 2. A NOT gate circuit, for receiving a carry input signal CI and performing a NOT operation to generate a NOT operation result; specifically, in this embodiment, the NOT gate circuit includes a transistor P4 and a transistor N4, the source of the transistor P4 is connected to the power supply voltage VDD, the gate of the transistor P4 is connected to the carry input signal CI and the gate of the transistor N4, the drain of the transistor P4 is connected to the drain of the transistor N4; the source of the transistor N4 is connected to the ground voltage VSS; the common end of the drains of the transistor P4 and the transistor N4 serves as the output end of the NOT gate circuit.

[0031] 3. A first AND gate circuit, for receiving an XOR operation result, a NOT operation result and a carry input signal CI and performing an AND operation to generate a local output signal S; specifically, in this embodiment, the first AND gate circuit comprises a transistor P5, a transistor N5 and a transistor N7, the gate of the transistor P5 is connected to the carry input signal CI and the gate of the transistor N7, the source of the transistor P5 is connected to the output end of the XOR gate circuit and the source of the transistor N5, the drain of the transistor P5 is connected to the drain of the transistor N5 and the source of the transistor N7; the source of the transistor N7 is connected to the ground voltage VSS; the gate of the transistor N5 is connected to the output end of the NOT gate circuit; the common end of the drains of the transistors P5, N5 and N7 serves as the output end of the first AND gate circuit.

[0032] The working principle of the first AND gate circuit is as follows:

[0033] When the carry input signal CI is 0, transistors N5 and P5 are turned on, transistor N7 is turned off, and the output end of the first AND gate circuit is consistent with the output end of the XOR gate circuit; when the carry input signal CI is 1, transistors N5 and P5 are turned off, transistor N7 is turned on, and the output end of the first AND gate circuit outputs a low level.

[0034] 4. A second AND gate circuit, for receiving an XOR operation result, a NOT operation result and a carry input signal CI and performing an AND operation to generate a carry output signal CO; specifically, in this embodiment, the second AND gate circuit includes a transistor P6, a transistor N6 and a transistor N8, the gate of the transistor N6 is connected to the carry input signal CI, the source of the transistor N6 is connected to the output end of the XOR gate circuit and the source of the transistor P6, the drain of the transistor N6 is connected to the drains of the transistor P6 and the transistor N8; the source of the transistor N8 is connected to the ground voltage VSS; the gate of the transistor P6 is connected to the output end of the NOT gate circuit and the gate of the transistor N8; the common end of the drains of the transistor P6, the transistor N6 and the transistor N8 serves as the output end of the second AND gate circuit.

[0035] The working principle of the second AND gate circuit is as follows:

[0036] When the carry input signal CI is 1, transistor N6 and transistor P6 are turned on, transistor N8 is turned off, and the output end of the second AND gate circuit is consistent with the output end of the XOR gate circuit; when the carry input signal CI is 0, transistor N6 and transistor P6 are turned off, transistor N8 is turned on, and the output end of the second AND gate circuit outputs a low level.

[0037] In this embodiment, transistors P1, P2, P3, P4, P5, and P6 are all PMOS transistors, and transistors N1, N2, N3, N4, N5, N6, N7, and N8 are all NMOS transistors.

[0038] The outputs of this design are both high and low levels with full swing, and there is no intermediate level, which improves the stability of the circuit.

[0039] The traditional full adder is a digital circuit that implements single-bit addition operations. It contains three input signals, two bit input signals A and B, and a carry input signal CI; and two output signals, a bit output signal S and a carry output signal CO. The output result of the traditional full adder is expressed as follows:

[0040]

[0041]

[0042] The logic relationship truth table of the traditional full adder is shown in Table 1:

[0043] Table 1: Logical relationship truth table of traditional full adder

[0044]

[0045] The full adder of the present invention completes the full addition operation by the following steps:

[0046] 1. Enable input signal, local input signals A, B and carry input signal CI.

[0047] 2. Use the simplest 6T XOR gate to calculate result.

[0048] 3. Using transmission gate logic, calculate and The results are used as the approximate outputs of the local output signal S and the carry output signal CO respectively.

[0049] The logic relationship truth table of the full adder of the present invention is shown in Table 2:

[0050] Table 2: Logical relationship truth table of traditional full adder

[0051]

[0052] Among them, the bold results are the erroneous results output by the circuit of this design.

[0053] By analyzing the characteristics of the neural network data used in in-memory computing, we can see that the data in the network as a whole is sparsely distributed, with a very low probability of "1" and a high probability of "0". After the multiplication operation, the probability of the result being "1" is further reduced. Under this condition, the design of the full adder can be simplified by sacrificing the accuracy of some low-probability results and ensuring the accuracy of higher-probability results, realizing a dedicated full adder based on approximate computing that is suitable for in-memory computing systems, achieving the optimal solution for power consumption, area, and accuracy.

[0054] The traditional full adder uses 28 PMOS / NMOS transistors to realize the function, which consumes a lot of power and has a large area. However, the present invention reduces the number of transistors to 14 by adopting approximate calculation and transmission gate logic, including 8 NMOS transistors and 6 PMOS transistors. According to simulation verification, the power consumption of this design is reduced by 69.6% compared with the traditional 28T full adder, and the result accuracy under most full adder input conditions is achieved. When the probability of "1" in the input data is 1 / 8, the result accuracy of this design can reach 89%. Compared with the reduction in area and power consumption, the slight decrease in calculation accuracy is acceptable.

[0055] Although part of the circuit is built with transmission tube logic, the output result of this design is still full swing by adding two NMOS transistors N7 and N8 to the output. Compared with some designs with a small number of transistors, but the high and low levels of the output cannot reach VDD and VSS, this design has higher stability and will not cause errors in the results due to the extension of the path of the previous and next circuits.

[0056] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0057] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. An in-memory computing approximate full adder, characterized in that: include: The XOR gate circuit is used to receive the local input signal A and the local input signal B and perform XOR operation to generate an XOR operation result; A NOT gate circuit is used for receiving a carry input signal CI and performing a NOT operation to generate a NOT operation result; A first AND gate circuit is used for receiving an XOR operation result, a NOT operation result and a carry input signal CI and performing an AND operation to generate a local output signal S; the first AND gate circuit comprises a transistor P5, a transistor N5 and a transistor N7, the gate of the transistor P5 is connected to the carry input signal CI and the gate of the transistor N7, the source of the transistor P5 is connected to the output end of the XOR gate circuit and the source of the transistor N5, the drain of the transistor P5 is connected to the drain of the transistor N5 and the source of the transistor N7; the source of the transistor N7 is connected to the ground voltage VSS; the gate of the transistor N5 is connected to the output end of the NOT gate circuit; the common end of the drains of the transistor P5, the transistor N5 and the transistor N7 is used as the output end of the first AND gate circuit; The second AND gate circuit is used to receive the XOR operation result, the NOT operation result and the carry input signal CI and perform an AND operation to generate a carry output signal CO; the second AND gate circuit includes a transistor P6, a transistor N6 and a transistor N8, the gate of the transistor N6 is connected to the carry input signal CI, the source of the transistor N6 is connected to the output end of the XOR gate circuit and the source of the transistor P6, the drain of the transistor N6 is connected to the drains of the transistor P6 and the transistor N8; the source of the transistor N8 is connected to the ground voltage VSS; the gate of the transistor P6 is connected to the output end of the NOT gate circuit and the gate of the transistor N8; the common end of the drains of the transistor P6, the transistor N6 and the transistor N8 serves as the output end of the second AND gate circuit.

2. The in-memory computing approximate full adder according to claim 1, characterized in that: The XOR gate circuit includes a transistor P1, a transistor P2, a transistor P3, a transistor N1, a transistor N2 and a transistor N3; the gate of the transistor P1 is connected to a local input signal A, a gate of the transistor N1, and sources of the transistors P2 and N2; the drain of the transistor P1 is connected to the gate of the transistor P2, and the source of the transistor P1 is connected to the source of the transistor N1, the transistor N2 and the drain of the transistor P2; the drain of the transistor N1 is connected to the gate of the transistor N2, the drain of the transistor P3 and the drain of the transistor N3; the source of the transistor P3 is connected to a power supply voltage VDD, the gate of the transistor P3 is connected to a local input signal B and a gate of the transistor N3; the source of the transistor N3 is connected to a ground voltage VSS; the common end of the sources of the transistors P1 and N1 and the drains of the transistors N2 and P2 serves as the output end of the XOR gate circuit.

3. The in-memory computing approximate full adder according to claim 2, characterized in that: When the local input signal A and the local input signal B are both 0, the transistor N2 is turned on, the transistor N1, the transistor P1, and the transistor P2 are turned off, and the output end of the XOR gate circuit outputs a low level; when the local input signal A is 0 and the local input signal B is 1, the transistor P1 is turned on, the transistor N1, the transistor N2, and the transistor P2 are turned off, and the output end of the XOR gate circuit outputs a high level; when the local input signal A is 1 and the local input signal B is 0, the transistor N2 and the transistor P2 are turned on, the transistor N1 and the transistor P1 are turned off, and the output end of the XOR gate circuit outputs a high level; when the local input signal A and the local input signal B are both 1, the transistor N1 is turned on, the transistor N2, the transistor P1, and the transistor P2 are turned off, and the output end of the XOR gate circuit outputs a low level.

4. The in-memory computation approximate full adder according to claim 2, characterized in that: The NOT gate circuit includes a transistor P4 and a transistor N4, the source of the transistor P4 is connected to a power supply voltage VDD, the gate of the transistor P4 is connected to a carry input signal CI and a gate of the transistor N4, the drain of the transistor P4 is connected to the drain of the transistor N4; the source of the transistor N4 is connected to a ground voltage VSS; the common end of the drains of the transistor P4 and the transistor N4 serves as the output end of the NOT gate circuit.

5. The in-memory computation approximate full adder according to claim 1, characterized in that: When the carry input signal CI is 0, the transistor N5 and the transistor P5 are turned on, the transistor N7 is turned off, and the output end of the first AND gate circuit is consistent with the output end of the XOR gate circuit; when the carry input signal CI is 1, the transistor N5 and the transistor P5 are turned off, the transistor N7 is turned on, and the output end of the first AND gate circuit outputs a low level.

6. The in-memory computation approximate full adder according to claim 1, characterized in that: When the carry input signal CI is 1, the transistor N6 and the transistor P6 are turned on, the transistor N8 is turned off, and the output end of the second AND gate circuit is consistent with the output end of the XOR gate circuit; when the carry input signal CI is 0, the transistor N6 and the transistor P6 are turned off, the transistor N8 is turned on, and the output end of the second AND gate circuit outputs a low level.

Citation Information

Patent Citations

  • High-performance approximate full adder gate-level unit

    CN111313890A

  • High-performance configurable approximate full adder

    CN115857870A

  • Digital domain memory calculation method and device based on SRAM (Static Random Access Memory)

    CN116402104A

  • Decimal absolute value adder

    US20130238680A1

  • Digital in-memory computing macro based on approximate arithmetic hardware

    US20230266943A1