An adaptive accumulation overflow control and area and power optimization system and method
The adaptive accumulation overflow control system solves the problems of overflow detection delay and excessive dynamic power consumption in high-speed accumulation with large bit width, and realizes active overflow avoidance and dynamic power consumption optimization in the process of high-speed accumulation with large bit width.
Patent Information
- Application Number
- CN202610922951.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-25
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2046-06-25
AI Technical Summary
In current technologies, overflow detection mechanisms are mostly reactive, leading to response delays and calculation errors. Carry chain correction and segmentation designs are difficult to balance speed and resource consumption, and dynamic power consumption is too high, especially when intermediate results frequently change between positive and negative, causing multiple bit level flips to cause a sharp increase in power consumption.
An adaptive accumulation overflow control system is adopted. The accumulation processing module performs calculations on the current accumulation part and generates an overflow flag when the result exceeds the preset bit width. The overflow processing module performs increment or decrement operations, and the read and write control module automatically generates or calls the next part to realize segmented logic division and cascading transmission of overflow events, thereby avoiding overflow and reducing dynamic power consumption.
It achieves proactive overflow avoidance during high-speed accumulation with large bit width, reduces dynamic power consumption caused by multi-bit level switching, saves hardware area overhead, and overcomes the problems of response delay, excessive dynamic power consumption and high resource consumption of traditional accumulators.
Smart Images

