Circuit optimization method, electronic device and storage medium
By generating new data paths, joint optimization of connected multipliers and adders is achieved, which solves the problem in the existing technology that adders rely on multiplier results, and improves the efficiency and performance of circuit design.
Patent Information
- Application Number
- CN202210590373.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-05-26
AI Technical Summary
During the synthesis process of chip design, it is difficult to effectively optimize the connected multipliers and adders with existing technology, resulting in the adder being dependent on the final calculation result of the multiplier and the lack of a joint optimization method.
By generating a new data path, joint optimization of connected multipliers and adders is achieved, so that the execution of the adder does not depend on the final calculation result of the multiplier, and the final adder in the multiplier is removed.
The joint optimization of the multiplier and the adder is realized, which improves the efficiency and performance of the circuit design, reduces the dependence of the adder on the multiplier result, and improves the optimization capability of the hardware description language synthesizer.
Smart Images

Figure CN115099176B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of circuits, and in particular to a method for optimizing circuits, an electronic device, and a storage medium. Background Art
[0002] When synthesizing a chip design, designers need to use a hardware description language synthesizer to synthesize the design described in the hardware description language (HDL) into a digital circuit design.
[0003] During the synthesis process, connected multipliers and adders are usually generated separately, and adders can be used in multipliers. Usually, the hardware description language synthesizer also needs to optimize the synthesized netlist containing operators. Among them, the optimization of multipliers is generally only for the adders therein. The multiplier outputs the final calculation result only after completing all calculations, which makes the execution of the adder connected to it dependent on the final result of the multiplier. Summary of the invention
[0004] In view of this, the present disclosure proposes a circuit optimization method, an electronic device, and a storage medium.
[0005] In a first aspect of the present disclosure, a method for optimizing a circuit is provided, comprising: obtaining a description of a first circuit; determining a first data path in the first circuit, wherein the first data path comprises a multiplier and an adder, the multiplier comprises two first inputs, a first output of the multiplier is a second input of the adder, and the adder further comprises a third input and a second output; generating a second data path, wherein the input of the second data path is the two first inputs of the multiplier and the third input of the adder, and the output of the second data path is the same as the second output of the adder in the first data path; and replacing the first data path with the second data path to obtain a second circuit.
[0006] According to a second aspect of the present disclosure, there is provided an electronic device for optimizing circuits, comprising: a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions so that the electronic device executes the method according to the first aspect.
[0007] According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores a set of instructions for an electronic device, wherein the set of instructions is used to enable the electronic device to execute the method described in the first aspect.
[0008] The present invention provides a method for optimizing a circuit, an electronic device, and a storage medium. In the process of synthesizing a circuit by a hardware description language synthesizer, a new data path is generated to achieve joint optimization of a connected multiplier and an adder, so that the execution of the adder does not depend on the final calculation result of the multiplier, and the final adder in the multiplier is removed. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 A schematic structural diagram of an exemplary electronic device according to an embodiment of the present disclosure is shown.
[0011] Figure 2A A schematic diagram of an exemplary hardware description language synthesizer according to an embodiment of the present disclosure is shown.
[0012] Figure 2B A schematic diagram of an exemplary synthesis process is shown.
[0013] Figure 3A A schematic diagram of an exemplary first data path according to an embodiment of the present disclosure is shown.
[0014] Figure 3B A schematic diagram of an exemplary second data path according to an embodiment of the present disclosure is shown.
[0015] Figure 3C A schematic diagram of an exemplary carry-save addition process according to an embodiment of the present disclosure is shown.
[0016] Figure 4 A flow chart of an exemplary method for optimizing a circuit according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0017] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0018] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The words "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0019] As described above, when optimizing the connected multipliers and adders synthesized by the hardware description language synthesizer, usually only the adder is optimized. At the same time, the multiplier outputs the final calculation result only after completing all calculations, which makes the execution of the adder connected to it dependent on the final result of the multiplier. At present, there is no effective method for jointly optimizing the connected multipliers and adders.
[0020] In view of the above problems, the present disclosure provides a method for optimizing circuits, an electronic device and a storage medium. In the process of synthesizing circuits by a hardware description language synthesizer, a new data path is generated to achieve joint optimization of connected multipliers and adders, so that the execution of the adder does not depend on the final calculation result of the multiplier, and the final adder in the multiplier is removed.
[0021] Figure 1 A schematic structural diagram of an exemplary electronic device 100 according to an embodiment of the present disclosure is shown.
[0022] The electronic device 100 may be, for example, a host computer. The electronic device 100 may include: a processor 102, a memory 104, a network interface 106, a peripheral interface 108, and a bus 110. The processor 102, the memory 104, the network interface 106, and the peripheral interface 108 may be connected to each other in communication within the electronic device 100 via the bus 110.
[0023] Processor 102 may be a central processing unit (CPU), an image processor, a neural network processor, a microcontroller, a programmable logic device, a digital signal processor, an application specific integrated circuit (ASIC), or one or more integrated circuits. Processor 102 may be used to perform functions related to the technology described in this disclosure. In some embodiments, processor 102 may also include multiple processors integrated into a single logical component. Figure 1 As shown, the processor 102 may include a plurality of processors 102a, 102b, and 102c.
[0024] The memory 104 may be configured to store data (eg, instruction sets, computer codes, intermediate data, etc.). Figure 1 As shown, the stored data may include program instructions (e.g., program instructions for implementing the technology of the present disclosure) and data to be processed (e.g., the memory 104 may store temporary code generated by the compilation process). The processor 102 may also access the stored program instructions and data, and execute the program instructions to operate on the data to be processed. The memory 104 may include a non-transitory computer-readable storage medium, such as a volatile storage device or a non-volatile storage device. In some embodiments, the memory 104 may include a random access memory (RAM), a read-only memory (ROM), an optical disk, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.
[0025] The network interface 106 can be configured to enable the electronic device 100 to communicate with one or more other external devices via a network. The network can be any wired or wireless network capable of transmitting and / or receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, near field communication (NFC), etc.), a cellular network, the Internet, or a combination thereof. It is understood that the type of network is not limited to the above specific examples. In some embodiments, the network interface 106 can include any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, etc., in any combination.
[0026] The peripheral interface 108 can be configured to connect the electronic device 100 to one or more peripheral devices to achieve information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touch pad, a touch screen, a microphone, and various sensors, and output devices such as a display, a speaker, a vibrator, and an indicator light.
[0027] The bus 110 can be configured to transmit information between various components of the electronic device 100 (e.g., the processor 102, the memory 104, the network interface 106, and the peripheral interface 108), and can be, for example, an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.
[0028] In some embodiments, in addition to Figure 1 In addition to the processor 102, memory 104, network interface 106, peripheral interface 108, and bus 110 shown and described above, the electronic device 100 may also include one or more other components required to achieve normal operation and / or one or more other components required to implement the solution of the embodiments of the present disclosure. In some embodiments, the electronic device 100 may not include Figure 1 One or more components shown in .
[0029] It should be noted that, although the structural architecture of the electronic device 100 only shows the processor 102, the memory 104, the network interface 106, the peripheral interface 108 and the bus 110, in the specific implementation process, the structural architecture of the electronic device 100 may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the structural architecture of the electronic device 100 may also only include the components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0030] Figure 2A FIG. 2 is a schematic diagram of an exemplary hardware description language synthesizer 200 according to an embodiment of the present disclosure. The hardware description language synthesizer 200 may be a computer program running on the electronic device 100.
[0031] In the field of chip design, a hardware description language synthesizer 200 can be used to synthesize the circuit of a chip. The hardware description language synthesizer 200 can directly receive source code 204 (for example, a hardware description language such as Verilog HDL, VHDL, etc.), then perform synthesis based on the source code 204 and output a circuit netlist 206. For example, the hardware description language synthesizer 200 can synthesize the circuit netlist 206 via Figure 1 The hardware description language synthesizer 200 can also optimize the circuit netlist 206. It is understood that the optimization can be performed by first generating the circuit netlist and then optimizing, or by performing the optimization simultaneously during the process of generating the circuit netlist.
[0032] Figure 2B A schematic diagram of an exemplary integration process 210 is shown.
[0033] Typically, the hardware description language synthesizer 200 can perform logic optimization on the source code 204, which can be Verilog HDL, to obtain a netlist containing operators. The hardware description language synthesizer 200 can perform data path optimization on the netlist containing operators to obtain a netlist merging operators. Finally, after process mapping, the hardware description language synthesizer 200 can output a netlist after process mapping, i.e., a circuit netlist 206.
[0034] It is understandable that after the logic optimization process, descriptions such as bitstream or register transfer level (RTL) can also be obtained. Netlist, bitstream, register transfer level and other descriptions can all describe circuits.
[0035] Figure 3A A schematic diagram of an exemplary first data path 300 according to an embodiment of the present disclosure is shown.
[0036] In some embodiments, the hardware description language synthesizer 200 may determine the first data path 300 including a multiplier 302 and an adder 304 connected to each other from a netlist containing operators, wherein an output of the multiplier 302 is connected to an input of the adder 304 .
[0037] like Figure 3A As shown, the multiplier 302 may include two first inputs. The output of the multiplier 302 may be connected to an input of the adder 304, that is, the output of the multiplier 302 is used as an input of the adder 304. Therefore, the execution of the adder 304 depends on the result of the multiplier 302. Another input of the adder 304 may be a third input. The third input may be a signal directly applied to the adder 304, or an output signal generated after a plurality of input signals are operated by a specific circuit (e.g., another multiplier). Among them, the first input and the third input may be signal values with a certain bit width. The two first inputs of the multiplier 302 and the third input of the adder 304 may be inputs of the first data path 300, and the output of the adder 304 may be the output of the first data path 300.
[0038] In some embodiments, the multiplier 302 may include a plurality of adders therein, and at the end, the adders are used to accumulate partial products generated by the multiplier 302 during operation to obtain a final result of the multiplier 302 .
[0039] In some embodiments, the hardware description language synthesizer 200 may optimize the first data path 300 .
[0040] Figure 3B A schematic diagram of an exemplary second data path 310 according to an embodiment of the present disclosure is shown.
[0041] In some embodiments, the hardware description language synthesizer 200 may generate a second data path 310 corresponding to the first data path 300. It is understood that the first data path 300 and the second data path 310 correspond to the same piece of HDL code. Figure 3B As shown, the input and output of the second data path 310 can be the same as the input and output of the first data path 300, that is, the input of the second data path 310 can be two first inputs and a third input, and the output of the second data path 310 can be the second output.
[0042] In some embodiments, the second data path 310 may include a subcircuit 3102, a carry-save adder 312, and a carry-propagate adder 314. In some embodiments, the subcircuit 3102 may include a plurality of AND gates. The subcircuit 3102 may determine partial products based on the two first inputs. The hardware description language synthesizer 200 may temporarily store the partial products determined by the subcircuit 3102 without performing addition operations on the partial products. These partial products may be used as inputs to the carry-save adder 312 together with the third input. The carry-save adder 312 may perform carry-save additions multiple times to obtain two outputs.
[0043] Figure 3C A schematic diagram of an exemplary carry-save addition process 320 is shown according to an embodiment of the present disclosure.
[0044] The carry save adder 312 may first add the numbers on the same bit of the numbers A, B, and C to obtain a sum Sum and a carry Carry. The carry save adder 312 may store the carry Carry instead of directly carrying and adding it to the next bit. Figure 3C The process shown is a carry-save addition process. The sum and carry can be added with the next number again, until only two numbers are left.
[0045] Back to Figure 3B In some embodiments, the carry-save adder 312 may perform carry-save additions sequentially. The carry-save adder 312 may determine three partial products from the partial products received from the output of the sub-circuit 3102 to perform carry-save additions to obtain two third outputs. The carry-save adder 312 may determine one of the remaining partial products and use it as an input together with the two third outputs obtained above, and perform carry-save addition again to obtain two new third outputs. Similarly, the carry-save adder 312 may perform carry-save additions multiple times until the number of remaining partial products is 0. At this point, the carry-save adder 312 may use the obtained two new third outputs together with the third input as inputs, perform carry-save additions, and obtain two fourth outputs.
[0046] In other embodiments, the carry-save adder 312 can determine three as inputs from the set of partial products of the received subcircuit 3102 outputs and the third input, perform carry-save addition, and obtain two fifth outputs. It can be understood that the three numbers determined as inputs here are not necessarily all partial products, but can be the third input and two partial products. The set of the obtained two fifth outputs, the remaining partial products, and the third input is used as a new set, and the carry-save adder 312 can determine three as inputs from this new set, perform carry-save addition, and obtain two new fifth outputs. Similarly, the carry-save adder 312 can add the obtained two new fifth outputs to the aforementioned new set, and perform carry-save addition multiple times until the total number of the remaining partial products and the third input is 0, that is, only the two new fifth outputs are left in the new set.
[0047] The carry-propagation adder 314 can take the two fourth outputs or the two new fifth outputs as inputs, perform carry-propagation addition, and obtain a second output, which is the sum of the partial product of the output of the sub-circuit 3102 and the third input.
[0048] In some other embodiments, the carry-propagation adder 314 may be replaced by a carry chain. The carry chain may be, for example, Xilinx's CARRY8 primitive. It is understood that the carry-save adder 312, the carry-propagation adder 314, and the carry chain are merely examples, and their function is to obtain the sum of the partial product and the third input. The present disclosure does not limit the type of operator that performs the addition operation in the second data path 310.
[0049] Therefore, the second data path 310 can obtain the same operation result as the first data path 300. In the second data path 310, the multiplier and the adder are no longer two separate operators, and the execution of the adder does not need to depend on the final result of the multiplier. In other words, the adder can intervene when the multiplier is running halfway, and the subsequent addition operation can be performed as long as the partial product is obtained. At this time, the multiplier and the adder can already be an inseparable whole.
[0050] The hardware description language synthesizer 200 may use the generated second data path 310 to replace the first data path 300 to obtain a new circuit.
[0051] Understandably, Figure 3A The connected multiplier and adder shown in the figure are the minimum data path that can be optimized. The adder can also be connected to multiple multipliers, where the outputs of the multiple multipliers are the inputs of the adder. In this case, the method proposed in the present disclosure is also applicable.
[0052] In this way, in the process of synthesizing the circuit by the hardware description language synthesizer, the connected multipliers and adders are jointly optimized by generating new data paths, so that the execution of the adder does not depend on the final calculation result of the multiplier, and the final adder in the multiplier is removed.
[0053] Figure 4 FIG. 4 is a flow chart showing an exemplary method 400 for optimizing a circuit according to an embodiment of the present disclosure. The method 400 may be performed by Figure 1 More specifically, the method 400 may be executed by a hardware description language synthesizer 200 running on the electronic device 100. The method 400 may include the following steps.
[0054] In step S402, the hardware description language synthesizer 200 may obtain a description of the first circuit (e.g., HDL source code, a netlist containing an operator, a bitstream, a register transfer level (RTL) description, etc.). It is understandable that for a description of the first circuit such as a netlist or a bitstream that can directly correspond to the circuit, the hardware description language synthesizer 200 may directly optimize the circuit. For a description such as an HDL source code or an RTL code, the hardware description language synthesizer 200 may optimize the circuit in the process of generating the circuit.
[0055] In step S404, the hardware description language synthesizer 200 may determine a first data path (eg, Figure 3A 300), wherein the first data path includes a multiplier (eg, Figure 3A The multiplier 302) and the adder (e.g., Figure 3A The adder 304 includes two first inputs, a first output of the multiplier is a second input of the adder, and the adder also includes a third input and a second output.
[0056] In step S406, the hardware description language synthesizer 200 may generate a second data path (eg, Figure 3B The second data path 310 of FIG. 1 is a first data path 310 of FIG. 1 , wherein the input of the second data path is the multiplier (eg, Figure 3A The two first inputs of the multiplier 302) and the adder (eg, Figure 3A The output of the second data path is connected to the third input of the adder 304, and the output of the second data path is connected to the first data path (for example, Figure 3A The second output of the adder in the first data path 300 is the same.
[0057] In some embodiments, the second data path can be configured to: determine a partial product based on the two first inputs of the multiplier; store the partial product; calculate the sum of the partial product and the third input at the adder; and use the sum of the partial product and the third input of the adder as the output of the second data path.
[0058] In some embodiments, the hardware description language synthesizer 200 can determine three carry-save additions in the partial product to obtain two third outputs; can determine one carry-save addition in the remaining partial product to perform together with the two third outputs to obtain two new third outputs; in response to the number of the remaining partial products being 0, can perform carry-save addition on the new two third outputs and the third input of the adder to obtain two fourth outputs; and perform carry-propagate addition on the two fourth outputs to obtain the sum of the partial product and the third input of the adder.
[0059] In other embodiments, the hardware description language synthesizer 200 may determine three carry-save additions among the partial product and the third input to obtain two fifth outputs; may determine three carry-save additions among the two fifth outputs, the remaining partial product and the third input to obtain two new fifth outputs; and in response to the total number of the remaining partial product and the third input being 0, perform carry-propagation addition on the new two fifth outputs to obtain the sum of the partial product and the third input of the adder.
[0060] In some embodiments, the second data path may include a subcircuit (e.g., Figure 3B subcircuit 3102) and a carry-save adder (e.g., Figure 3B The subcircuit may be configured to determine the partial product according to the two first inputs of the multiplier; the carry-save adder may be configured to perform carry-save addition. In some embodiments, the subcircuit may include a plurality of AND gates.
[0061] In some embodiments, the second data path may also include a carry-propagate adder (eg, Figure 3B The carry-propagation adder 314 of FPGA) or a carry chain (e.g., Xilinx's CARRY8 primitive). The carry-propagation adder or the carry chain can be configured to perform carry-propagation addition.
[0062] In step S408, the hardware description language synthesizer 200 may use the second data path to replace the first data path to obtain a second circuit.
[0063] In this way, in the process of synthesizing the circuit by the hardware description language synthesizer, the connected multipliers and adders are jointly optimized by generating new data paths, so that the execution of the adder does not depend on the final calculation result of the multiplier, and the final adder in the multiplier is removed.
[0064] The present disclosure also provides an electronic device for optimizing the circuit. The electronic device may be Figure 1 The hardware description language synthesizer 200 may be configured to execute a computer program stored in the memory 104 to implement a method for optimizing a circuit consistent with the present disclosure, such as the exemplary method described above (eg, Figure 4 The method 400 shown in FIG. 4 is not described in detail here.
[0065] The present disclosure also provides a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores a computer program. When executed by the hardware description language synthesizer 200, the computer program causes the hardware description language synthesizer 200 to implement a method of optimizing a circuit consistent with the present disclosure, such as the exemplary method described above (e.g., Figure 4 The method 400 shown in FIG. 4 is not described in detail here.
[0066] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0067] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0068] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0069] In addition, to simplify the description and discussion, and in order not to obscure the present disclosure, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the devices may be shown in the form of block diagrams to avoid obscuring the present disclosure, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the present disclosure will be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the present disclosure may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0070] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0071] The present disclosure is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A method for optimizing a circuit, comprising: obtaining a description of a first circuit; Determine a first data path in the first circuit, wherein the first data path includes a multiplier and an adder, the multiplier includes two first inputs, a first output of the multiplier is a second input of the adder, and the adder also includes a third input and a second output; generating a second data path, wherein inputs of the second data path are the two first inputs of the multiplier and the third input of the adder, and an output of the second data path is the same as the second output of the adder in the first data path; and replacing the first data path with the second data path to obtain a second circuit, Wherein, the second data path is configured as follows: determining a partial product based on the two first inputs of the multiplier; storing the partial volume; calculating, at the adder, a sum of the partial product and the third input; and The output of the second data path is a sum of the partial product and the third input.
2. The method according to claim 1, wherein: Calculating the sum of the partial product and the third input further comprises: determining three carry-save additions in the partial products to obtain two third outputs; Determine one of the remaining partial products and perform carry-save addition on it together with the two third outputs to obtain two new third outputs; In response to the number of the remaining partial products being 0, performing carry-save addition on the new two third outputs and the third input of the adder to obtain two fourth outputs; and Carry-propagate addition is performed on the two fourth outputs to obtain the sum of the partial product and the third input of the adder.
3. The method according to claim 1, wherein: Calculating the sum of the partial product and the third input further comprises: determining three carry-save additions between the partial products and the third input to obtain two fifth outputs; Determine three carry-save additions among the two fifth outputs, the remaining partial products and the third input to obtain two new fifth outputs; and In response to the total number of the remaining partial products and the third input being 0, carry-propagation addition is performed on the new two fifth outputs to obtain the sum of the partial products and the third input of the adder.
4. The method according to any one of claims 1 to 3, wherein: The second data path further comprises: subcircuit and carry-save adder, where The subcircuit is configured to determine the partial product based on the two first inputs of the multiplier; The carry-save adder is configured to perform carry-save addition.
5. The method according to claim 4, wherein the second data path further comprises: A carry-propagate adder, or carry chain, is configured to perform carry-propagate addition.
6. The method according to claim 4, wherein: The subcircuit further includes a plurality of AND gates.
7. An electronic device for optimizing a circuit, comprising: a memory for storing a set of instructions; as well as At least one processor is configured to execute the set of instructions so that the electronic device performs the method according to any one of claims 1 to 6.
8. A non-transitory computer-readable storage medium storing a set of instructions for an electronic device, wherein when the set of instructions is executed, the electronic device executes the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Logic circuit generation device and method
CN105814568A
Multiplier-free conversion circuit based on optimized RAG-n algorithm
CN114186384A
Multiplier employing carry select or carry look-ahead adders in hierarchical tree configuration
US5283755A
