A precision-controllable approximate multiplier design method and storage medium

By designing an approximate multiplier that combines hybrid Radix-Booth encoding and a precision-controllable full adder, the hardware overhead and power consumption issues of precise multipliers in fault-tolerant applications are resolved. This results in a precision-controllable approximate multiplier, reducing hardware overhead and power consumption while improving computation speed.

CN115934028BActive Publication Date: 2026-11-20NANJING INST OF INTELLIGENT TECH INST OF MICROELECTRONICS OF THE CHINESE ACAD OF
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211575755.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2026-11-20
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

In existing technologies, precise multipliers account for a large amount of hardware overhead and power consumption in fault-tolerant applications, and lack precision control methods.

Method used

An approximate multiplier design method using hybrid Radix-Booth encoding and precision-controllable full adders is adopted. Through partial product generation, compression, and summation stages, combined with precise and approximate Booth encoding, the operation precision and hardware overhead are controlled, and parameterized control is achieved using precision-controllable full adders.

Benefits of technology

It significantly reduces the area, power consumption, and latency of the computing circuit, while improving the controllability of computing speed and accuracy in fault-tolerant applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934028B_ABST
    Figure CN115934028B_ABST
Patent Text Reader

Abstract

The application discloses a precision-controllable approximate multiplier design method and a storage medium, calculates input signals to obtain partial products, compresses the partial products, and sums the compressed partial products to obtain a product result. The approximate multiplier first proposes a new idea when processing negative partial products generated by a booth algorithm, and uses one OR gate or two AND gates to partially compensate for the error of the approximate complement operation without increasing additional partial products. The approximate multiplier based on a hybrid radix booth algorithm is combined with a precision-controllable full adder circuit, different operation precisions are realized according to different input control signals, and thus the parameterized control precision and hardware overhead are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a design method and storage medium for an approximate multiplier with controllable accuracy, belonging to the field of approximate multiplier technology. Background Technology

[0002] In recent years, with the rise of digitally intensive applications such as deep learning, these technologies often require a large number of convolution operations, and the multiplication operations in convolution consume significant hardware overhead and power. However, these applications also possess a certain degree of fault tolerance, able to accept errors within a certain range. Therefore, approximate computation is increasingly being applied to such fault-tolerant systems. Besides deep learning, fault-tolerant applications also include image processing applications, such as image filtering, edge detection, and image sharpening. These image processing applications require a large number of multiplication operations. Replacing precise calculations with approximate calculations, where the resulting errors are tolerable or have a minimal impact on the results, allows approximate multipliers to replace precise multipliers. Approximate computation is an emerging circuit design method; its calculation result is an approximate value with errors. This simplifies the circuit structure, thereby improving circuit performance, reducing power consumption, and saving circuit area.

[0003] Approximate multipliers are an important research area in approximate computation, but multiplication often consumes more area and power consumption in computation compared to other operations such as addition. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a design method and storage medium for an approximate multiplier with controllable accuracy. In fault-tolerant applications, replacing the accurate multiplier with the approximate multiplier of the present invention can significantly reduce the area, power consumption and delay of the operation circuit.

[0005] To achieve the above objectives, the present invention provides a method for designing an approximate multiplier with controllable accuracy, comprising: Calculate the partial product from the input signal; Compress the partial product; Summing the compressed partial products yields the product result.

[0006] First, the input signal is calculated to obtain a partial product, which is achieved through the following steps: The 7-5 bit input precise Radix-4 Booth encoding circuit of the 8-bit input signal multiplier A and multiplier B is used to obtain PP2; The 5-2 bit inputs of the 8-bit input signals multipliers A and B are approximated by Radix-8 Booth encoding circuits to obtain PP1; The 2-0 bits of the 8-bit input signal multiplier A and multiplier B are approximated by the Radix-8 Booth encoding circuit to obtain PP0; Determine the sign of PP2, PP1, and PP0, and obtain the sign of PP2 (sign2), PP1 (sign1), and PP0 (sign0). PP0, PP1, and PP2 are shifted and sign-extended to obtain I0, I1, and I2, respectively.