Figure CN122470144B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of adaptive accumulation, and in particular to an adaptive accumulation overflow control and area and power consumption optimization system and method. Background Technology
[0002] In digital integrated circuit design, especially in applications involving large bit width and high-speed computation (such as digital signal processing, convolution operations and neural network accelerators), the performance, accuracy and power consumption of accumulators and adders are key factors that determine the system's energy efficiency.
[0003] Existing accumulator designs typically employ single or segmented adder structures to achieve numerical accumulation. To prevent errors caused by calculation results exceeding the data bit width, the industry generally adopts overflow detection and control mechanisms, such as monitoring the carry chain or setting an overflow flag to capture overflow events. In addition, to address the high power consumption issue caused by large-bit-width operations, some existing designs have introduced saturation accumulation techniques or low-power encoding techniques (such as Gray codes) to reduce the level switching rate.
[0004] However, the aforementioned existing technologies still have the following shortcomings in practical applications:
[0005] First, its overflow handling capability is limited, making it difficult to balance speed and accuracy.
[0006] Traditional overflow detection schemes primarily focus on post-overflow capture, notifying the system via a flag after an overflow occurs. This approach not only requires additional clock cycles to respond but also increases the complexity of the control logic. While saturation accumulation techniques can mitigate error propagation to some extent, truncating to the maximum or minimum value introduces irreversible computational errors in scenarios requiring precise accumulated values. Furthermore, existing carry correction or segmented accumulation designs, while improving speed, often come at the cost of increased circuit area and power consumption, making it difficult to achieve a good balance between high-speed computation, high precision, and large bit width.
[0007] Second, the dynamic power consumption during the large-width accumulation process is too high.
[0008] During continuous accumulation operations in the accumulator, especially when intermediate results frequently transition between positive and negative values, multiple bits on the data bus undergo simultaneous bit flipping. This wide range of level flips causes significant short-circuit current and dynamic power consumption. Although existing technologies attempt to reduce flipping through specific encoding methods, frequent transitions in the sign bit and high-order bits still lead to a sharp increase in power consumption when dealing with irregular accumulation of large-bit-width data, affecting the overall energy efficiency and stability of the chip. Summary of the Invention
[0009] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide an adaptive accumulation overflow control and area and power consumption optimization system and method to solve the following technical problems existing in the prior art in the case of high-speed accumulation with large bit width: On the one hand, the existing overflow detection mechanisms are mostly post-event capture, which leads to response delay and calculation error, and the carry chain correction and segmentation design of high bit width adders are difficult to balance between speed and resource consumption; on the other hand, the frequent positive and negative jumps of intermediate results during the existing accumulation process cause multi-bit level flips, resulting in a sharp increase in dynamic power consumption, and the existing encoding technology is difficult to effectively cope with the power consumption impact caused by irregular data accumulation.
[0010] To achieve the above and other related objectives, this application provides an adaptive accumulation overflow control and area and power consumption optimization system, characterized by comprising: an accumulation processing module, configured to perform an accumulation operation on a first part of the current accumulation sum and at least two external addends to update the first part, and use the updated first part as the first part to be updated in the next accumulation sum; generating a first overflow flag when the result of the accumulation operation exceeds a preset bit width of the first part; and an overflow processing module, connected to the accumulation processing module, configured to receive the first overflow flag, and perform an increment or decrement operation on a second part of the current accumulation sum according to the first overflow flag. The process involves a subtraction operation, and generating a second overflow flag when the result of the increment or subtraction operation exceeds the preset bit width of the second part; a read / write control module, connected to the accumulation processing module and the overflow processing module respectively, is used to transmit the at least two external addends to the accumulation processing module; it is also used to automatically generate or call the next part from memory based on the second overflow flag and transmit it to the overflow processing module so that the overflow processing module can perform an increment or subtraction operation on the next part; wherein the current accumulation sum is divided into multiple parts with preset bit widths, and the multiple parts with preset bit widths include at least the first part and the second part.
[0011] In some embodiments of the first aspect of this application, the accumulation processing module includes: an adder unit, configured to perform an accumulation operation on a first part of the current accumulated sum and the at least two external addends, and output an update result; the update result is the updated first part; and a first register unit, connected to the adder unit, configured to store the first part of the current accumulated sum, configured to have a preset bit width of the first part, and receiving the update result after the accumulation operation is completed, so as to update the first part of the current accumulated sum.
[0012] In some embodiments of the first aspect of this application, the first overflow flag includes: a first overflow flag first bit for indicating whether an addition operation is performed; a first overflow flag second bit for indicating whether a subtraction operation is performed; and a first overflow flag third bit for indicating the magnitude of the operand when the first bit or the second bit indicates that an addition or subtraction operation is performed.
[0013] In some embodiments of the first aspect of this application, the plurality of portions having a preset bit width includes a third portion, and the overflow processing module includes: at least one first overflow processing module connected to the accumulation processing module, configured to receive the first overflow flag, and perform a first increment or first decrement operation on the second portion of the current accumulation according to the first overflow flag; and generate a second overflow flag when the result of the first increment or first decrement operation exceeds the preset bit width of the second portion; and a second overflow processing module connected to the first overflow processing module and the read / write control module, configured to receive the second overflow flag, and perform a second increment or second decrement operation on the third portion of the current accumulation according to the second overflow flag, and trigger the read / write control module to automatically generate or call the next portion from memory when the result of the second increment or second decrement operation exceeds the preset bit width of the third portion, and transmit the next portion to the second overflow processing module so that the second overflow processing module can perform a second increment or second decrement operation on the next portion.
[0014] In some embodiments of the first aspect of this application, the at least one first overflow processing module includes a first identifier register unit, a first increment / decrement unit, and a second register unit; wherein, the first identifier register unit is connected to the accumulation processing module and is used to receive and store the first overflow identifier; the first increment / decrement unit is connected to the first identifier register unit and is used to perform a first increment or first decrement operation on the second part of the current accumulated sum according to the first overflow identifier to update the second part and output the updated second part; a second overflow identifier is generated when the result of the first increment or first decrement operation exceeds a preset bit width of the second part of the current accumulated sum; the second register unit is connected to the first increment / decrement unit and is used to store the second part of the current accumulated sum, is configured to have a preset bit width of the second part, and receives the updated second part after the first increment or first decrement operation is completed to update the second part of the current accumulated sum.
[0015] In some embodiments of the first aspect of this application, the second overflow processing module includes a second identifier register unit, a second increment / decrement unit, and a third register unit; wherein, the second identifier register unit is connected to the first overflow processing module and is used to receive and store the second overflow identifier; the second increment / decrement unit is connected to the second identifier register unit and the read / write control module, and is used to perform a corresponding second increment or second decrement operation on the third part of the current accumulated sum according to the second overflow identifier to update the third part and output the updated third part; and generate a second overflow identifier when the result of the second increment or second decrement operation exceeds the preset bit width of the third part of the current accumulated sum, and transmit it to the second identifier register unit. The system identifies the register unit and the read / write control module to trigger the read / write control module to automatically generate or retrieve the next part from the memory; a third register unit, connected to the second increment / decrement unit and the read / write control module, is used to store the third part of the current accumulated sum, is configured to have a preset bit width of the third part, and receives the updated third part after the second increment or second decrement operation is completed to update the third part of the current accumulated sum; when the result of the second increment or second decrement operation exceeds the preset bit width of the third part of the current accumulated sum, the updated third part is transmitted to the memory through the read / write control module, and the system receives and stores the next part transmitted by the read / write control module.
[0016] In some embodiments of the first aspect of this application, the second overflow flag includes: a first bit of the second overflow flag, used to indicate whether an addition operation is performed; and a second bit of the second overflow flag, used to indicate whether a subtraction operation is performed.
[0017] In some embodiments of the first aspect of this application, the read / write control module includes a most significant portion unit for recording the most significant portion number of the current accumulated sum; the read / write control module, based on the second overflow identifier and according to the most significant portion number, selects to automatically generate the next portion or call the next portion from memory.
[0018] In some embodiments of the first aspect of this application, the read / write control module is further configured to: when the highest bit of the next part automatically generated or retrieved from memory is inconsistent with the sign bit of the current sum, perform a bitwise inversion operation on the next part, and transmit the bitwise inverted result to the overflow processing module, so that the overflow processing module can perform an increment or decrement operation on the bitwise inverted result.
[0019] To achieve the above and other related objectives, a second aspect of this application provides an adaptive accumulation overflow control and area and power consumption optimization method, applied to a read / write control module in the adaptive accumulation overflow control and area and power consumption optimization system. The method includes: performing an accumulation operation on a first part of the current accumulation sum and at least two external addends through an accumulation processing module connected to the read / write control module to update the first part, and using the updated first part as the first part to be updated for the next accumulation sum; generating a first overflow flag when the result of the accumulation operation exceeds a preset bit width of the first part; performing an increment or decrement operation on a second part of the current accumulation sum according to the first overflow flag through the overflow processing module connected to the read / write control module, and generating a second overflow flag when the result of the increment or decrement operation exceeds a preset bit width of the second part; automatically generating or retrieving a next part from memory based on the second overflow flag and transmitting it to the overflow processing module for the overflow processing module to perform an increment or decrement operation on the next part; wherein the current accumulation sum is divided into multiple parts with preset bit widths, and the multiple parts with preset bit widths include at least the first part and the second part.
[0020] As described above, the adaptive accumulation overflow control and area and power consumption optimization system and method of this application have the following beneficial effects: The present invention performs an accumulation operation on a first part of the current accumulation sum and at least two external addends through an accumulation processing module to update the first part, and uses the updated first part as the first part to be updated in the next accumulation sum; when the result of the accumulation operation exceeds a preset bit width of the first part, a first overflow flag is generated; the overflow processing module receives the first overflow flag and performs an increment or decrement operation on a second part of the current accumulation sum according to the first overflow flag, and generates a second overflow flag when the result of the increment or decrement operation exceeds a preset bit width of the second part; the at least two external addends are transmitted to the accumulation processing module through a read / write control module; and based on the second overflow flag, the next part is automatically generated or retrieved from memory and transmitted to the overflow processing module, so that the overflow processing module can perform an increment or decrement operation on the next part. This invention achieves proactive avoidance of overflow and dynamic bit width expansion during the accumulation process by segmenting the logic of the summation and cascading the overflow event. This reduces the dynamic power consumption caused by multi-bit level flipping due to sign changes, saves the hardware area overhead caused by using adders in the high-bit part, and overcomes the technical problems of passive overflow handling, excessive dynamic power consumption and large hardware resource consumption of traditional accumulators. Attached Figure Description
[0021] Figure 1The diagram shown is a structural schematic of an adaptive accumulation overflow control and area and power consumption optimization system according to an embodiment of the present invention.
[0022] Figure 2 The diagram shown illustrates the logical partitioning of the current accumulated sum in a specific embodiment of the present invention.
[0023] Figure 3 The diagram shown is a structural schematic of an adaptive accumulation overflow control and area and power consumption optimization system according to a specific embodiment of the present invention.
[0024] Figure 4 The diagram shown is a flowchart illustrating the adaptive accumulation overflow control and area and power consumption optimization method according to an embodiment of the present invention. Detailed Implementation
[0025] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0026] It should be noted that in the following description, reference is made to the accompanying drawings, which illustrate several embodiments of this application. It should be understood that other embodiments may also be used, and changes in mechanical composition, structure, electrical system, and operation may be made without departing from the spirit and scope of this application. The following detailed description should not be considered limiting, and the scope of the embodiments of this application is defined only by the claims of the published patent. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. Spatially related terms, such as “upper,” “lower,” “left,” “right,” “below,” “below,” “lower part,” “above,” “upper part,” etc., may be used herein to illustrate the relationship between one element or feature shown in the figures and another element or feature.
[0027] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," "fixing," and "holding" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0028] Furthermore, as used herein, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context indicates otherwise. The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data used can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising,” “including,” indicate the presence of the stated features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. It should be further understood that the terms “or” and “and / or” as used herein are interpreted as inclusive, or mean any one or any combination thereof. Thus, “A, B, or C” or “A, B, and / or C” means “any one of: A; B; C; A and B; A and C; B and C; A, B, and C.” An exception to this definition will only occur if the combination of elements, functions, or operations is inherently mutually exclusive in some way.
[0029] This invention provides an adaptive accumulation overflow control and area and power consumption optimization system and method, which is applicable to digital signal processing (DSP), neural network inference and training, image / audio processing, and various hardware acceleration scenarios that require large bit width and high-speed accumulation operations.
[0030] Specifically, in the technical solution of this invention, the present invention performs an accumulation operation on the first part of the current accumulation sum and at least two external addends through an accumulation processing module to update the first part, and uses the updated first part as the first part to be updated in the next accumulation sum; when the result of the accumulation operation exceeds the preset bit width of the first part, a first overflow flag is generated; the first overflow flag is received by the overflow processing module, and an increment or decrement operation is performed on the second part of the current accumulation sum according to the first overflow flag, and a second overflow flag is generated when the result of the increment or decrement operation exceeds the preset bit width of the second part; the at least two external addends are transmitted to the accumulation processing module through a read / write control module; and based on the second overflow flag, the next part is automatically generated or called from memory and transmitted to the overflow processing module, so that the overflow processing module can perform an increment or decrement operation on the next part.
[0031] The technical solutions in the embodiments of the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the invention.
[0032] like Figure 1The diagram shows a structural schematic of an adaptive accumulation overflow control and area and power consumption optimization system 10 according to an embodiment of the present invention, including: an accumulation processing module 101, an overflow processing module 102, and a read / write control module 103.
[0033] The accumulation processing module 101 is used to perform an accumulation operation on the first part of the current accumulation sum and at least two external addends to update the first part, and use the updated first part as the first part to be updated in the next accumulation sum; when the result of the accumulation operation exceeds the preset bit width of the first part, a first overflow flag is generated.
[0034] Specifically, the accumulation processing module 101 performs an accumulation operation on the first part of the current accumulated sum and at least two external addends. The first part is the lowest bit segment of the current accumulated sum in logical division, with a preset bit width value. For example, if the current accumulated sum is 100, its corresponding 8-bit binary representation is 0110 0100, and the last 4 bits (i.e., 0100) are used as the first part. The at least two external addends refer to two or more operands that need to be accumulated into the current accumulated sum. This accumulation operation can simultaneously receive multiple addends for parallel addition. Compared to a traditional two-input adder, it reduces the number of accumulation operations for the same number of operations, thereby improving computational efficiency.
[0035] After performing the accumulation operation, if the result does not exceed the preset bit width of the first part, the accumulation processing module 101 uses the result as the updated first part; if the result exceeds the preset bit width of the first part, the lower bits of the result that are equal to the preset bit width of the first part are used as the updated first part. The updated first part is saved and used as the first part to be updated for the next accumulation, so as to complete the continuous accumulation of multiple external addends.
[0036] Meanwhile, when the calculation result exceeds the preset bit width of the first part, the accumulation processing module 101 generates a first overflow flag and transmits the first overflow flag to the overflow processing module 102, which then performs corresponding increment or decrement operations on the high-order part of the current accumulation.
[0037] Overflow processing module 102, connected to accumulation processing module 101, is used to receive the first overflow flag, perform an increment or decrement operation on the second part of the current accumulation according to the first overflow flag, and generate a second overflow flag when the result of the increment or decrement operation exceeds the preset bit width of the second part.
[0038] Specifically, the overflow processing module 102 receives a first overflow flag from the accumulation processing module 101. As mentioned above, when the accumulation processing module 101 performs an accumulation operation on the first part and the result exceeds the preset bit width of the first part, it generates the first overflow flag. The first overflow flag carries the operation information to be performed, including the operation type (such as addition or subtraction) and the magnitude of the operation value (such as adding 1, subtracting 1, adding 2, subtracting 2, etc.).
[0039] The overflow processing module 102 performs an increment or decrement operation on the second part of the current accumulated sum based on the received first overflow identifier. The second part is the second lowest bit segment of the current accumulated sum in logical division, and has a preset bit width value. For example, if the current accumulated sum is 100, its corresponding 8-bit binary representation is 0110 0100, and the 5th and 6th bits (i.e., 10) counting from the lowest bit are used as the second part. It should be noted that the preset bit width value of the first part and the preset bit width value of the second part can be equal or unequal, depending on the actual situation; this application does not impose any limitations on this.
[0040] After performing an increment or decrement operation, the overflow processing module 102 determines the next step. If the result of the increment or decrement operation does not exceed the preset bit width of the second part, the result is used as the updated second part. If the result exceeds the preset bit width of the second part, the lower bits of the result equal to the preset bit width of the second part are used as the updated second part. The updated second part is saved and used as the next second part to be updated.
[0041] Meanwhile, when the result after the increment or decrement operation exceeds the preset bit width of the second part, the overflow processing module 102 generates a second overflow flag, which is used to indicate that a corresponding increment or decrement operation needs to be performed on the higher part (such as the third part) of the current sum.
[0042] The read / write control module 103 is connected to the accumulation processing module 101 and the overflow processing module 102 respectively, and is used to transmit the at least two external addends to the accumulation processing module 101; it is also used to automatically generate or call the next part from the memory based on the second overflow identifier and transmit it to the overflow processing module 102 so that the overflow processing module 102 can perform increment or decrement operation on the next part.
[0043] Specifically, the read / write control module 103 is used to transmit the at least two external addends to the accumulation processing module 101. Before or during the accumulation operation, the read / write control module 103 obtains the external addends to be accumulated from an external data source (such as a data cache or system bus) and transmits them to the accumulation processing module 101 so that the accumulation processing module 101 can perform the corresponding accumulation operation.
[0044] The read / write control module 103 is also used to automatically generate or retrieve the next part from memory based on the second overflow flag. Specifically, when the read / write control module 103 receives the second overflow flag from the overflow processing module 102, it indicates that the existing part of the current sum (such as the second part) can no longer accommodate the current value range and needs to be expanded to higher bits (for example, currently only the first and second parts exist, and now a third part needs to be expanded). At this time, the read / write control module 103 expands the next part in the following two ways: The first way is to automatically generate the next part, which is usually initialized to zero or other specific values. This method is suitable for the first expansion or continuous expansion of the sum's bit width. The second way is to retrieve the next part from memory. When the current sum already has a stored value for a higher bit part (for example, the accumulation operation is paused and then resumed, or the initial sum itself contains multiple parts), the read / write control module 103 reads the corresponding part from memory and loads it into the overflow processing module 102. This method is suitable for scenarios where an existing accumulation state is reused. In a preferred embodiment, the memory is a static random access memory (SRAM).
[0045] After acquiring the next part, the read / write control module 103 transmits the next part to the overflow processing module 102, so that the overflow processing module 102 can perform an increment or decrement operation on the next part. If the result of the increment or decrement operation exceeds the preset bit width of the next part, the overflow processing module 102 will generate a new second overflow identifier, triggering the read / write control module 103 to repeat the above process and continue to acquire the next part (i.e., the higher bit part) until no new second overflow identifier is generated.
[0046] In this embodiment, the read / write control module 103 includes a read / write controller, which is a read / write control entity in a hardware circuit, such as a Direct Memory Access Controller (DMAC), a Memory Interface Controller, or a Hardware Finite State Machine (FSM).
[0047] In this embodiment, the current sum is divided into multiple portions with a preset bit width, and the multiple portions with a preset bit width include at least the first portion and the second portion.
[0048] In one embodiment of this application, the accumulation processing module 101 includes an adder unit and a first register unit. The adder unit is a hardware adder, such as a carry-lookahead adder or a carry-save adder (CSA), capable of simultaneously receiving multiple addends for parallel addition. The adder unit performs an accumulation operation on the first part of the current accumulated sum and the at least two external addends, and outputs an updated result; the updated result is the updated first part. The first register unit is a hardware register connected to the adder unit, used to store the first part of the current accumulated sum; the first register unit is configured to have a preset bit width of the first part, and receives the updated result after the accumulation operation is completed to update the first part of the current accumulated sum stored therein.
[0049] To facilitate understanding by those skilled in the art, the above accumulation operation process is illustrated below with reference to Examples 1 and 2. It should be specifically noted that this example is only one feasible implementation and does not constitute a limitation on the present invention.
[0050] Example 1:
[0051] Assume the first part has a preset bit width of 4 bits, and the first register unit also has a bit width of 4 bits. The first register unit currently stores the first part value as 0100 (decimal 4). Simultaneously, the two external addends are 0011 (decimal 3) and 0010 (decimal 2). The adder unit receives these three values (0100, 0011, 0010) and performs an accumulation operation, as follows: 0100 + 0011 + 0010 = 1001 (decimal 9). Since the result 1001 does not exceed the representation range of a 4-bit binary number (0-15), the adder unit outputs an updated result of 1001. This updated result is transmitted to the first register unit, which receives the updated result and updates the stored first part from 0100 to 1001 as input for the next accumulation operation.
[0052] Example 2:
[0053] Assume the first part has a preset bit width of 4 bits, and the first register unit also has a bit width of 4 bits. The first register unit currently stores the first part value of 1010 (decimal 10), with two external addends of 0110 (decimal 6) and 0011 (decimal 3). The adder unit performs an accumulation operation: 1010 + 0110 + 0011 = 10011 (decimal 19). Since the result 10011 is a 5-bit binary number, exceeding the preset bit width of 4 bits for the first part, the adder unit uses the lower 4 bits of the result equal to the preset bit width (i.e., 0011) as the updated first part output and generates a first overflow flag. The first register unit receives the updated first part and updates its stored first part from 1010 to 0011 as the input for the next accumulation operation. Simultaneously, the generated first overflow flag is transmitted to the overflow processing module 102 to trigger related operations on the second part.
[0054] In one embodiment of this application, the first overflow flag includes: a first overflow flag first bit, used to indicate whether an addition operation is performed, for example, the first overflow flag first bit being 1 indicates that an addition operation is performed, and being 0 indicates that an addition operation is not performed; a first overflow flag second bit, used to indicate whether a subtraction operation is performed, for example, the first overflow flag second bit being 1 indicates that a subtraction operation is performed, and being 0 indicates that a subtraction operation is not performed; and a first overflow flag third bit, used to indicate the magnitude of the operand value when the first bit or the second bit indicates that an addition or subtraction operation is performed, for example, the first overflow flag third bit being 1 indicates that the operand value is 2, and being 0 indicates that the operand value is 1.
[0055] In one embodiment of this application, the first overflow flag includes 3 bits, with the first bit of the first overflow flag located at the least significant bit and the third bit located at the most significant bit. For example, a first overflow flag of 001 indicates an addition operation with an operand value of +1, and a first overflow flag of 110 indicates a subtraction operation with an operand value of -2.
[0056] In one embodiment of this application, the plurality of portions with preset bit widths includes a third portion, and the overflow processing module 102 includes at least one first overflow processing module and a second overflow processing module. The at least one first overflow processing module is connected to the accumulation processing module 101, and is used to receive a first overflow flag, and perform a first increment or first decrement operation on the second portion of the current accumulation based on the first overflow flag; and generate a second overflow flag when the result of the first increment or first decrement operation exceeds the preset bit width of the second portion.
[0057] Specifically, after performing the first increment or decrement operation, if the operation result does not exceed the preset bit width of the second part, the operation result is used as the updated second part. If the operation result exceeds the preset bit width of the second part, the lower bits of the operation result that are equal to the preset bit width of the second part are used as the updated second part, and the first overflow processing module generates a second overflow flag. This second overflow flag is used to indicate that a corresponding increment or decrement operation needs to be performed on the higher bits of the current sum, thereby realizing the transmission of the overflow event to the higher bits.
[0058] It should be noted that the overflow processing module 102 may include one or more first overflow processing modules. The specific configuration depends on actual needs, and this application does not impose any limitations on it.
[0059] In this embodiment, the second overflow processing module is connected to the first overflow processing module and the read / write control module 103. It is used to receive the second overflow identifier, and perform a second increment or second decrement operation on the third part of the current accumulated sum according to the second overflow identifier. When the result of the second increment or second decrement operation exceeds the preset bit width of the third part, it triggers the read / write control module 103 to automatically generate or call the next part from the memory, and transmits the next part to the second overflow processing module so that the second overflow processing module can perform a second increment or second decrement operation on the next part.
[0060] Specifically, after performing the second increment or second decrement operation, if the operation result does not exceed the preset bit width of the third part, the operation result is used as the updated third part to complete the overflow processing. If the operation result exceeds the preset bit width of the third part, the lower bits of the operation result that are equal to the preset bit width of the third part are used as the updated third part, and the second overflow processing module generates a second overflow flag and transmits the second overflow flag to the read / write control module 103 to trigger the read / write control module 103 to automatically generate or call the next part (e.g., the fourth part, the fifth part, etc.) from memory, and transmits the next part to the second overflow processing module. Subsequently, the second overflow processing module continues to perform the second increment or second decrement operation on the next part until no new second overflow flag is generated.
[0061] In one embodiment of this application, the at least one first overflow processing module includes a first identifier register unit, a first increment / decrement unit, and a second register unit. The first identifier register unit is connected to the accumulation processing module 101 and is used to receive and store the first overflow identifier. In some optional embodiments, the first identifier register unit is a register in hardware circuitry, and the bit width of the register is adapted to the bit width of the first overflow identifier.
[0062] In this embodiment, the first increment / decrement unit is connected to the first flag register unit and is used to perform a first increment or first decrement operation on the second part of the current accumulated sum according to the first overflow flag to update the second part and output the updated second part; a second overflow flag is generated when the result of the first increment or first decrement operation exceeds a preset bit width of the second part of the current accumulated sum. In some optional embodiments, the first increment / decrement unit is an increment / decrement unit in hardware circuitry, such as a hardware counter or an arithmetic logic unit (ALU).
[0063] In this embodiment, the second register unit is connected to the first increment / decrement unit and is used to store the second portion of the current accumulated sum, configured to have a preset bit width of the second portion. In some optional embodiments, the second register unit is a register in hardware circuitry. The second register unit receives the updated second portion after the first increment or first decrement operation is completed, thereby updating the second portion of the current accumulated sum.
[0064] In one embodiment of this application, the second overflow processing module includes a second identifier register unit, a second increment / decrement unit, and a third register unit. The second identifier register unit is connected to the first overflow processing module and is used to receive and store the second overflow identifier. In some optional embodiments, the second identifier register unit is a register in hardware circuitry, and the bit width of the register is adapted to the bit width of the second overflow identifier.
[0065] In this embodiment, the second increment / decrement unit is connected to the second identifier register unit and the read / write control module 103. It is used to perform a corresponding second increment or second decrement operation on the third part of the current accumulated sum according to the second overflow identifier, to update the third part, and output the updated third part. When the result of the second increment or second decrement operation exceeds a preset bit width of the third part of the current accumulated sum, a second overflow identifier is generated and transmitted to the second identifier register unit and the read / write control module 103 to trigger the read / write control module 103 to automatically generate or retrieve the next part from memory. In some optional embodiments, the second increment / decrement unit is an increment / decrement unit in hardware circuitry, such as a hardware counter or an arithmetic logic unit (ALU).
[0066] In this embodiment, the third register unit is connected to the second increment / decrement unit and the read / write control module 103, and is used to store the third part of the current accumulated sum. It is configured to have a preset bit width of the third part. In some optional embodiments, the third register unit is a register in hardware circuitry. The third register unit receives the updated third part after the second increment or decrement operation is completed to update the third part of the current accumulated sum. When the result of the second increment or decrement operation exceeds the preset bit width of the third part of the current accumulated sum, the updated third part is transmitted to the memory through the read / write control module 103, and the next part transmitted by the read / write control module 103 is received and stored.
[0067] In one embodiment of this application, the second overflow flag includes: a first bit of the second overflow flag, used to indicate whether an addition operation is performed, for example, the first bit of the second overflow flag being 1 indicates that an addition operation is performed, and being 0 indicates that an addition operation is not performed; and a second bit of the second overflow flag, used to indicate whether a subtraction operation is performed, for example, the second bit of the second overflow flag being 1 indicates that a subtraction operation is performed, and being 0 indicates that a subtraction operation is not performed.
[0068] In one embodiment of this application, the second overflow flag includes two bits, with the first bit of the second overflow flag located at the least significant bit and the second bit located at the most significant bit. For example, a second overflow flag of 01 indicates an increment operation, a second overflow flag of 10 indicates a decrement operation, and a second overflow flag of 00 indicates no increment or decrement.
[0069] In one embodiment of this application, the read / write control module 103 further includes a highest valid part unit, which is connected to the read / write controller and is used to record the highest valid part number of the current accumulated sum; the read / write controller in the read / write control module 103 selects to automatically generate the next part or call the next part from the memory based on the second overflow identifier and the highest valid part number.
[0070] Specifically, the most significant portion unit is used to track the valid numerical range of the current accumulated sum and record how many portions the current accumulated sum actually occupies. The most significant portion number refers to the number of the portion containing the most significant bit in the current accumulated sum. For example, when only the lower 32 bits of the current accumulated sum are valid, the most significant portion number is 1 (indicating that only the first portion is valid); when it extends to the third portion due to overflow, the most significant portion number is 3 (indicating that all portions from the first to the third are valid, and the most significant bit is in the third portion).
[0071] When the read / write control module 103 receives the second overflow flag, it determines whether the required next part already exists based on the highest valid part number: if the highest valid part number indicates that the next part does not exist (i.e., the number of the part to be expanded is greater than the highest valid part number of the current record), then the read / write control module 103 automatically generates the next part. If the highest valid part number indicates that the next part exists (i.e., the number of the part to be expanded is not greater than the highest valid part number of the current record), then the read / write control module 103 retrieves the corresponding part from the memory.
[0072] In one embodiment of this application, the read / write control module 103 is further configured to perform a bitwise inversion operation on the next part when the highest bit of the automatically generated or retrieved part from the memory is inconsistent with the sign bit of the current sum, and transmit the bitwise inverted result to the overflow processing module 102 so that the overflow processing module 102 can perform an increment or decrement operation on the bitwise inverted result.
[0073] Specifically, when the read / write control module 103 automatically generates or retrieves the next part from memory, the read / write control module 103 further determines whether the highest bit (i.e., the sign bit) of the next part is consistent with the sign bit of the current sum: if the highest bit of the next part is consistent with the sign bit of the current sum, no additional processing is required for the value of that part, and the read / write control module 103 directly transmits that part to the overflow processing module 102. If the highest bit of the next part is inconsistent with the sign bit of the current sum, a bitwise inversion operation is performed on the value of that part (i.e., each 0 becomes 1, and each 1 becomes 0), and the read / write control module 103 transmits the bitwise inverted part to the overflow processing module 102. After receiving the next part, the overflow processing module 102 performs an increment or decrement operation on it.
[0074] It should be noted that by performing the bit-inverting operation described above, this application avoids performing a large-scale level flip on all high-order bits simultaneously when the sign changes. The read / write control module 103 only determines whether to perform a bit-inverting operation on the part when it calls from the memory or automatically generates the next part. This decomposes the large-scale global flip into multiple small-scale local flips, effectively reducing the dynamic power consumption during the accumulation process.
[0075] To better describe the specific implementation scheme of the adaptive accumulation overflow control and area and power consumption optimization system 10, we will now combine... Figure 2 and Figure 3 The specific implementation examples are described below: Specific Implementation Example 1:
[0077] Assuming the initial value of the current accumulated sum is 0, two sets of external addends need to be accumulated consecutively, each set containing two addends: the first set of addends consists of 3 (0011) and 2 (0010), and the second set consists of 6 (0110) and 3 (0011). Assuming the first part has a preset bit width of 4 bits, and the second part has a preset bit width of 4 bits. Initially, the first part is stored in the first register unit of the accumulation processing module 101 with a value of 0000; the second part is stored in the second register unit of the first overflow processing module with a value of 0000. The most significant part is stored as 0.
[0078] Step 1: Add up the first set of addends (3 and 2).
[0079] The adder unit in the accumulation processing module 101 simultaneously receives two external addends, 0011 and 0010, and performs an addition operation with the current value of the first part, 0000: 0000 + 0011 + 0010 = 0101 (decimal 5). The result 0101 does not exceed the preset 4-bit width, and no first overflow flag is generated. The adder unit updates the result 0101 to the first register unit, at which point the current accumulated sum is 5.
[0080] Step 2: Add the second set of addends (6 and 3).
[0081] The adder unit in the accumulation processing module 101 continues to receive two external addends, 0110 and 0011, and performs an addition operation with the first part of the current value 0101: 0101 + 0110 + 0011 = 1110 (decimal 14). The result 1110 does not exceed the preset 4-bit width, and no first overflow flag is generated. The adder unit updates the result 1110 to the first register unit, at which point the current accumulated sum is 14. Specific Implementation Example 2:
[0083] Assume the initial value of the current accumulated sum is -14 (1111 1111 0010), and it is logically divided into three parts with preset bit widths, each part being 4 bits wide: the first part (lowest 4 bits) is 0010, the second part (second lowest 4 bits) is 1111, and the third part (highest 4 bits) is 1111. The sign bit of the current accumulated sum is 1 (negative). The most significant part is numbered 3. All three parts are initially stored in memory, and at the start of the operation, the read / write control module 103 calls them and transfers them to their respective register units. The set of external addends to be accumulated is all -1 (1111).
[0084] Step 1: Accumulation processing module 101 performs accumulation operation.
[0085] The adder unit in the accumulation processing module 101 simultaneously receives two external addends -1 (1111) and performs an addition operation with the current value of the first part, 0010: 0010 + 1111 + 1111 = 10000. The result 10000 exceeds the preset 4-bit width of the first part. The adder unit stores the lower 4 bits (i.e., 0000) of the result, which are equal to the preset width, as the updated first part in the first register unit. At the same time, the adder unit generates a first overflow flag of 001 (indicating addition, incrementing by 1). At this point, the updated first part is 0000.
[0086] Step 2: The first overflow handling module processes the overflow.
[0087] The first overflow processing module's first identifier register unit receives and stores the first overflow identifier, and the first increment / decrement unit performs an increment operation on the second part. The current value of the second part is 1111, and after incrementing by 1, it becomes 10000, exceeding the preset 4-bit width of the second part. The first increment / decrement unit takes the lower 4 bits (i.e., 0000) of the operation result that are equal to the preset width as the updated second part and stores them in the second register unit. At the same time, the first increment / decrement unit generates a second overflow identifier of 01 (indicating an increment operation). At this time, the updated second part is 0000.
[0088] Step 3: The second overflow handling module processes the overflow.
[0089] The second overflow processing module's second identifier register receives and stores the second overflow identifier, and the second increment / decrement unit performs an increment operation on the third part. Since the highest bit of the current value of the third part (1111) matches the sign bit of the current sum, bitwise inversion is unnecessary; the value is directly transmitted to the third register unit via the read / write control module 103. After incrementing, the third part becomes 10000, exceeding the preset 4-bit width. The second increment / decrement unit takes the lower 4 bits (0000) of the result equal to the preset width as the updated third part, stores it in the third register unit, and transmits it to the read / write control module 103. Simultaneously, the second increment / decrement unit generates a second overflow identifier of 01 (indicating an increment operation) and transmits this identifier to the read / write control module 103. At this point, the updated third part is 0000.
[0090] Step 4: The read / write control module 103 automatically generates the fourth part and performs bit-by-bit inversion.
[0091] The read / write controller in the read / write control module 103 receives the second overflow flag and transmits the updated third part in the third register unit to the memory. At the same time, based on the current most significant part number recorded in the most significant part unit (currently 3, indicating that the first, second, and third parts already exist), it determines that a fourth part needs to be extended. Since the number (4) corresponding to the fourth part is greater than the current most significant part number (3), the read / write controller automatically generates the fourth part. The initial value of the newly generated fourth part is 0000. Since the highest bit of this initial value is inconsistent with the sign bit of the current sum, the read / write controller inverts the bits and transmits it to the third register unit. The second increment / decrement unit performs an increment operation on the fourth part to obtain 1111+1=10000, that is, a carry of 1, which further triggers the generation of the fifth part.
[0092] It should be noted that the specific values and calculation results above are only for the purpose of helping to understand the accumulation and overflow handling process of this application, and do not constitute a limitation on the scope of protection of this application.
[0093] It is worth emphasizing that the adaptive accumulation overflow control and area and power consumption optimization system provided in this application achieves at least the following significant effects:
[0094] First, this application achieves proactive detection and step-by-step propagation of overflow events by dividing the current accumulation logic into multiple parts with preset bit widths and employing a cascaded structure of an accumulation processing module, an overflow processing module, and a read / write control module. When an overflow occurs in the lower bit part, the system does not simply discard the carry or perform saturation truncation, but instead triggers an increment or decrement operation in the higher bit part through an overflow flag, thereby fully preserving the numerical precision of the accumulation result. Compared with the post-detection or saturation processing in traditional schemes, this application can proactively avoid the impact of overflow on the accumulation result without introducing computational errors, making it particularly suitable for applications requiring high-precision calculations such as digital signal processing and neural network acceleration.
[0095] Secondly, this application effectively reduces the dynamic power consumption caused by simultaneous flipping of multiple bits due to sign changes during the accumulation process through bit-inversion operations. Specifically, when the sign bit of the accumulated sum is inconsistent with the highest bit of a certain part, the read / write control module only performs a bit-inversion operation on that part, instead of simultaneously performing a global flip on all high-order bits. This mechanism decomposes the large-scale global level flipping during sign changes in traditional schemes into multiple small-scale local flips, thereby significantly reducing short-circuit current and dynamic power consumption. The power consumption optimization effect of this application is even more significant, especially in scenarios where the accumulation result frequently changes between positive and negative.
[0096] Third, this application adopts a hierarchical processing architecture. The lower-order part (first part) uses a full adder for accumulation operations, while the higher-order part (second part and above) only needs to use a simple increment / decrement operator to perform increment or decrement operations. The hardware resource consumption of the increment / decrement operator is much lower than that of an adder of the same width. Therefore, this application maintains comparable computational performance to using a full-width adder while significantly reducing the hardware area.
[0097] IV. This application achieves dynamic expansion of accumulation and bit width through a cascaded overflow handling mechanism. When the numerical range of the accumulated result exceeds the representation capability of the existing part, the read / write control module automatically generates a new part based on the most significant part number, and the second overflow handling module continues to process subsequent overflows. This mechanism enables the accumulator system to support accumulation operations with arbitrarily large bit widths without the need to pre-set a fixed large bit width adder in the hardware. Furthermore, the preset bit width of each part can be flexibly configured according to the application scenario, exhibiting good configurability and scalability.
[0098] V. The accumulation processing module, the first overflow processing module, and the second overflow processing module of this application can work in parallel, forming a highly efficient pipeline structure. The accumulation processing module can continuously receive external addends for accumulation operations without waiting for the overflow processing of the higher-order bits to complete; overflow events are propagated step by step through overflow flags, and each processing module works independently without blocking each other. This pipeline design enables this application to achieve low power consumption and small area while maintaining high computational throughput, meeting the application requirements of high-speed real-time computing.
[0099] Figure 4 This is a flowchart illustrating an embodiment of the adaptive accumulation overflow control and area and power consumption optimization method provided in this application. The method is applied to the read / write control module in the aforementioned adaptive accumulation overflow control and area and power consumption optimization system, and includes:
[0100] Step S41: The accumulation processing module connected to the read / write control module performs an accumulation operation on the first part of the current accumulation and at least two external addends to update the first part, and uses the updated first part as the first part to be updated in the next accumulation; when the result of the accumulation operation exceeds the preset bit width of the first part, a first overflow flag is generated.
[0101] Step S42: The overflow processing module connected to the read / write control module performs an increment or decrement operation on the second part of the current accumulated sum according to the first overflow flag, and generates a second overflow flag when the result of the increment or decrement operation exceeds the preset bit width of the second part.
[0102] Step S43: Based on the second overflow identifier, automatically generate or call the next part from memory and transmit it to the overflow processing module so that the overflow processing module can perform an increment or decrement operation on the next part;
[0103] The current sum is divided into multiple portions with a preset bit width, and the multiple portions with a preset bit width include at least the first portion and the second portion.
[0104] It should be understood that the specific process of performing the above-mentioned steps has been described in detail in the above system embodiments, and will not be repeated here for the sake of brevity.
[0105] In summary, the present invention provides an adaptive accumulation overflow control and area and power consumption optimization system and method. The method involves an accumulation processing module performing an accumulation operation on a first part of the current accumulation sum and at least two external addends to update the first part, and using the updated first part as the first part to be updated in the next accumulation sum. When the result of the accumulation operation exceeds a preset bit width of the first part, a first overflow flag is generated. The overflow processing module receives the first overflow flag and performs an increment or decrement operation on a second part of the current accumulation sum based on the first overflow flag. When the result of the increment or decrement operation exceeds a preset bit width of the second part, a second overflow flag is generated. A read / write control module transmits the at least two external addends to the accumulation processing module. Based on the second overflow flag, a next part is automatically generated or retrieved from memory and transmitted to the overflow processing module, so that the overflow processing module can perform an increment or decrement operation on the next part. This invention achieves proactive avoidance of overflow and dynamic bit width expansion during the accumulation process by segmenting the logic of the summation and cascading the overflow event. This reduces the dynamic power consumption caused by multi-bit level flipping due to sign changes, saves the hardware area overhead caused by using adders in the high-bit part, and overcomes the technical problems of passive overflow handling, excessive dynamic power consumption and large hardware resource consumption of traditional accumulators.
[0106] Therefore, this application effectively overcomes the various shortcomings of the prior art and has high industrial application value.
[0107] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. An adaptive accumulation overflow control and area and power consumption optimization system, characterized in that, include: An accumulation processing module is used to perform an accumulation operation on the first part of the current accumulation sum and at least two external addends to update the first part, and use the updated first part as the first part to be updated in the next accumulation sum; When the result of the accumulation operation exceeds the preset bit width of the first part, a first overflow flag is generated; An overflow processing module, connected to the accumulation processing module, is used to receive the first overflow flag, perform an increment or decrement operation on the second part of the current accumulation based on the first overflow flag, and generate a second overflow flag when the result of the increment or decrement operation exceeds the preset bit width of the second part. The read / write control module is connected to the accumulation processing module and the overflow processing module respectively, and is used to transmit the at least two external addends to the accumulation processing module; it is also used to automatically generate or call the next part from the memory based on the second overflow identifier and transmit it to the overflow processing module so that the overflow processing module can perform increment or decrement operation on the next part; The read / write control module includes a most significant portion unit for recording the most significant portion number of the current accumulated sum. Based on the second overflow flag and the most significant portion number, the read / write control module selects to automatically generate the next portion or call the next portion from memory. When the most significant portion number indicates that the portion number to be expanded is greater than the currently recorded most significant portion number, the next portion is automatically generated. When the most significant portion number indicates that the portion number to be expanded is not greater than the currently recorded most significant portion number, the next portion is called from memory. Furthermore, the read / write control module is also used to: when the highest bit of the next part automatically generated or retrieved from memory is inconsistent with the sign bit of the current sum, perform a bitwise inversion operation on the next part, and transmit the bitwise inverted result to the overflow processing module, so that the overflow processing module can perform an increment or decrement operation on the bitwise inverted result; The current sum is divided into multiple portions with a preset bit width, and the multiple portions with a preset bit width include at least the first portion and the second portion.
2. The adaptive accumulation overflow control and area and power consumption optimization system according to claim 1, characterized in that, The accumulation processing module includes: An adder unit is configured to perform an accumulation operation on the first part of the current accumulated sum and the at least two external addends, and output an updated result; the updated result is the updated first part; The first register unit, connected to the adder unit, is used to store the first part of the current accumulated sum, is configured to have a preset bit width of the first part, and receives the update result after the accumulation operation is completed to update the first part of the current accumulated sum.
3. The adaptive accumulation overflow control and area and power consumption optimization system according to claim 1 or 2, characterized in that, The first overflow flag includes: The first bit of the first overflow flag is used to indicate whether an addition operation is performed. The second bit of the first overflow flag is used to indicate whether a subtraction operation should be performed. The third bit of the first overflow flag is used to indicate the magnitude of the operand when the first bit or the second bit indicates that an addition or subtraction operation is to be performed.
4. The adaptive accumulation overflow control and area and power consumption optimization system according to claim 1, characterized in that, The plurality of portions having a preset bit width includes a third portion, and the overflow processing module includes: At least one first overflow processing module, connected to the accumulation processing module, is configured to receive the first overflow flag, and perform a first increment or first decrement operation on the second part of the current accumulation based on the first overflow flag; and generate a second overflow flag when the result of the first increment or first decrement operation exceeds a preset bit width of the second part; The second overflow processing module, connected to the first overflow processing module and the read / write control module, is used to receive the second overflow identifier, and perform a second increment or second decrement operation on the third part of the current accumulated sum according to the second overflow identifier. When the result of the second increment or second decrement operation exceeds the preset bit width of the third part, the read / write control module is triggered to automatically generate or call the next part from the memory, and the next part is transmitted to the second overflow processing module so that the second overflow processing module can perform a second increment or second decrement operation on the next part.
5. The adaptive accumulation overflow control and area and power consumption optimization system according to claim 4, characterized in that, The at least one first overflow processing module includes a first identifier register unit, a first increment / decrement unit, and a second register unit; in, The first identifier register unit is connected to the accumulation processing module and is used to receive and store the first overflow identifier; The first increment / decrement unit, connected to the first identifier register unit, is used to perform a first increment or first decrement operation on the second part of the current accumulated sum according to the first overflow identifier, so as to update the second part and output the updated second part; and generate a second overflow identifier when the result of the first increment or first decrement operation exceeds the preset bit width of the second part of the current accumulated sum. The second register unit, connected to the first increment / decrement unit, is used to store the second part of the current accumulated sum. It is configured to have a preset bit width of the second part and receives the updated second part after the first increment or first decrement operation is completed, so as to update the second part of the current accumulated sum.
6. The adaptive accumulation overflow control and area and power consumption optimization system according to claim 4, characterized in that, The second overflow processing module includes a second identifier register unit, a second increment / decrement unit, and a third register unit; in, The second identifier register unit is connected to the first overflow processing module and is used to receive and store the second overflow identifier; The second increment / decrement unit, connected to the second identifier register unit and the read / write control module, is used to perform a corresponding second increment or second decrement operation on the third part of the current accumulated sum according to the second overflow identifier, so as to update the third part and output the updated third part; and when the result of the second increment or second decrement operation exceeds the preset bit width of the third part of the current accumulated sum, a second overflow identifier is generated and transmitted to the second identifier register unit and the read / write control module to trigger the read / write control module to automatically generate or call the next part from memory; The third register unit, connected to the second increment / decrement unit and the read / write control module, is used to store the third part of the current accumulated sum. It is configured to have a preset bit width of the third part and receives the updated third part after the second increment or second decrement operation is completed to update the third part of the current accumulated sum. When the result of the second increment or second decrement operation exceeds the preset bit width of the third part of the current accumulated sum, the updated third part is transmitted to the memory through the read / write control module, and the next part transmitted by the read / write control module is received and stored.
7. The adaptive accumulation overflow control and area and power consumption optimization system according to claim 1 or 2, characterized in that, The second overflow flag includes: The first bit of the second overflow flag is used to indicate whether an addition operation is performed. The second bit of the second overflow flag is used to indicate whether a subtraction operation is performed.
8. An adaptive accumulation overflow control and area and power consumption optimization method, characterized in that, A read / write control module applied in an adaptive accumulation overflow control and area and power consumption optimization system as described in any one of claims 1 to 7, the method comprising: An accumulation processing module connected to the read / write control module performs an accumulation operation on the first part of the current accumulation sum and at least two external addends to update the first part, and uses the updated first part as the first part to be updated in the next accumulation sum; when the result of the accumulation operation exceeds the preset bit width of the first part, a first overflow flag is generated. An overflow processing module connected to the read / write control module performs an increment or decrement operation on the second part of the current accumulated sum according to the first overflow flag, and generates a second overflow flag when the result of the increment or decrement operation exceeds the preset bit width of the second part. Based on the second overflow identifier, the next part is automatically generated or called from memory and transmitted to the overflow processing module so that the overflow processing module can perform increment or decrement operations on the next part; The read / write control module includes a most significant portion unit for recording the most significant portion number of the current accumulated sum. Based on the second overflow flag and the most significant portion number, the read / write control module selects to automatically generate the next portion or call the next portion from memory. When the most significant portion number indicates that the portion number to be expanded is greater than the currently recorded most significant portion number, the next portion is automatically generated. When the most significant portion number indicates that the portion number to be expanded is not greater than the currently recorded most significant portion number, the next portion is called from memory. Furthermore, the read / write control module is also used to: when the highest bit of the next part automatically generated or retrieved from memory is inconsistent with the sign bit of the current sum, perform a bitwise inversion operation on the next part, and transmit the bitwise inverted result to the overflow processing module, so that the overflow processing module can perform an increment or decrement operation on the bitwise inverted result; The current sum is divided into multiple portions with a preset bit width, and the multiple portions with a preset bit width include at least the first portion and the second portion.
