Multiplier logic optimization method and compound multiplier
By integrating shift operation logic into the multiplier to form a composite multiplier, the problems of resource redundancy, long paths, and high power consumption in the design of multipliers and shift chains are solved, thereby optimizing hardware resources and improving circuit performance.
Patent Information
- Application Number
- CN202611290683.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-10
AI Technical Summary
Existing technologies for multipliers and shift chains suffer from problems such as hardware resource redundancy, long transmission paths, logic fragmentation, and register level redundancy, resulting in large circuit area, poor timing performance, and high power consumption.
By integrating shift operation logic into the multiplier to form a composite multiplier, the number of logic units is reduced, the critical path is shortened, the number of registers and dynamic power consumption are reduced, and the overall circuit performance and hardware utilization are improved.
While maintaining the same computing power and accuracy, the hardware resource consumption was reduced, the circuit timing performance and power consumption were optimized, and the overall circuit performance and hardware utilization were improved.
Smart Images

Figure CN123070002A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of digital integrated circuit technology, and more specifically, to a multiplier logic optimization method and a composite multiplier. Background Technology
[0002] In digital circuit design, multiplication and shift operations are fundamental operations used very frequently. They are often combined to form a cascaded structure of "multipliers and shift chains," widely used in filters, coordinate transformations, amplitude scaling, fixed-point arithmetic, and artificial intelligence operators. In a typical design flow, compilers and logic synthesis tools will separate the multiplication logic and shift logic into two independent hardware modules according to the code semantics. That is, the multiplier first performs the multiplication of two numbers, and then a shift chain composed of multi-stage shift registers or combinational shift circuits performs left and right shift operations on the multiplication result. Summary of the Invention
[0003] This application provides a method for optimizing multiplier logic and a composite multiplier. While ensuring that the operation function and operation accuracy remain completely unchanged, it reduces logic units, shortens critical paths, reduces the number of registers and dynamic power consumption, and improves the overall circuit performance and hardware utilization.
[0004] This application provides a method for optimizing multiplier logic, including: obtaining the original circuit code or the original gate-level netlist; The target cascaded topology is determined based on the original circuit code or the original gate-level netlist. The target cascaded topology includes cascaded multipliers and shift chains. The shift direction, number of shifts, and shift chain type of the shift chain are determined based on the target cascaded topology. The multiplier is subjected to shift chain logic fusion processing based on the shift direction, shift number, and shift chain type of the shift chain, so as to convert the shift operation into equivalent position weight offset within the multiplier; and the internal logic of the multiplier after shift chain logic fusion processing is simplified to form a composite multiplier. The composite multiplier is verified, and if the verification is successful, the circuit code or gate-level netlist containing the composite multiplier is output.
[0005] In one exemplary embodiment, the shift direction is left shift, the number of shift bits is k bits, where k is a positive integer, and the shift chain type is a combinational logic shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: Each original partial product generated by the multiplier is shifted left by k bits to become the partial product of the corresponding path, so that the multiplier sums all the partial products; and the shift chain is deleted.
[0006] In one exemplary embodiment, the shift direction is a logical right shift, the number of shift bits is k bits, and the shift chain type is a combinational logic shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The data above the lower k bits in the multiplication result of the multiplier are taken as the result of the multiplication and shift operation, and the shift chain is deleted.
[0007] In one exemplary embodiment, the shift direction is an arithmetic right shift, the number of shift bits is k bits, and the shift chain type is a combinational logic shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The highest sign bit in the multiplication result of the multiplier is extended by k bits. The data above the lower k bits in the multiplication result after k-bit extension are used as the result of the multiplication and shift operation, and the shift chain is deleted.
[0008] In one exemplary embodiment, the shift direction is left shift, the number of shift bits is k bits, where k is a positive integer, and the shift chain type is a register-type timing shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: Each original partial product generated by the multiplier is shifted left by k bits to become a partial product, so that the multiplier sums the partial products. Then, delete the intermediate register between the multiplier and the shift chain, and according to the number of shift bits, insert each level of registers in the shift chain into the partial product pipeline and the addition tree pipeline level of the multiplier, and then delete the shift chain.
[0009] In one exemplary embodiment, the shift direction is a logical right shift, the number of shift bits is k bits, and the shift chain type is a register-type sequential shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The data above the lower k bits in the multiplication result of the multiplier are taken as the result of the multiplication and shift operation; Then, delete the intermediate register between the multiplier and the shift chain, and according to the number of shift bits, insert each level of registers in the shift chain into the partial product pipeline and the addition tree pipeline level of the multiplier, and then delete the shift chain.
[0010] In one exemplary embodiment, the shift direction is an arithmetic right shift, the number of shift bits is k bits, and the shift chain type is a register-type sequential shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The highest sign bit in the multiplication result of the multiplier is extended by k bits, and the data above the lower k bits in the multiplication result after k-bit extension are used as the result of the multiplication and shift operation. Then, the intermediate registers between the multiplier and the shift chain are deleted. Based on the number of shift bits, each level of registers in the shift chain is inserted into the partial product pipeline and the addition tree pipeline level of the multiplier, and then the shift chain is deleted.
[0011] The execution entity of the multiplier logic optimization method can be a computer program, such as an EDA software tool.
[0012] This application also provides a composite multiplier, which is generated according to the multiplier logic optimization method described in any of the above embodiments; The composite multiplier includes an input layer, an operational kernel layer, and an output layer; The input layer is configured to input the multiplier and the multiplicand; The computation kernel layer is configured to perform multiplication and shift operations based on the multiplier, multiplicand, and shift bits. The output layer is configured to output the results of multiplication and shift operations.
[0013] In one exemplary embodiment, the computation kernel layer includes a partial product generation unit, a bit offset unit, and an addition tree; The partial product generation unit is configured to generate each original partial product based on the multiplier and the multiplicand; The bit offset unit is configured to shift each original partial product of a path to the left by k bits to obtain the corresponding partial product of the path, where k is the number of shift bits and k is a positive integer. The addition tree is configured to perform a summation operation on all partial products.
[0014] In one exemplary embodiment, the computation kernel layer includes a partial product generation unit, an addition tree, and a first truncation unit; The partial product generation unit is configured to generate the original partial product based on the multiplier and the multiplicand; The addition tree is configured to sum the original partial products to obtain the multiplication result; The first truncation unit is configured to take the data above the lower k bits in the original multiplication result as the result of the multiplication and shift operation, where k is the number of shift bits and k is a positive integer.
[0015] In one exemplary embodiment, the computation kernel layer includes a partial product generation unit, an addition tree, a sign extension unit, and a second truncation unit; The partial product generation unit is configured to generate the original partial product according to the multiplier and multiplicand in accordance with the rules of signed number arithmetic. The addition tree is configured to perform a summation operation on the original partial products to obtain the multiplication result; The sign extension unit is configured to extend the highest sign bit in the multiplication result by k bits, where k is the number of shifts and k is a positive integer. The second truncation unit is configured to take the data above the lower k bits in the result of the multiplication operation after k-bit extension as the result of the multiplication and shift operation.
[0016] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description and the accompanying drawings. Attached Figure Description
[0017] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0018] Figure 1 This is a schematic diagram of a multiplier logic optimization method according to an embodiment of this application; Figure 2 This is a schematic diagram of a composite multiplier according to an embodiment of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be arbitrarily combined with each other.
[0020] The applicant of this application has discovered, through research, that the prior art has the following obvious defects: 1) Redundant hardware resources and high unit overhead. The multiplier itself consists of a large number of addition trees, AND gates, OR gates and other combinational logic, and the shift chain is built up step by step by multiplexers, interconnects and registers. When the two-level modules are implemented independently, a large number of basic logic units, wiring resources and registers are repeatedly introduced, resulting in a high overall circuit area and component utilization rate. In FPGA and low-power ASIC scenarios, resource waste is significant.
[0021] 2) Long transmission path and poor timing performance Multipliers are combinational logic with large delays. The shift chain has multiple levels of logic or register jumps. The cascading of these two will further lengthen the total delay of the critical path, causing the circuit's maximum operating frequency to drop. This makes it prone to setup time violations and significantly increases the difficulty of timing convergence.
[0022] 3) Fragmented logic, unable to be simplified globally. Traditional synthesis tools only perform local logic optimization on multipliers and shift chains separately. They cannot recognize the mathematical equivalence of the compound operation of "multiplication + shift", and cannot merge logic or eliminate redundant nodes from the essence of the operation, thus limiting the depth of optimization.
[0023] 4) Redundancy in register stages, resulting in high power consumption. If the shift chain adopts a timing shift structure, a large number of intermediate registers will be inserted between the multiplier output and the shift chain, and between each stage of the shift chain. This will not only increase the clock load, but also bring additional dynamic power consumption, which is not conducive to low power consumption design requirements.
[0024] To address the aforementioned issues, this application proposes a multiplier logic optimization method and a composite multiplier, which can integrate shift operation logic into the multiplier, achieving the integration of multiplication and shift operation logic, while reducing resources, compressing path latency, and lowering power consumption.
[0025] Figure 1 This is a schematic diagram of the multiplier logic optimization method according to an embodiment of this application, as shown below. Figure 1 As shown, the battery capacity correction model construction method includes the following steps 11 to 15: Step 11: Obtain the original circuit code or the original gate-level netlist; Step 12: Determine the target cascaded topology based on the original circuit code or the original gate-level netlist. The target cascaded topology includes cascaded multipliers and shift chains. Step 13: Determine the shift direction, shift number, and shift chain type of the shift chain based on the target cascaded topology; Step 14: Perform shift chain logic fusion processing on the multiplier according to the shift direction, shift number, and shift chain type of the shift chain to convert the shift operation into equivalent position weight offset within the multiplier; and simplify the internal logic of the multiplier after the shift chain logic fusion processing to form a composite multiplier. Step 15: Verify the composite multiplier. If the verification is successful, output the circuit code or gate-level netlist containing the composite multiplier.
[0026] The multiplier logic optimization method of this application identifies a target cascaded topology based on the original circuit code or the original gate-level netlist. The target cascaded topology includes cascaded multipliers and shift chains. The method determines the shift direction, number of shifts, and shift chain type of the identified target cascaded topology. It then performs shift chain logic fusion processing based on these parameters and simplifies the internal logic of the multipliers after the shift chain logic fusion processing to form a composite multiplier. The composite multiplier is then verified. If verification is successful, the composite multiplier replaces the target cascaded topology. This reduces logic units, shortens critical paths, lowers the number of registers and dynamic power consumption, and improves overall circuit performance and hardware utilization while ensuring that the computational function and accuracy remain completely unchanged.
[0027] For example, the original circuit code can be RTL code.
[0028] For example, based on the RTL code or gate-level netlist, the circuit operation links are traversed to identify the cascaded topology of multipliers and shift chains. Here, the shift chain is the shift chain located after the multiplier.
[0029] For example, the shift direction may include left shift, logical right shift, and algorithmic right shift.
[0030] For example, shift chain types may include combinational logic shift chains and sequential register shift chains.
[0031] In one exemplary embodiment, the shift direction is left shift, the number of shift bits is k bits, where k is a positive integer, and the shift chain type is a combinational logic shift chain; The shift chain logic fusion process based on the shift direction, shift number, and shift chain type of the target cascaded topology may include: Each original partial product generated by the multiplier is shifted left by k bits to become the partial product of the corresponding path, so that the multiplier sums all the partial products; and the shift chain is deleted.
[0032] This application embodiment implements the shift logic of the shift chain within the multiplier by bit offsetting the partial product, eliminating the need for a separate shift chain. While ensuring that the operation function and accuracy remain completely unchanged, it reduces logic units, shortens the critical path, reduces the number of registers and dynamic power consumption, and improves the overall circuit performance and hardware utilization.
[0033] For example, 0110 shifted 2 bits to the left results in 011000.
[0034] For example, in an FPGA digital filter circuit, the original structure includes a 16-bit unsigned array multiplier and a 3-bit fixed left-shift combination shift chain. Netlist analysis confirmed that the multiplier is a 16-bit unsigned array, the shift chain is placed at the end, and the shift direction is left-shifting with a fixed shift value of 3 bits. Using the above method, a logic transformation is performed: each partial product of the multiplier is uniformly shifted 3 bits to the left, and the partial product after the 3-bit left shift is input into an adder tree for summation. Circuit reconstruction is then performed, removing the post-shift chain, including all shift selectors and shift connections. Verification shows that after merging the shift chain into the multiplier, the simulation output is the same as the original structure. However, timing analysis shows that compared to the original structure, the structure with the shift chain merged into the multiplier has approximately 18% lower latency on the critical path and approximately 15% less lookup table usage.
[0035] In multiplier design, the core of Boolean simplification lies in optimizing the generation and compression process of partial products, thereby improving computational speed and reducing hardware resource consumption. Merging shift chains causes bit weight shifts within the multiplier, thus altering the Boolean simplification result. Typical Boolean simplification methods include Booth encoding, Karnaugh map simplification of partial product generation logic, and replacing serial addition with a 3:2 / 4:2 compressor. For example, recalculating partial products using Booth encoding transforms a continuous sequence of "1" multipliers into a "high-bit addition, low-bit subtraction" operation, reducing the number of non-zero partial product rows. For example, for N... 011110. Traditional methods require generating four non-zero partial products and accumulating them four times. Booth coding generates two partial products (an addition that shifts N left by 5 bits and a subtraction that shifts N left by 1 bit), reducing the number of partial products and lowering the height of the adder tree, thereby optimizing the multiplier.
[0036] In one exemplary embodiment, the shift direction is a logical right shift, the number of shift bits is k bits, and the shift chain type is a combinational logic shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type may include: The data above the lower k bits in the multiplication result of the multiplier are taken as the result of the multiplication and shift operation, and the shift chain is deleted.
[0037] For example, if the result of the multiplication operation of the multiplier is 01101100, k is 2 bits. The value of the lower 2 bits is discarded, and the data above the lower 2 bits, 011011, is taken as the result of the multiplication and shift operation.
[0038] In one exemplary embodiment, the shift direction is an arithmetic right shift, the number of shift bits is k bits, and the shift chain type is a combinational logic shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type may include: The highest sign bit in the multiplication result of the multiplier is extended by k bits. The data above the lower k bits in the multiplication result after k-bit extension are used as the result of the multiplication and shift operation, and the shift chain is deleted.
[0039] This embodiment extends the highest sign bit of the multiplication result by k bits, and uses the data above the lower k bits of the multiplication result after k-bit extension as the result of the multiplication and shift operation. This achieves a shift direction of arithmetic right shift, a shift number of k bits, and a shift chain type of combinational logic shift chain. The shift logic of the shift chain is implemented inside the multiplier, eliminating the need for a separate shift chain. Under the premise of ensuring that the operation function and operation accuracy remain completely unchanged, it reduces logic units, shortens the critical path, reduces the number of registers and dynamic power consumption, and improves the overall circuit performance and hardware utilization.
[0040] For example, in a fixed-point DSP arithmetic circuit, the original structure includes a 32-bit signed Booth multiplier and a subsequent 4-bit arithmetic right shift chain. By analyzing the netlist, the shift direction is determined to be arithmetic right shift, the number of shift bits is 4, and the shift chain type is a combinational logic shift chain. By performing the signed multiplication operation normally in the multiplier, the sign bit is extended by 4 bits at the output of the adder tree, and the lower 4 bits are truncated. Furthermore, the independent arithmetic shift circuit is removed, and the sign extension and bit truncation logic are embedded into the multiplier output. While maintaining the same operational accuracy, the number of combinational logic stages is reduced, increasing the circuit's maximum operating frequency.
[0041] In one exemplary embodiment, the shift direction is left shift, the number of shift bits is k bits, where k is a positive integer, and the shift chain type is a register-type timing shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type may include: Each original partial product generated by the multiplier is shifted left by k bits to become a partial product, so that the multiplier sums the partial products. Then, the intermediate registers between the multiplier and the shift chain are deleted. Based on the number of shift bits, each level of registers in the shift chain is inserted into the partial product pipeline and the addition tree pipeline level of the multiplier, and then the shift chain is deleted.
[0042] For example, the intermediate register is the register between the multiplier and the shift chain.
[0043] There are various methods for implementing a multiplier pipeline architecture, with hierarchical partitioning based on an addition tree being the most intuitive. For example, in a 16-bit signed number pipelined multiplier, after generating partial products, it is divided into five pipeline stages: Stages 1-4: Each stage contains numerous adders responsible for pairwise addition of the intermediate results from the previous stage. As the hierarchy deepens, the number of data pairs involved in the addition gradually halves. Stage 5 (output stage): Completes the final accumulation, handles sign bit conversion, and outputs the final two's complement result. This structure significantly improves system throughput through parallel processing of multiple adders. Registers can be inserted into each layer of the pipeline to optimize timing. For example, in a fused shift chain with two levels of registers, these can be inserted into the third and fifth levels respectively, ensuring functional consistency while optimizing the multiplier's timing logic.
[0044] In one exemplary embodiment, the shift direction is a logical right shift, the number of shift bits is k bits, and the shift chain type is a register-type sequential shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The data above the lower k bits in the multiplication result of the multiplier are taken as the result of the multiplication and shift operation; Then, delete the intermediate register between the multiplier and the shift chain, and according to the number of shift bits, insert each level of registers in the shift chain into the partial product pipeline and the addition tree pipeline level of the multiplier, and then delete the shift chain.
[0045] For example, in a high-speed data acquisition circuit, the original structure includes a pipelined multiplier and a timing right shift chain consisting of multiple levels of registers. By analyzing the netlist, the shift direction is determined to be a logical right shift, the number of shift bits is k bits (where k is a positive integer), and the shift chain type is a register-type timing shift chain. Following the above method, right shift truncation is performed at the output of the multiplier's adder tree. This means discarding the lower k bits of data in the multiplier's result and removing the intermediate registers between the multiplier and the shift chain, embedding each level of the shift chain's registers into the multiplier's pipeline level. This reduces the overall number of registers, lowers clock power consumption, maintains the same pipeline throughput, and significantly increases timing margin.
[0046] In one exemplary embodiment, the shift direction is an arithmetic right shift, the number of shift bits is k bits, and the shift chain type is a register-type sequential shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The highest sign bit in the multiplication result of the multiplier is extended by k bits, and the data above the lower k bits in the multiplication result after k-bit extension are used as the result of the multiplication and shift operation. Then, delete the intermediate register between the multiplier and the shift chain, and according to the number of shift bits, insert each level of registers in the shift chain into the partial product pipeline and the addition tree pipeline level of the multiplier, and then delete the shift chain.
[0047] In one exemplary embodiment, verifying the composite multiplier may include functional simulation and static timing analysis. Functional simulation of the composite multiplier circuit compares the input-output results with the original "multiplier + shift chain" circuit to ensure complete equivalence in operational accuracy and logical function. Static timing analysis is performed on the reconstructed composite multiplier circuit to verify that critical path delays and setup / hold times meet design constraints.
[0048] In one exemplary embodiment, if verification fails, i.e. if there is a timing or precision deviation, the partial product offset bits or truncation position are adjusted back, and the composite multiplier is regenerated.
[0049] Figure 2 This is a schematic diagram of a composite multiplier according to an embodiment of this application. The composite multiplier is generated according to the multiplier logic optimization method described in any of the above embodiments. Figure 2 As shown, the composite multiplier includes an input layer, an operational kernel layer, and an output layer; The input layer is configured to input the multiplier and multiplicand. The computation kernel layer is configured to perform composite multiplication and shift operations based on the multiplier, multiplicand, and shift bits. The output layer is set to output the results of multiplication and shift operations.
[0050] The composite multiplier in this embodiment achieves multiplication and shift functions while ensuring that the arithmetic function and arithmetic accuracy remain completely unchanged. This reduces logic units, shortens the critical path, reduces the number of registers and dynamic power consumption, and improves the overall circuit performance and hardware utilization.
[0051] In one exemplary embodiment, the computation kernel layer includes a partial product generation unit, a bit offset unit, and an addition tree; The partial product generation unit is configured to generate each original partial product based on the multiplier and the multiplicand; The bit offset unit is configured to shift each original partial product of a path to the left by k bits to obtain the corresponding partial product of the path, where k is the number of shift bits and k is a positive integer. The addition tree is configured to perform a summation operation on all partial products.
[0052] In one exemplary embodiment, The computational kernel layer includes a partial product generation unit, an addition tree, and a first truncation unit; The partial product generation unit is configured to generate the original partial product based on the multiplier and the multiplicand; The addition tree is configured to perform a summation operation on the original partial products to obtain the multiplication result; The first truncation unit is configured to take the data above the lower k bits in the original multiplication result as the result of the multiplication and shift operation, where k is the number of shift bits and k is a positive integer.
[0053] In one exemplary embodiment, the computation kernel layer includes a partial product generation unit, an addition tree, a sign extension unit, and a second truncation unit; The partial product generation unit is configured to generate the original partial product according to the multiplier and multiplicand in accordance with the rules of signed number arithmetic. The addition tree is configured to perform a summation operation on the original partial products to obtain the multiplication result; The sign extension unit is configured to extend the highest sign bit in the multiplication result by k bits, where k is the number of shifts and k is a positive integer. The second truncation unit is configured to take the data above the lower k bits in the result of the multiplication operation after k-bit extension as the result of the multiplication and shift operation.
[0054] The composite multiplier of this application embodiment has the following advantages: 1) Significantly reduce hardware resource consumption Completely removing the multiplexers, shift gates, wiring, and timing registers of independent shift chains can reduce the amount of LUTs, FFs, and routing resources used in FPGAs; and can reduce chip area and significantly improve hardware utilization in ASIC designs.
[0055] 2) Optimize circuit timing performance Eliminate long-distance wiring delays and multi-level logic delays from multipliers to shift chains, compress the overall critical path delay, increase the highest operating frequency of the circuit, reduce timing convergence difficulty, and reduce the number of back-end iterations.
[0056] 3) Reduce overall power consumption With a reduction in the number of registers and a decrease in clock tree load, along with a decrease in logic gate toggle rate, the circuit's dynamic and static power consumption are reduced simultaneously, making it suitable for low-power terminals and embedded digital circuit scenarios.
[0057] 4) Reliable functions and wide compatibility It is optimized strictly based on mathematical equivalent transformations, and the operation results and accuracy are completely consistent with the original circuit. It supports signed / unsigned numbers, combinational / sequential shifts, and multiple fixed shift bits, and is compatible with various multiplier architectures and mainstream digital design scenarios.
[0058] 5) Low engineering renovation cost The interface, protocol, and usage are fully compatible with the original design, requiring no changes to the system architecture and upper-level logic, and can be seamlessly integrated into existing comprehensive tools and design processes.
[0059] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.
[0060] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application can also be combined with any conventional features or elements to form unique inventive solutions. Any feature or element of any embodiment can also be combined with features or elements from other inventive solutions to form another unique inventive solution. Therefore, it should be understood that any feature shown and / or discussed in this application can be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes can be made within the scope of the appended claims.
[0061] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a predetermined sequence of steps. However, the method or process should not be limited to the predetermined order of steps described herein, to the extent that it does not depend on this predetermined order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the predetermined order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order; those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.
[0062] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on an electronic device readable medium, which may include electronic device storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term "electronic device storage media" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as electronic device readable instructions, data structures, program modules, or other data). Electronic device storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by the electronic device. Furthermore, it is well known to those skilled in the art that communication media typically contain readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0063] Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include at least one of those features.
[0064] In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise expressly and specifically limited.
[0065] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," "fixing," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral part; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0066] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0067] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0068] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method for optimizing multiplier logic, characterized in that, Obtain the original circuit code or the original gate-level netlist; The target cascaded topology is determined based on the original circuit code or the original gate-level netlist. The target cascaded topology includes cascaded multipliers and shift chains. The shift direction, shift number, and shift chain type of the shift chain are determined based on the target cascaded topology. The multiplier is subjected to shift chain logic fusion processing based on the shift direction, shift number, and shift chain type of the shift chain, so as to convert the shift operation into equivalent position weight offset within the multiplier; and the internal logic of the multiplier after shift chain logic fusion processing is simplified to form a composite multiplier. The composite multiplier is verified, and if the verification is successful, the circuit code or gate-level netlist containing the composite multiplier is output.
2. The multiplier logic optimization method as described in claim 1, characterized in that, The shift direction is left shift, the shift number is k bits, where k is a positive integer, and the shift chain type is a combinational logic shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: Each original partial product generated by the multiplier is shifted left by k bits to become the partial product of the corresponding path, so that the multiplier sums all the partial products; and the shift chain is deleted.
3. The multiplier logic optimization method as described in claim 1, characterized in that, The shift direction is a logical right shift, the shift number is k bits, and the shift chain type is a combinational logic shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The data above the lower k bits in the multiplication result of the multiplier are taken as the result of the multiplication and shift operation, and the shift chain is deleted.
4. The multiplier logic optimization method as described in claim 1, characterized in that, The shift direction is an arithmetic right shift, the number of shift bits is k bits, and the shift chain type is a combinational logic shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The highest sign bit in the multiplication result of the multiplier is extended by k bits. The data above the lower k bits in the multiplication result after k-bit extension are used as the result of the multiplication and shift operation, and the shift chain is deleted.
5. The multiplier logic optimization method as described in claim 1, characterized in that, The shift direction is left shift, the shift number is k bits, where k is a positive integer, and the shift chain type is a register-type sequential shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: Each original partial product generated by the multiplier is shifted left by k bits to become a partial product, so that the multiplier sums the partial products. Then, the intermediate registers between the multiplier and the shift chain are deleted. Based on the shift number, each level of registers in the shift chain is inserted into the partial product pipeline and the addition tree pipeline level of the multiplier, and then the shift chain is deleted.
6. The multiplier logic optimization method as described in claim 1, characterized in that, The shift direction is a logical right shift, the shift number is k bits, and the shift chain type is a register-type sequential shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The data above the lower k bits in the multiplication result of the multiplier are taken as the result of the multiplication and shift operation; Then, delete the intermediate register between the multiplier and the shift chain, and according to the number of shift bits, insert each level of registers in the shift chain into the partial product pipeline and the addition tree pipeline level of the multiplier, and then delete the shift chain.
7. The multiplier logic optimization method as described in claim 1, characterized in that, The shift direction is an arithmetic right shift, the number of shift bits is k bits, and the shift chain type is a register-type sequential shift chain; The step of performing shift chain logic fusion processing on the multiplier based on the shift direction, shift number, and shift chain type includes: The highest sign bit in the multiplication result of the multiplier is extended by k bits, and the data above the lower k bits in the multiplication result after k-bit extension are used as the result of the multiplication and shift operation. Then, the intermediate registers between the multiplier and the shift chain are deleted. Based on the number of shift bits, each level of registers in the shift chain is inserted into the partial product pipeline and the addition tree pipeline level of the multiplier, and then the shift chain is deleted.
8. A composite multiplier, characterized in that, The composite multiplier is generated by the multiplier logic optimization method according to any one of claims 1-7; The composite multiplier includes an input layer, an operational kernel layer, and an output layer; The input layer is configured to input the multiplier and the multiplicand; The computation kernel layer is configured to perform multiplication and shift operations based on the multiplier, multiplicand, and shift bits. The output layer is configured to output the results of multiplication and shift operations.
9. The composite multiplier as described in claim 8, characterized in that, The computational kernel layer includes a partial product generation unit, a bit offset unit, and an addition tree; The partial product generation unit is configured to generate each original partial product based on the multiplier and the multiplicand; The bit offset unit is configured to shift each original partial product of a path to the left by k bits to obtain the corresponding partial product of the path, where k is the number of shifts and k is a positive integer. The addition tree is configured to perform summation operations on all partial products.
10. The composite multiplier as described in claim 8, characterized in that, The computational kernel layer includes a partial product generation unit, an addition tree, and a first truncation unit; The partial product generation unit is configured to generate the original partial product based on the multiplier and the multiplicand; The addition tree is configured to perform a summation operation on the original partial products to obtain the multiplication result; The first truncation unit is configured to take the data above the lower k bits in the original multiplication result as the result of the multiplication and shift operation, where k is the number of shift bits and k is a positive integer.
11. The composite multiplier as described in claim 8, characterized in that, The computational kernel layer includes a partial product generation unit, an addition tree, a sign extension unit, and a second truncation unit. The partial product generation unit is configured to generate the original partial product according to the multiplier and multiplicand in accordance with the rules of signed number arithmetic. The addition tree is configured to perform a summation operation on the original partial products to obtain the multiplication result; The sign extension unit is configured to extend the highest sign bit in the multiplication result by k bits, where k is the number of shifts and k is a positive integer. The second truncation unit is configured to take the data above the lower k bits in the result of the multiplication operation after k-bit extension as the result of the multiplication and shift operation.