[0007] Firstly, PP0, PP1, and PP2 are shifted and sign-extended to obtain I0, I1, and I2 respectively, through the following steps: Sign-extend PP0 to obtain I0; PP1 is left-shifted by 3 bits and then sign-extended to obtain I1; PP2 is left-shifted by 6 bits and then sign-extended to obtain I2.

[0008] First, the compressed partial products are summed to obtain the product result, which is achieved through the following steps: Compress I0, I1, and I2 into two lines to obtain I3 and I4.

[0009] First, the compressed partial products are summed to obtain the product result, which is achieved through the following steps: Add I3 and I4 together using an adder to obtain a 16-bit product.

[0010] First, add I3 and I4 using an adder to obtain a 16-bit product result, which is achieved through the following steps: A precise serial carry adder is used to add bits 8-15 of I3 and bits 8-15 of I4, and a precision controllable full adder is used to add bits 1-7 of I3 and bits 1-7 of I4 to obtain a 16-bit product result.

[0011] Preferred, bits 8-15 of I3 and bits 8-15 of I4 are added using a precise serial carry adder, while bits 0-7 of I3 and bits 0-7 of I4 are added using a precision controllable full adder.

[0012] Firstly, the Boolean logic expression for a precision-controllable full adder:

[0013] In the formula, A is bits 1-7 of I3, B is bits 1-7 of I4, Cin is the carry signal from the previous adder, sel is the precision control input signal, S is the addition and output signal, which constitute bits 1-7 of the final product result of the multiplier, and C is the carry output signal of the adder.

[0014] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the program to implement the steps of any of the methods described above.

[0015] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0016] The beneficial effects achieved by this invention are as follows: 1. The approximate multiplier proposed in this invention first offers a new approach to handling the negative partial product generated by the booth algorithm. It uses one OR gate and two AND gates to partially compensate for the error of the approximate complement operation without adding extra partial products.

[0017] 2. The approximate multiplier based on the hybrid radix Booth algorithm and the precision-controllable full adder circuit proposed in this invention can achieve different operational accuracies according to different input control signals, thereby realizing parameterized control accuracy and hardware overhead.

[0018] 3. The approximate multiplier provided by this invention can be used in fault-tolerant applications such as image processing and neural network hardware acceleration. Replacing the exact multiplier in fault-tolerant applications with the approximate multiplier of this invention can speed up multiplication operations, reduce power consumption, and save circuit area. Attached Figure Description

[0019] Figure 1 This is a structural diagram of an approximate multiplication circuit; Figure 2 This is a schematic diagram of partial product coding partitioning; Figure 3 This is a schematic diagram of a partial product array; Figure 4 This is a schematic diagram before the sign2 approximation process; Figure 5 This is a schematic diagram of partial product compression; Figure 6 This is a structural diagram of a precision-controllable full adder circuit; Figure 7 This is a schematic diagram of the partial product summation stage; Figure 8 This is a schematic diagram of the full addition mode when CTR=3'b111; Figure 9 This is a schematic diagram of the full addition mode when CTR=3'b100. Detailed Implementation

[0020] The following embodiments are only used to illustrate the technical solutions of the present invention more clearly, and should not be used to limit the scope of protection of the present invention.

[0021] This invention relates to a precision-controllable 8-bit signed approximate multiplier based on hybrid Booth encoding. The multiplier operation process includes partial product generation (stage 1), partial product compression (stage 2), and partial product summation (stage 3). In this invention, the approximate calculation process is introduced in the partial product generation stage (stage 1) and the final partial product summation stage (stage 3). The partial product generation stage (stage 1) uses two Booth encoding methods to reduce the number of partial products. The two Booth encoding methods refer to: approximate Booth encoding and precise Booth encoding. The 0~5 bits use an approximate Radix-8 Booth encoding circuit to generate two partial products PP0 and PP1, and the 7~5 bits use a precise Radix-4 Booth encoding circuit to generate a partial product PP2. like Figure 1 As shown, the negative partial product calculation process of PP2 generated using the precise Radix-4 Booth encoding circuit is approximated. In the partial product compression stage (stage 2), a 3-2 compression circuit is used to compress the three partial products generated in stage 1 into two. In the partial product summation stage (stage 3), a full adder circuit is used to add the two partial products output from stage 2 to obtain the final product result of the approximate multiplier. The full adder circuit includes a precise full adder and a precision controllable full adder. Bits 15 to 8 of the partial product generated in stage 2 are added using the precise full adder circuit, and bits 7 to 1 of the partial product are added using the precision controllable full adder circuit. A precision controllable full adder is used to control the final precision of the approximate multiplier. Different precisions correspond to different power consumption. In order to obtain the operating mode control signal of the precision controllable full adder, a precision decoding circuit that generates the precision control signal sel[7:1] is also included outside the multiplier.

[0022] The 8-bit approximate multiplier circuit mainly includes the following circuits: (1) a precise Radix-4 Booth encoding circuit, (2) an approximate Radix-8 Booth encoding circuit, (3) a 3-2 compression circuit, and (4) a full adder circuit, which includes a precise full adder and a precision controllable full adder. The multiplier operation process includes three main stages: partial product generation, partial product compression, and summation.

[0023] Phase 1: Partial product generation First, the 8-bit input signals multipliers A and B enter the encoding circuit to generate three partial products PP0, PP1, and PP2. PP0 and PP1 are generated by approximate radix-8 Booth encoding, while PP2 is generated by precise radix-8 Booth encoding.

[0024] The 7-5 bit input precise Radix-4 Booth encoding circuit of the 8-bit input signal multiplier A and multiplier B is used to obtain PP2; The 5-2 bit inputs of the 8-bit input signals multipliers A and B are approximated by Radix-8 Booth encoding circuits to obtain PP1; The 2-0 bits of the 8-bit input signal multiplier A and multiplier B are approximated by the Radix-8 Booth encoding circuit to obtain PP0; Determine the sign of PP2, PP1, and PP0, and obtain the sign of PP2 (sign2), PP1 (sign1), and PP0 (sign0). PP0, PP1, and PP2 are shifted and sign-extended to obtain I0, I1, and I2, respectively; PP0, PP1, and PP2 are shifted and sign-extended to obtain I0, I1, and I2 respectively, through the following steps: Sign-extend PP0 to obtain I0; PP1 is left-shifted by 3 bits and then sign-extended to obtain I1; PP2 is left-shifted by 6 bits and then sign-extended to obtain I2; Specifically, PP0 and PP1 are generated by an approximate Radix-8 Booth encoding circuit, so the results are approximate values, while PP2 is generated by an accurate Radix-4 Booth encoding circuit, so it is an accurate value.

[0025] The approximate Radix-8 Booth encoding circuit approximates the partial product of positive and negative multiples of 3 in the precise Radix-8 Booth encoding, approximating 3A as 2A and -3A as -2A.

[0026] The truth table for approximate radix-8 Booth encoding is shown in Table 1: Table 1

[0027] During the partial product generation stage, the sign of the partial product is also determined. The signs of PP0, PP1 and PP2 are represented by sign0, sign1 and sign2 respectively. The values ​​of sign0, sign1 and sign2 are 1 or 0, where 1 represents a negative value and 0 represents a positive value.

[0028] If PP0 is negative, then sign0 is 1; If PP1 is negative, then sign1 is 1; If PP2 is negative, then sign2 is 1; The negative partial product requires a complement operation, i.e., "invert and add 1". The inversion process can be implemented using a NOT gate during encoding. The "add 1" is processed by three signals: sign0, sign1, and sign2. These signals are calculated together during partial product compression in stage 2 without using an additional adder. The partial product array consisting of I0, I1, and I2 obtained by shifting the three partial products according to their respective weights is shown below. Figure 3 As shown, the results of PP0, PP1, and PP2 after shifting and sign bit extension are represented by I0, I1, and I2, respectively.

[0029] I0 = PP0 sign extension; I1 = PP1 left-shifted by 3 bits and sign-extended; I2 = PP2 left-shifted by 6 bits and sign-extended; sign0 is placed in the corresponding position of I1 according to the weight of PP0, since the weight of PP0 is 2. 0 Therefore, sign0 is placed in the 0th bit of I1, because the weight of PP1 is 2. 3 Therefore, sign1 is placed in the 3rd bit of I2, and the weight of PP2 is 2. 6 Theoretically, sign2 should be placed in the 6th bit, but doing so would require adding an extra row of partial products, such as Figure 5 The approximation of sign2 is shown.

[0030] PP0 and PP1 are represented by dashed hollow circles, and PP2 is represented by a solid hollow circle. The hollow box on the left represents the sign bit extension. When processing negative partial products, to avoid adding a new row of partial products, the position of sign2 is approximated and shifted to the 6th, 5th, and 4th bits of I2. Figure 3 The solid black circle in the text represents the "add 1" operation for negation of negative numbers after PP2 processing.

[0031] I2[6]=PP2[0]|sign2 (OR operation); I2[5]=PP2[0]&sign2 (AND operation); I2[4]=PP2[0]&sign2 (AND operation); When only PP2 is negative and the 0th bit of PP2 is 1, the approximate value of I2 will be smaller than the actual value. The design of adding two AND gates to I2[5] and I2[4] is also to make up for the error of the approximate value. In other cases, the value of I2 is the correct accurate value.

[0032] Phase 2: Partial Product Compression Compress I0, I1, and I2 into two lines to obtain I3 and I4; Specifically, the partial product compression process employs a precise 3-2 compression circuit to compress the three rows of partial products I0, I1, and I2 generated in stage 1 into two rows, denoted by I3 and I4, as follows: Figure 5 As shown, there is no loss of accuracy in this stage.

[0033] Phase 3: Summation of Partial Products Add I3 and I4 together using an adder to obtain a 16-bit product.

[0034] Adding I3 and I4 using an adder to obtain a 16-bit product can be achieved through the following steps: A precise serial carry adder is used to add bits 8-15 of I3 and bits 8-15 of I4, and a precision controllable full adder is used to add bits 1-7 of I3 and bits 1-7 of I4 to obtain a 16-bit product result. The 0th bit of the partially compressed output I4 is 0, and the 0th bit of the 16-bit product result obtained by summing the partial products is the 0th bit of I3.

[0035] Specifically, after the second stage, the partial product is reduced to two. In this stage, an adder is needed to add I3 and I4 to obtain the final 16-bit product result.

[0036] The high 8 bits (8-15 bits) of I3 and the high 8 bits (8-15 bits) of I4 are added using a precise serial carry adder. The low 7 bits (1-7 bits) of I3 and the low 7 bits (1-7 bits) of I4 are added using a precision controllable full adder. The result of the 0th bit of I4 after compression is 0, so no calculation is needed. The 0th bit of the final product is equal to I3[0]. Therefore, only bits 1-15 need to be added. The precision controllable full adder is designed as follows: Figure 6 As shown: The precision-controlled full adder has four input signals and two output signals, used in the addition operation of bits 7-1 of I3 and I4, such as... Figure 7 As shown. Figure 6In the circuit, the sel signal is the precision control input signal, A and B are two input signals that need to be added, Cin is the carry signal from the previous stage, S is the result and sum signal, and C is the carry signal to the next stage.

[0037] Boolean logic expression for a precision-controllable full adder:

[0038] In the formula, A is bits 1-7 of I3, B is bits 1-7 of I4, Cin is the carry signal from the previous adder, sel is the precision control input signal, S is the addition and output signal, which constitute bits 1-7 of the final product result of the multiplier, and C is the carry output signal of the adder.

[0039] When sel=0, the precision-controlled full adder operates in approximate operation mode: ; ; In approximation mode, if the Cin signal from the previous full adder is also 0, then S=A+B, C=0; When sel=1, the precision-controlled full adder operates in precise operation mode, functioning the same as a regular full adder. , The main functions are described in Table 2. Therefore, the working mode of the adder can be controlled by the sel signal of the control circuit.

[0040] Table 2

[0041] SEL7~SEL1 are obtained from the external decoding circuit of the multiplier. The user can control SEL7~SEL1 through the external 3-bit control signal CTR. The decoding table of the control circuit is shown in Table 3. Table 3

[0042] By controlling the value of CRT and thus the values ​​of sel7~sel1, the operating mode of the precision controllable adder can be controlled, thereby adjusting the precision of the approximate multiplier. A sel value of 0 indicates that the precision controllable adder is in approximate calculation mode. Therefore, the larger the value of CRT, the higher the precision. The precision of the approximate multiplier varies under different configurations, and the delay power consumption also varies accordingly.

[0043] As can be seen from Table 3, if the nth bit is in the approximate calculation mode when the two partial products are summed in the third stage, then bits 1 to (n-1) are also in the approximate calculation mode.

[0044] For example: CTR=3'b111, then Figure 7 When adding I3 and I4, precise calculations are used throughout, with no precision loss in the third stage. The carry propagation chain runs from bit 1 to bit 15, as follows: Figure 8 As shown.

[0045] When CTR = 3'b100, the partial product full addition process is as follows: Figure 9 As shown, the operations of bits 15-4 of I3 and I4 are performed in precise mode, while the addition operations of bits 1, 2 and 3 of I3 and I4 are performed in approximate mode, resulting in precision loss. The output values ​​of S1, S2 and S3 are the OR of the corresponding bits of I3 and I4, that is: S1=I3[1]+ I4[1], S2=I3[2]+I4[2], S3=I3[3]+I4[4]. However, in this working mode, since Cin=0 of the first bit, C_1=0 of the first bit adder, which in turn leads to Cin=0 of the second bit, making C_2=0 of the output of the second bit adder, which in turn leads to Cin=0 of the third bit, making C_2=0 of the output of the third bit adder. Therefore, it can be seen that in the approximate working mode, the carry propagation chain is truncated, thus reducing the propagation delay of the serial carry adder. In summary, the output of the precision-controllable adder and S are transformed into an approximate result of an OR gate in approximate operating mode.

[0046] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0047] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0048] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0049] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for designing an approximate multiplier with controllable accuracy, characterized in that, include: The partial product is calculated from the input signal through the following steps: The 7-5 bit input precise Radix-4 Booth encoding circuit of the 8-bit input signal multiplier A and multiplier B is used to obtain PP2; The 5-2 bit inputs of the 8-bit input signals multipliers A and B are approximated by Radix-8 Booth encoding circuits to obtain PP1; The 2-0 bits of the 8-bit input signal multiplier A and multiplier B are approximated by the Radix-8 Booth encoding circuit to obtain PP0; The approximate Radix-8 Booth encoding circuit approximates the partial product of positive and negative multiples of 3 in the precise Radix-8 Booth encoding, approximating 3A as 2A and -3A as -2A; Determine the sign of PP2, PP1, and PP0, and obtain the sign of PP2 (sign2), PP1 (sign1), and PP0 (sign0). Shift and sign-extend PP0, PP1, and PP2 to obtain I0, I1, and I2 respectively: sign-extend PP0 to obtain I0; shift PP1 left by 3 bits and sign-extend to obtain I1; shift PP2 left by 6 bits and sign-extend to obtain I2. When processing negative partial products, PP2 approximates the position of sign2 to avoid adding a new row of partial products. It shifts the position of sign2 to the 6th, 5th, and 4th bits of I2, as follows: I2[6]=PP2[0]|sign2 (OR operation); I2[5]=PP2[0]&sign2 (AND operation); I2[4]=PP2[0]&sign2 (AND operation); Compress the partial product; The product result is obtained by summing the compressed partial products through the following steps: Compress I0, I1, and I2 into two rows to obtain I3 and I4. Add I3 and I4 together using an adder to get a 16-bit product result. Use a precise serial carry adder to add bits 8-15 of I3 and bits 8-15 of I4. Use a precision controllable full adder to add bits 1-7 of I3 and bits 1-7 of I4 to get a 16-bit product result. Specifically, bits 8-15 of I3 and bits 8-15 of I4 are added using a precise serial carry adder, while bits 0-7 of I3 and bits 0-7 of I4 are added using a precision controllable full adder. Boolean logic expression for a precision-controllable full adder: , In the formula, A is bits 1-7 of I3, B is bits 1-7 of I4, Cin is the carry signal from the previous adder, sel is the precision control input signal, S is the addition and output signal, which constitute bits 1-7 of the final product result of the multiplier, and C is the carry output signal of the adder. When sel=0, the precision controllable full adder operates in approximate operation mode; when sel=1, the precision controllable full adder operates in precise operation mode.

2. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method of claim 1.

3. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method of claim 1.

Citation Information

Patent Citations

  • High-cardinal-number approximate Booth encoding method and mixed-cardinal-number Booth encoding approximate multiplier

    CN111488133A