Computation control method, device, system, storage medium and processor

By converting signed high-bit-width operands into short sequences represented by two's complement and uniformly using signed multipliers, the problem of high complexity of multiplication operations in the existing technology is solved, and high efficiency on large-scale multiplier arrays is achieved. Multiplication operation.

CN113590083BActive Publication Date: 2024-09-10ANHUI LISTENAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110917596.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-10
Publication Date
2024-09-10
Estimated Expiration
2041-08-10

AI Technical Summary

Technical Problem

In the existing technology, the complexity of performing multiplication operations on signed high-bit-width operands is high and is not suitable for use on large-scale multiplier arrays.

Method used

By converting the operands into short sequences represented by two's complement and uniformly using signed multipliers for multiplication operations, complex conversions between signed and unsigned numbers are avoided and the complexity of operation control is reduced.

Benefits of technology

It simplifies the operation control process, is suitable for use on large-scale multiplier arrays, and improves the efficiency and flexibility of multiplication operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113590083B
    Figure CN113590083B
Patent Text Reader

Abstract

A method, device, system, storage medium and processor for operation control. The method comprises: obtaining a first operand and converting the first operand into a plurality of first short sequences, each of which is a signed number represented by a binary complement; obtaining a second operand and converting the second operand into a plurality of second short sequences, each of which is a signed number represented by a binary complement; inputting the first short sequence and the second short sequence into a signed multiplier; shifting and accumulating the result of the multiplication operation; the number of the second short sequences is the same as the number of the first short sequences; the bit widths of the first short sequence and the second short sequence are the same as the input bit width of the signed multiplier; the number of the signed multipliers is greater than or equal to the product of the number of the first short sequences and the number of the second short sequences. Applying the above scheme can reduce the complexity of performing multiplication operations on operands with high bit widths of the sign.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to an operation control method, device, system, storage medium and processor. Background Art

[0002] With the development of artificial intelligence, the application of neural networks has penetrated into every aspect of life. Commonly used neural networks require a large number of multiplication and addition operations, such as deep neural networks (DNN) and convolutional neural networks (CNN). Existing general-purpose processors can no longer bear this, and embedded neural network processors (Neural Network Processing Units, NPUs) designed specifically for network operations have become mainstream. Large-scale multiplier arrays are the main computing units in NPUs.

[0003] Currently, the method of performing multiplication operations on signed high-bitwidth operands is highly complex and is not suitable for use on large-scale multiplier arrays such as NPUs. Summary of the invention

[0004] The problem to be solved by the present invention is to reduce the complexity of performing a multiplication operation on operands with a high bit width of a sign.

[0005] To solve the above problem, an embodiment of the present invention provides an operation control method, which includes: obtaining a first operand and converting the first operand into a plurality of first short sequences, each of which is a signed number represented by a binary complement; obtaining a second operand and converting the second operand into a plurality of second short sequences, each of which is a signed number represented by a binary complement; inputting the first short sequence and the second short sequence into a signed multiplier, controlling the signed multiplier, and performing a multiplication operation on the first short sequence and the second short sequence; shifting and accumulating the multiplication operation result to obtain the multiplication result of the first operand and the second operand; wherein the number of the second short sequences is the same as the number of the first short sequences; the bit widths of the first short sequences and the second short sequences are the same as the input bit width of the signed multiplier; and the number of the signed multipliers is greater than or equal to the product of the number of the first short sequences and the number of the second short sequences.

[0006] An embodiment of the present invention also provides an operation control device, which includes: a first conversion unit, suitable for obtaining a first operand and converting the first operand into a plurality of first short sequences, each of which is a signed number represented by a binary complement; a second conversion unit, suitable for obtaining a second operand and converting the second operand into a plurality of second short sequences, each of which is a signed number represented by a binary complement; an operation control unit, suitable for inputting the first short sequence and the second short sequence into a signed multiplier, controlling the signed multiplier, and performing a multiplication operation on the first short sequence and the second short sequence; a shift accumulation unit, suitable for shifting and accumulating the multiplication operation result to obtain the multiplication operation result of the first operand and the second operand; wherein the number of the second short sequences is the same as the number of the first short sequences; the bit widths of the first short sequences and the second short sequences are the same as the input bit width of the signed multiplier; and the number of the signed multipliers is greater than or equal to the product of the number of the first short sequences and the number of the second short sequences.

[0007] An embodiment of the present invention also provides an operation control system, which includes: the operation control device in the above embodiment; and a plurality of signed multipliers; wherein the operation control device is connected to the signed multipliers; the signed multipliers are suitable for performing multiplication operations under the control of the operation control device; the number of the signed multipliers is greater than or equal to the product of the number of first short sequences and the number of second short sequences in the operation control device.

[0008] An embodiment of the present invention further provides a processor, which includes the operation control system in the above embodiment.

[0009] An embodiment of the present invention further provides a computer storage medium, on which a computer program is stored. The computer program is executed by a processor to implement the steps of the above-mentioned operation control method.

[0010] Compared with the prior art, the technical solution of the embodiment of the present invention has the following advantages:

[0011] By applying the solution of the present invention, the first operand is converted into a plurality of first short sequences, and the second operand is converted into a plurality of second short sequences. Since the first short sequence and the second short sequence are both signed numbers represented by binary complement codes, a signed multiplier can be uniformly used to perform multiplication operations on the first short sequence and the second short sequence, thereby avoiding complex conversions between signed numbers and unsigned numbers and reducing the complexity of operation control. In addition, by adopting the solution of the present invention, since the lengths of the first short sequence and the second short sequence are the same as the bit width of the signed multiplier, no matter what the bit width of the input operand is, they can be uniformly converted into short sequences with the same bit width as the signed multiplier, and corresponding multiplication operations can be performed, without the need for separate operation control according to different operand bit widths, further reducing the complexity of operation control, and being more suitable for use on large-scale multiplier arrays such as NPU. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a schematic diagram of the process of performing m-bit signed multiplication using the indirect splitting method;

[0013] Figure 2 It is a schematic diagram of the process of performing 2m-bit signed multiplication using the indirect splitting method;

[0014] Figure 3 It is a schematic diagram of the process of performing 4m-bit signed multiplication using the indirect splitting method;

[0015] Figure 4 is a flow chart of a calculation control method in an embodiment of the present invention;

[0016] Figure 5 is a schematic diagram of performing a multiplication operation on a first input sequence and a second input sequence in an embodiment of the present invention;

[0017] Figure 6 Schematic diagram of the process of multiplication operation in an embodiment of the present invention;

[0018] Figure 7 is a schematic structural diagram of a computing control device in an embodiment of the present invention;

[0019] Figure 8 It is a structural schematic diagram of an operation control system in an embodiment of the present invention. DETAILED DESCRIPTION

[0020] Currently, when a multiplication operation is performed on a signed high-bit-width operand, a multiplier model in an electronic design automation (EDA) tool or a fabrication (FAB) design library may be directly called to implement the multiplication operation.

[0021] Although the above solution is the most direct, when using high-bitwidth multipliers directly, even after being optimized by EDA or FAB manufacturers, the area is still huge and the timing is very poor. It is usually difficult to run at a clock frequency above 200MHZ. In addition, instantiating a high-bitwidth multiplier cannot be equivalent to multiple low-bitwidth multipliers. For example, a 32-bit multiplier can only implement a 16-bit multiplication, even though the bit width of the input operand is only half. In this way, in scenarios where operands have different bit widths, this method is extremely inflexible and is generally not used in designs.

[0022] Another solution for performing multiplication operations on signed high-bit-width operands is to directly split the input operands. Specifically, the input signed operands are directly split into several shorter sequences, and then the shorter sequences are multiplied, and then the products are appropriately shifted and added to obtain the result of the original data multiplication.

[0023] For example, the input operands are X and Y. After directly splitting operand X, X can be expressed as:

[0024] X=P k-1 P k-2 ...P1P0 (1)

[0025] Where k is the number of split sequences. For any short sequence P i =a m(i+1)-1 ...a mi , k-1≥i≥0, m is a short sequence P i For example, if X is a 32-bit signed number, k=4 and m=8 are selected, then the 32-bit sequence is split into four 8-bit sequences.

[0026] Similarly, after directly splitting the operand Y, Y can be expressed as:

[0027] Y=Q k-1 Q k-2 ...Q1Q0 (2)

[0028] Among them, for any short sequence Q after Y is split j =b m(j+1)-1 ...b mj , k-1≥j≥0

[0029] Finally, when performing the multiplication operation on X and Y, k can be used 2 The m-bit multiplier is implemented as follows:

[0030]

[0031] In the direct splitting method, for the operand X, the split result is the short sequence P k-1is a signed number represented by two's complement, and the others are all unsigned binary numbers. For the operand Y, in the split result, the short sequence Q k-1 It is a signed number represented by two's complement, and the others are all unsigned binary numbers.

[0032] When the multiplier is used to implement formula (3), the short sequence P k-1 and Q k-1 The multiplication operations involved are all signed multiplication operations or signed multiplication by unsigned multiplication operations. The multiplication operations involved in other short sequences are all m-bit unsigned multiplication operations. Signed multiplication operations require the use of signed multipliers, while unsigned multiplication operations require the use of unsigned multipliers. Therefore, a total of 1 signed multiplier, 2k-2 signed multiplication by unsigned multipliers, and (k-1) 2 Among them, 2k-2 signed multipliers by unsigned multipliers generally require signed multipliers with a bit width of (m+1) bits to implement.

[0033] In the direct splitting method, since the types of multipliers used include multiple types and the types of multipliers are not uniform, the design of the multiplier array will be very complicated. In addition, it is difficult to determine the type of low-bit-width multipliers (such as m-bit multipliers) equivalent to this method, not to mention how to equivalent 2m-bit and 4m-bit multipliers, which are more flexible.

[0034] Another solution for performing multiplication operation on operands with high bit width of a sign is to perform indirect splitting of the input operands and use an m-bit unsigned multiplier to implement the multiplication operation on the split sequence. Specifically, operands X and Y are first converted to unsigned numbers and then split, and after performing multiplication operation on the split short sequence using an unsigned multiplier, the operation result is then sign-converted.

[0035] Among them, whether the multiplication operation is performed directly on the high-bit width operand or on the equivalent low-bit width operand, it is necessary to first take the absolute value of the operand, and then perform subsequent multiplication operations and sign conversion steps. Specifically, when taking the absolute value of the operand, first record the sign of the operand, and then calculate the absolute value of the operand.

[0036] For example, refer to Figure 1 , assuming that the operands with low bit width after the operand X is equivalent include X3, X2, X1 and X0, and the bit widths of X3, X2, X1 and X0 are all M bits, and the operands with low bit width after the operand Y is equivalent include Y3, Y2, Y1 and Y0, and the bit widths of Y3, Y2, Y1 and Y0 are also all M bits.

[0037] Before performing a multiplication operation on the operands of the lower width after the operand X is equivalent, the signs of X3, X2, X1 and X0 are first recorded as s3, s2, s1 and s0, and then the absolute values ​​of X3, X2, X1 and X0 are taken as |X3|, |X2|, |X1| and |X0|. Similarly, before performing a multiplication operation on the operands of the lower width after the operand Y is equivalent, the signs of Y3, Y2, Y1 and Y0 are first recorded as r3, r2, r1 and r0, and then the absolute values ​​of Y3, Y2, Y1 and Y0 are taken as |Y3|, |Y2|, |Y1| and |Y0|. Then, perform a multiplication operation on each absolute value to obtain the corresponding results |Z3|, |Z2|, |Z1| and |Z0|. Finally, the previously recorded sign bit is used to determine whether to negate the result of the multiplication operation.

[0038] Figure 2 Zhongyu Figure 1 The difference is that the low-bit width operands after the operand X is equivalent only include X1 and X0, and the low-bit width operands after the operand Y is equivalent only include Y1 and Y0. Among them, the bit width of X0 is 2M bits. The bit width of Y1 and Y0 is 2M bits.

[0039] When performing the multiplication operation, in order to adapt to the multiplier with a bit width of M bits, X0 is split into the lower M bits |X0| L and high M bits |X0| H , split X1 into the lower M bits |X1| L and high M bits |X1| H , split Y0 into the lower M bits |Y0| L and high M bit |Y0| H , split X0 into the lower M bits |Y0| L and high M position |Y1| H After obtaining the multiplication operation results T0 to T7, shift addition is performed first, and then the previously recorded sign bit is used to determine whether to invert the shift addition result.

[0040] Figure 3 and Figure 2 The difference is that the low-bit width operand after the operand X is equivalent only includes X0, and the low-bit width operand after the operand Y is equivalent only includes Y0. Among them, the bit width of X0 and Y0 are both 4M bits. The specific operation process can refer to the above Figure 2 The description is not repeated here.

[0041] Take X0 as an example. When taking the absolute value of operand X0, if X0 itself is a positive number, the absolute value of X0 is still X0 itself. If X0 itself is a negative number, it is necessary to take the opposite of X0, that is, first take the opposite of X0 bit by bit and then add 1, that is, |X0|=~X0+1. Figure 1In the example, when the width of X0 is M bits, the M bits need to be negated. Figure 2 In the example, when the width of X0 is 2M bits, the inverse of the 2M bits needs to be taken. Figure 3 In the figure, when the X0 bit width is 4M bits, the 4M bits need to be inverted. It can be seen that when using the non-direct splitting method to perform multiplication operations, three types of inversion operations, M / 2M / 4M, need to be performed according to the length of the input operands. Different types of operations are not compatible in circuit implementation, and the logic is very complicated.

[0042] Moreover, when using the indirect splitting method to perform multiplication operations, multiplications with different bit widths also require separate operation control based on the different bit widths of the input operands, which increases the complexity of the operation control and is not suitable for use on large-scale multiplier arrays such as NPU.

[0043] In view of the above problems, an embodiment of the present invention provides an operation control method. By applying the method, the first short sequence corresponding to the first operand and the second short sequence corresponding to the second operand are both signed numbers represented by binary complement codes, so a signed multiplier can be uniformly used to perform multiplication operations on the first short sequence and the second short sequence, thereby avoiding complex conversion between signed numbers and unsigned numbers and reducing the complexity of operation control. In addition, since the lengths of the first short sequence and the second short sequence are the same as the bit width of the signed multiplier, no matter what the bit width of the input operand is, they can be uniformly converted into short sequences with the same bit width as the signed multiplier, and corresponding multiplication operations can be performed, further reducing the complexity of operation control.

[0044] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0045] Reference Figure 4 , an embodiment of the present invention provides a calculation control method, the method may include the following steps:

[0046] Step 41, obtaining a first operand, and converting the first operand into a plurality of first short sequences, each of which is a signed number represented by a binary complement code.

[0047] In a specific implementation, the first operand may be obtained in a variety of ways, for example, the first operand may be read from a designated memory, or the first operand may be directly input from the outside.

[0048] In a specific implementation, there may be multiple methods for converting the first operand into a plurality of first short sequences, as long as the first short sequence composed of signed numbers represented by binary complement codes is equal to the original value of the first operand.

[0049] The bit width of the first operand is usually an integer multiple of the bit width of the signed multiplier. For example, when the input bit width of the signed multiplier is m bits, the bit width of the first operand can be km bits, where k is ≥ 1 and k is an integer. Of course, in some embodiments, the bit width of the first operand can be equivalent to an integer multiple of the bit width of the signed multiplier by complementing the high-order sign bit.

[0050] In a specific implementation, in order to be able to use a signed multiplier to perform a multiplication operation on the first short sequence later, the bit width of the first short sequence should be the same as the bit width of the signed multiplier. When there are multiple signed multipliers, the bit width of each signed multiplier can be the same or different, and the bit widths of the first short sequences corresponding to the first operand match the bit width of the signed multiplier.

[0051] In one embodiment of the present invention, when converting the first operand into a plurality of first short sequences, the first operand can be first split into a plurality of first split sequences according to the bit width of the signed multiplier, and then the first short sequence corresponding to the current first split sequence is obtained based on the binary complement sequence of the current first split sequence itself and the value of the highest bit of the binary complement sequence corresponding to the next first split sequence.

[0052] Assume that the number of the first short sequences is k, and accordingly, the number of the first split sequences is also k. i represents the i+1th first split short sequence, i∈[0,k-1], then the first operand X is split into several first split sequences, which can be expressed as:

[0053] X=P k-1 P k-2 ...P1P0 (4)

[0054] Among them, if the current first split short sequence is P i , then the next first split short sequence is P i-1 For example, the first split short sequence P k-1 The first split short sequence after is P k-2 , first split short sequence P k-2 The first split short sequence after is P k-3 ,…….

[0055] When the first operand X is a signed number, the first split sequence corresponding to the first operand X may include: an unsigned sequence, and a signed sequence including the highest bit of the first operand and represented by a binary complement. k-1 In the first split sequence P0 to P k-2 is an unsigned sequence, P k-1is a signed sequence. And, the signed sequence P k-1 It has been represented by a two's complement code, that is, the first split sequence P k-1 The corresponding first short sequence is itself. Subsequently, the unsigned sequence can be converted into the corresponding first short sequence.

[0056] If the current first split short sequence is P i , then the next first split short sequence is P i-1

[0057] Assume that the bit width of each signed multiplier is the same and is m bits. Correspondingly, the bit width of the first split sequence is also m bits. Then, the first split short sequence P can be obtained by formula (5): i The corresponding two's complement sequence

[0058]

[0059] From formula (5), we can see that when the first split short sequence P i The value (decimal) is less than 2 m-1 When the first split short sequence P i The corresponding two's complement sequence , that is, the first split short sequence P i When the first split short sequence P i The value is greater than or equal to 2 m-1 When the first split short sequence P i The corresponding two's complement sequence

[0060] Assumption c i The first split sequence The value of the highest bit of , then according to formula (6), several first short sequences corresponding to the first operand X can be obtained:

[0061]

[0062] in, is the first split sequence P k-1 The corresponding first short sequence, is the first split sequence P k-2 The corresponding first short sequence, is the first short sequence corresponding to the first split sequence P1, is the first short sequence corresponding to the first split sequence P0.

[0063] For example, a 32-bit signed first operand X = (8F927F81) hex, hex represents hexadecimal. The first operand X is a negative number. Assuming m=8, k=4, the first split sequence corresponding to the first operand X can be expressed as:

[0064] X=(8F) s (92) u (7F) u (81) u =(-113)(146)(127)(129) decimal

[0065] Among them, s represents two's complement, u represents unsigned, and decimal represents decimal value.

[0066] (8F) s 、(92) u 、(7F) u and (81) u are four first split sequences corresponding to the first operand. Among them, the first split sequence (8F) s is already a two's complement sequence. So we only need to determine (92) u 、(7F) u and (81) u The first split sequence (8F) s The next first split sequence is (92) u , the first split sequence (92) u The next first split sequence is (7F) u , the first split sequence (7F) u The next first split sequence is (81) u .

[0067] According to formula (5), we can get the first split sequence (92) u 、(7F) u and (81) u The corresponding two's complement sequences are:

[0068] (92) u =(146) dec =2 8 +(92) s

[0069] (7F) u =(7F) s

[0070] (81) u =2 8 +(81) s

[0071] First split sequence (92)u and (81) u The highest bit value of is 1, so in order to ensure that X is equal to the original value, according to formula (6), the first short sequence corresponding to the first operand X can be obtained as:

[0072] X=(8F+1) s (92) s (7F+1) s (81) s

[0073] Step 42: Obtain a second operand, and convert the second operand into a plurality of second short sequences, each of which is a signed number represented by a binary complement code.

[0074] In a specific implementation, the second operand can be obtained in a variety of ways. For example, the second operand can be read from a specified memory, or directly input from the outside. The method for obtaining the second operand can be the same as the method for obtaining the first operand, or it can be different.

[0075] In a specific implementation, there are multiple methods for converting the second operand into a plurality of second short sequences, as long as the second short sequence composed of signed numbers represented by the binary complement code is equal to the original value of the second operand. The number of the second short sequences is the same as the number of the first short sequences.

[0076] The bit width of the second operand is usually an integer multiple of the bit width of the signed multiplier. In some embodiments, the bit width of the second operand can be equivalent to an integer multiple of the bit width of the signed multiplier by complementing the high-order sign bit. The bit width of the second operand can be the same as the bit width of the first operand, or it can be different from the bit width of the first operand, without specific limitation.

[0077] For example, when the first operand corresponds to 5 first short sequences, three of which have a bit width of 2m bits, and the remaining two first short sequences have a bit width of 3m bits. The second operand corresponds to 5 second short sequences, three of which have a bit width of 2m bits, and the remaining two second short sequences have a bit width of 3m bits. At this time, 25 signed multipliers can be set, wherein the 25 signed multipliers can include the following 3 types, namely: 1. 2m*2m multipliers, the number is 3*3=9; 2. 3m*3m multipliers, the number is 2*2=4; 3. 2m*3m multipliers, the number is 2*3*2=12.

[0078] In one embodiment of the present invention, when converting the second operand into a plurality of second short sequences, the second operand can be first split into a plurality of second split sequences according to the bit width of the signed multiplier, and then the second short sequence corresponding to the current second split sequence is obtained based on the binary complement sequence of the current second split sequence itself and the value of the highest bit of the binary complement sequence corresponding to the next second split sequence.

[0079] Assuming that the number of the second short sequences is h, accordingly, the number of the second split sequences is also h. represents the j+1th second split short sequence, j∈[0,h-1], then the second operand Y is split into several second split sequences, which can be expressed as:

[0080] Y=Q h-1 Q j-2 ...Q1Q0; (7)

[0081] Regarding how to obtain the binary complement sequence corresponding to the second split sequence, please refer to the above-mentioned method for obtaining the first split sequence P. i The corresponding two's complement sequence The relevant description is implemented and will not be repeated here.

[0082] In a specific implementation, the second operand Y is converted into a plurality of second short sequences by the following method:

[0083]

[0084] in, The second split sequence Q j The two's complement sequence, w j The second split sequence Q j The highest bit value of , j∈[0, h-1], h is the number of the second short sequence. For details, please refer to the above about obtaining the first split sequence P i The corresponding description of the first short sequence is implemented and will not be repeated here.

[0085] It should be noted that, in a specific implementation, step 41 may be performed first and then step 42, or step 42 may be performed first and then step 41, or step 41 and step 42 may be performed simultaneously, and the specific execution order is not limited.

[0086] Step 43: input the first short sequence and the second short sequence into a signed multiplier, and control the signed multiplier to perform a multiplication operation on the first short sequence and the second short sequence.

[0087] In the embodiment of the present invention, a signed multiplier refers to a multiplier that can perform multiplication operations on signed numbers, that is, the data input to both input terminals of the multiplier are signed numbers, and the output result is also a signed number.

[0088] In the embodiment of the present invention, the number of the set signed multipliers should be greater than or equal to the product of the first short sequence number and the second short sequence number. When the number of signed multipliers is greater than the product of the first short sequence number and the second short sequence number, the number of signed multipliers equal to the product of the first short sequence number and the second short sequence number is used to perform the multiplication operation, and the remaining signed multipliers can be idle or perform multiplication operations on other operands.

[0089] The first short sequence and the second short sequence are input to a signed multiplier, wherein the first short sequence is input to one input terminal of the same signed multiplier and the second short sequence is input to the other input terminal. A trigger signal can be sent to the signed multiplier to trigger the signed multiplier to perform a multiplication operation.

[0090] It should be noted that, in a specific implementation, the bit width of each signed multiplier may be the same or different, and may be the same as the bit width of the first short sequence and the second short sequence input to the signed multiplier.

[0091] In order to reduce the implementation complexity, in one embodiment, the bit width of each signed multiplier can be set to be the same. Accordingly, the bit width of each first short sequence is also set to be the same and equal to the bit width of the signed multiplier. For example, when the bit widths of the first short sequence and the second short sequence are the same and both are m bits, the input bit width of the signed multiplier can be set to m*m bits.

[0092] When performing multiplication using the non-direct splitting method, the range of the m-bit signed number is -2 m-1 ~2 m-1 -1, its absolute value range is 0 to 2 m-1 , that is, when m-1 bits are used to represent the absolute value of the operand, there is an overflow problem because the number of bits of the absolute value is m bits, which is greater than m-1 bits. When m bits are used to represent the absolute value of the operand, the mth bit is only used when the absolute value of the operand is 2 m-1 It will only be used when it is needed, so there is a waste problem.

[0093] To this end, in order to avoid overflow and reduce waste, in one embodiment of the present invention, after obtaining the first short sequence, before inputting the first short sequence into a signed multiplier, the current first short sequence can be adjusted according to the value of the highest bit of the binary complement sequence corresponding to the subsequent first split sequence to obtain the first input sequence corresponding to the current first short sequence, and the first input sequence is input into the signed multiplier; the current first short sequence is the first short sequence corresponding to the current first split sequence.

[0094] The specific way of adjusting the current first short sequence is not limited. In one embodiment of the present invention, when the value of the highest bit of the binary complement sequence corresponding to the next first split sequence is 1, the first short sequence corresponding to the current split sequence can be firstly bitwise inverted, and then the binary complement sequence obtained after the bitwise inversion operation is marked to obtain the marked binary complement sequence corresponding to the current first split sequence, and the marked binary complement sequence is input to the signed multiplier. When the value of the highest bit of the binary complement sequence corresponding to the next first split sequence is 0, the first short sequence corresponding to the current first split sequence is kept input to the signed multiplier.

[0095] Take the first split sequence P i For example, the first split sequence P i The corresponding first short sequence is Considering the first short sequence If overflow occurs, the first input sequence S finally input to the signed multiplier can be obtained according to the following formula: i :

[0096]

[0097] That is, when the first split sequence P i The value c of the highest bit of the first split sequence after i-1 = 0, the first input sequence At this time, the first input sequence S i The value range is -2 m-1 ~2 m-1 -1.

[0098] But when the first split sequence P i The value c of the highest bit of the first split sequence after i-1 =1, The value range is -2 m-1 +1~2 m-1 , which exceeds the range of the signed multiplier with a bit width of m bits, so we can use The opposite number of the first input sequence S is recorded i , so that the first input sequence S i The value range is still -2 m-1 ~2 m-1 -1.

[0099] because and ~ means bitwise inversion. We can see that the process of +1 is exactly offset by the process of -1. The value of is just The bitwise inversion avoids the complex logic of +1.

[0100] With the first operand X = (8F927F81) hex Take this as an example to illustrate, as mentioned above, the first short sequence corresponding to the first operand X is:

[0101] X=(8F+1) s (92) s (7F+1) s (81) s .

[0102] Since the first short sequence (7F+1) s Overflow occurs. To avoid this phenomenon, the first short sequence with +1 operation can be multiplied by -1 after +1 to mark the binary complement sequence. At this time, (7F+1) s =((7F+1)·(-1)) s ·(-1)=(80) s ·(-1), according to the previous derivation (80), it is the bitwise inversion of (7F), and there is no process of bitwise inversion and adding 1. At this time, the first input sequence corresponding to each first short sequence of the first operand can be obtained, and the complete split result of the first operand X can be obtained:

[0103] X=8F927F81=((70) s ·(-1))(92) s ((80)·(-1)) s (81) s .

[0104] Similarly, after obtaining the second short sequence, before inputting the second short sequence into the signed multiplier, the current second short sequence may also be adjusted according to the value of the highest bit of the binary complement sequence corresponding to the subsequent second split sequence to obtain the second input sequence corresponding to the current second short sequence, and the second input sequence is input into the signed multiplier, and the current second short sequence is the second short sequence corresponding to the current second split sequence. There is no specific limitation on the way of adjusting the current second short sequence.

[0105] In one embodiment of the present invention, if the value of the highest bit of the binary complement sequence corresponding to the next second split sequence is 1, the second short sequence corresponding to the current second split sequence can be firstly bitwise inverted, and then the binary complement sequence obtained after the bitwise inversion operation is marked to obtain the marked binary complement sequence corresponding to the current second split sequence, and the marked binary complement sequence is input to the signed multiplier. If the value of the highest bit of the binary complement sequence corresponding to the next second split sequence is 0, the second short sequence corresponding to the current second split sequence is kept input to the signed multiplier.

[0106] As to how to perform bitwise inversion on the second short sequence, reference may be made to the above description on how to perform bitwise inversion on the first short sequence for implementation, which will not be described in detail here.

[0107] Step 44, shift and accumulate the multiplication operation result to obtain the multiplication operation result of the first operand and the second operand.

[0108] In some embodiments, when the value of the highest bit of the binary complement sequence corresponding to the subsequent first split sequence is 0, and the value of the highest bit of the binary complement sequence corresponding to the subsequent second split sequence is also 0, the first short sequence and the second short sequence will be sent to the instantiated multiplier to obtain partial products, and the partial products can be processed to obtain the correct result.

[0109] In some embodiments, when the value of the highest bit of the binary complement sequence corresponding to the next first split sequence is 1, the first input sequence corresponding to the first short sequence will be sent to the signed multiplier. When the value of the highest bit of the binary complement sequence corresponding to the next second split sequence is 1, the second input sequence corresponding to the second short sequence will be sent to the signed multiplier. The correct result can be obtained by processing the partial product of the signed multiplier.

[0110] In one embodiment of the present invention, after determining the first input sequence and the second input sequence corresponding to the multiplication operation result, the multiplication operation result can be adjusted in positive or negative based on the value of the highest bit of the next first split sequence corresponding to the first input sequence and the value of the highest bit of the next second split sequence corresponding to the second input sequence, and the adjusted multiplication operation result can be shifted and accumulated.

[0111] Take the first input sequence S i and the second input sequence R j For example, the first input sequence S i The corresponding first short sequence is The first short sequence is The corresponding first split sequence is P i , so the first input sequence Si The corresponding next first split sequence is P i-1 The second input sequence R j The corresponding second short sequence is The second short sequence is The corresponding second split sequence is Q j , so the second input sequence R j The corresponding next second split sequence is Q j-1 . The first input sequence S i and the second input sequence R j Send it to the multiplier to get the partial product Z i,j =R i ·S j For details, please refer to Figure 5 .

[0112] Assume that the first input sequence S i The corresponding next first split sequence P i-1 The highest bit value is c S,i-1 , the second input sequence R j The corresponding next second split sequence The highest bit value is c R,j-1 , and then get the partial product Z i,j Afterwards, it can be The value of Z is used to determine whether to perform partial product Z i,j Make positive and negative shape adjustments, that is, whether to adjust the partial product Z i,j Take the opposite number.

[0113] In a specific implementation, a signed multiplier with the same input bit width can be used to implement multiplication operations on operands with various bit widths.

[0114] For example, when the input bit width of the signed multiplication is 8 bits and the multiplication operation is performed on two operands with a bit width of 32 bits, assuming that the first operand X = (8F927F81) hex , the second operand Y = (34FF80C1) hex , from the above description of steps 41 and 43, the complete splitting result corresponding to the first operand X can be obtained as follows:

[0115] X=8F927F81=((70) s ·(-1))(92) s ((80)·(-1)) s (81) s .

[0116] From the above description of steps 42 and 43, the second input sequence corresponding to each second short sequence of the second operand Y can be obtained, and the complete splitting result corresponding to the second operand Y can be obtained as follows:

[0117] Y=((CB) s ·(-1))((00) s ·(-1))((7F) s ·(-1))(C1) s .

[0118] After each first input sequence and second input sequence are input to the signed multiplier, the result of the multiplication operation is shown in Table 1. Referring to Table 1, for example, the first input sequence (CB) s With the second input sequence (70) s When the first operand X and the second operand Y are multiplied, the -1 of the two operands cancel each other out according to the record, and the result of multiplying C1 and 70 needs to be corrected by multiplying by -1. In the partial product corresponding to the first operand X and the second operand Y, the result that needs to be corrected is marked in dark color in Table 1.

[0119] Table 1:

[0120]

[0121] The partial product results at the dark positions in Table 1 are corrected, that is, the partial product results at the dark positions in Table 1 are multiplied by (-1). The corrected results are shown in Table 2:

[0122] Table 2:

[0123]

[0124] In a specific implementation, when the modified partial products are shifted and accumulated, there may be a variety of operations. In one embodiment, taking Table 2 as an example, every four cells in Table 2 may be formed into a group, and the two partial products of the diagonal divisions in the group may be spliced, and then the spliced ​​results are added, and finally the added results are shifted to obtain shift results Z0, Z1, Z2 and Z3, and finally the shift results Z0, Z1, Z2 and Z3 are spliced, added, and finally shifted. Specifically:

[0125] Z0=(E8D00000) hex +(E93A+0000) hex <<8;

[0126] Z1=(37901B12) hex +(3692+1B90) hex <<8;

[0127] Z2=(1A800000) hex +(E5B5+0000) hex <<8;

[0128] Z3=(C0801F41)hex +(3F01+E080) hex <<8.

[0129] Then Z0, Z1, Z2 and Z3 are operated in the same way to obtain the multiplication result Z of the first operand and the second operand:

[0130] Z=(Z0Z3) hex +(Z1+Z2) hex <<16.

[0131] When using a signed multiplier with an input bit width of 8 bits to perform a multiplication operation on two operands with a bit width of 64 bits, assuming that the first operand X = (7348) hex (A19F) hex (8F92) hex (7F81) hex , the second operand Y = (B518) hex (FFFF) hex (34FF) hex (80C1) hex X and Y each include 4 signed 16-bit data, and each signed 16-bit data is called an element. The dot product result Z of the first operand X and the second operand Y is the result of multiplying the corresponding elements in X and Y.

[0132] According to the description of step 41, the first split sequence corresponding to the first operand X is: X=[(73)(48)][(A1)(9F)][(8F)(92)][(7F)(81)]. According to the description of step 42, the second split sequence corresponding to the second operand Y is: Y=[(B5)(18)][(FF)(FF)][(34)(FF)][(80)(C1)].

[0133] According to the description of step 43, the first input sequence corresponding to each first split sequence of the first operand X can be obtained, thereby obtaining the complete split result of the first operand X:

[0134] X=[(73) s (48) s ][((5F) s ·(-1))(9F) s ][((70) s ·(-1))(92) s ][((80) s ·(-1))(81) s ].

[0135] According to the description of step 43, the second input sequence corresponding to each second split sequence of the second operand Y can be obtained, thereby obtaining the complete split result of the second operand Y:

[0136] Y=[(B5) s (18) s ][((00) s ·(-1))(FF) s ][((CB) s ·(-1))(FF) s ][((7F) s ·(-1))(C1) s ].

[0137] The first input sequence and the second input sequence are input into the signed multiplier, and the partial product result can be obtained as shown in Table 3:

[0138] Table 3:

[0139]

[0140] When the partial product results in Table 3 are shifted and accumulated, the shift results Z0, Z1, Z2 and Z3 can be obtained in the same way as the above shift of the operand with a bit width of 32 bits:

[0141] Z0=(E8D0006E) hex +(E93A+0070) hex <<8

[0142] Z1=(514F06C0) hex +(32E8+0AC8) hex <<8;

[0143] Z2=(00009E61) hex +(A15F+0000) hex <<8;

[0144] Z3=(C0801F41) hex +(3F01+E080) hex <<8

[0145] The shift results Z0, Z1, Z2 and Z3 are the products of the elements corresponding to the first operand X and the second operand Y.

[0146] In the embodiment of the present invention, when the input bit width m of the signed multiplier is determined, for example, in the above embodiment, the input bit width m of the signed multiplier is 8, then different types of multiplication, such as 32-bit multiplication (i.e., the operand bit width is 32 bits), 16-bit multiplication (i.e., the operand bit width is 16 bits) or 8-bit multiplication (i.e., the operand bit width is 8 bits), or even mixed bit width multiplication (such as 24-bit operand multiplied by 16-bit operand), can be processed using the steps described in the embodiment of the present invention, that is, multiplication corresponding to different modes can have the same processing process, simplifying the complexity of compatible design of multiplication of different modes. After obtaining the multiplication operation, how to perform shift accumulation can be determined according to the required multiplication type (i.e., the bit width of the input operand).

[0147] When m=16, the same operands are used but only one-fourth of the number of 16-bit signed multipliers is used compared to when m=8. It is understood that in the embodiment of the present invention, the above m=16 embodiment is only used for comparison with the m=8 embodiment. In actual use, the bit width of the input operand is usually adjusted to 64 bits, so that four 16-bit multiplications can be performed simultaneously.

[0148] It should be noted that, in practical applications, the input bit width m of the signed multiplier can be set according to actual requirements determined by factors such as the bit width of the operand. Regardless of the input bit width m of the signed multiplier, the operation control method in the embodiment of the present invention can be used for operation control.

[0149] Figure 6 Schematic diagram of the operation process in the embodiment of the present invention. Figure 6 , when the input bit width of the signed multiplier is m bits, if the bit width of the input first operand X is 4m bits, the first operand can be converted into 4 first short sequences X0, X1, X2 and X3 with a bit width of m bits, and the signs s0, s1, s2 and s3 of each first short sequence X0, X1, X2 and X3 are marked. Afterwards, the first short sequences X0, X1, X2 and X3 are bit-inverted respectively to obtain the corresponding first input sequences X0', X1', X2' and X3'.

[0150] Similarly, if the bit width of the input second operand Y is 4m bits, the second operand Y can be converted into 4 second short sequences Y0, Y1, Y2 and Y3 with a bit width of m bits, and the symbols r0, r1, r2 and r3 of each second short sequence Y0, Y1, Y2 and Y3 are marked. Afterwards, the second short sequences Y0, Y1, Y2 and Y3 are bitwise inverted to obtain the corresponding second input sequences Y0', Y1', Y2' and Y3'.

[0151] The first input sequence X0', X1', X2' and X3', and the second input sequence Y0', Y1', Y2' and Y3' are input to 16 m-bit signed multipliers to obtain multiplication operation results T0 to T16. Then, based on the previously recorded signs, the multiplication operation results T0 to T16 are sign-adjusted so that each adjusted multiplication operation result is an m-bit signed multiplication output result. In the adjusted multiplication operation results, every 4 cells are shift-added, and the shift-added results are accumulated to obtain 4m-bit signed multiplication operation results.

[0152] It is understandable that the embodiments of the present invention can arbitrarily adjust the number and bit width of the first input sequence and the second input sequence to achieve corresponding multiplication operation control. For example, various multiplications of 2m bits and m bits, 4m bits and m bits, and 4m bits and 2m bits can be achieved, and all adopt the same processing flow.

[0153] Specifically, when the bit width of the operand is m bits, since the bit width of the operand is equal to the input bit width of the signed multiplier, there is no need to split the operand X. Instead, the sign of the operand is directly recorded to obtain the corresponding input sequence.

[0154] When the bit width of the operand is 2m bits, the operand can be first split into two split sequences, and the signs of the split sequences can be recorded to determine the corresponding input sequence. For example, the first operand X can be split into the first split sequences X0 and X3, and the signs of the first split sequences X0 and X3 can be recorded to determine the first input sequences X0' and X3', and then input into the multiplier for multiplication operation.

[0155] from Figure 6 It can be seen that after the first operand X is split into m bits, only the bitwise inversion operation is performed. Whether the bitwise inversion is performed depends only on the bit width of the operand and the input bit width of the signed multiplier. For example, when performing an m-bit multiplication operation, the split short sequence is m bits, and there is no subsequent short sequence. When performing 2m-bit multiplication, the last sequence in every 2 m-bit short sequences is not inverted. Whether to perform the bitwise inversion operation does not require attention to the situation of all bits of the subsequent first split sequence, and the complexity is greatly simplified, especially in the data path. The logic is very simple.

[0156] In addition, at the output end, the position of the negation is only present after the multiplication operation, that is, the negation operation is performed only on the multiplication operation result (T0 to T15) output by the multiplier. The negation operation is performed relative to the shift accumulation result (refer to Figures 2 and Figure 3), on the one hand, the bit width of the multiplication result is smaller, and the difficulty of performing the negation operation on it is also smaller; on the other hand, during the multiplication operation, the number of shifts performed on different multiplication results may be different. Therefore, when the hardware is implemented, the position of the module that performs the negation operation on the shift accumulation result is not fixed, resulting in great difficulty in implementation. When the negation operation is performed on the multiplication result, the position of the module that performs the negation operation is fixed, which reduces the difficulty of implementation.

[0157] Moreover, regardless of the bit width of the input operands and whether the bit widths of the two operands are the same, the same signed multiplier can be used for multiplication operations. The signed multiplier has a high degree of reuse and is more suitable for scenarios where large-scale arrays are used in GPU and NPU designs. It has consistent and isomorphic structural characteristics.

[0158] For example, when a 32-bit operand is multiplied by another 32-bit operand, assuming that the short sequence length m = 8, a signed multiplier type with an input bit width of 4m can be used to implement the multiplication operation. When a 16-bit operand is multiplied by another 16-bit operand, assuming that the short sequence length m = 8, a signed multiplier type with an input bit width of 4m can still be used to implement the multiplication operation.

[0159] In the embodiment of the present invention, the number of signed multipliers can generally be an integer power of 4. For example, the operation control system can include 64 8-bit signed multipliers. Using the 64 8-bit signed multipliers, 4 32-bit multiplication operation results can be obtained, 16 16-bit multiplication operation results can be obtained, and 64 8-bit multiplication operation results can be obtained. When the input bit width and number of the signed multipliers are fixed, multiplication operation results of different bit widths can be obtained according to user needs, so the flexibility is higher. In order to enable those skilled in the art to better understand and implement the present invention, the user terminal and computer-readable storage medium corresponding to the above method are described in detail below.

[0160] Reference Figure 7 The embodiment of the present invention further provides an operation control device 70, which may include: a first conversion unit 71, a second conversion unit 72, an operation control unit 73 and a shift accumulation unit 74. Wherein:

[0161] The first conversion unit 71 is adapted to obtain a first operand and convert the first operand into a plurality of first short sequences, each of which is a signed number represented by a binary complement code;

[0162] The second conversion unit 72 is adapted to obtain a second operand and convert the second operand into a plurality of second short sequences, each of which is a signed number represented by a binary complement code;

[0163] The operation control unit 73 is adapted to input the first short sequence and the second short sequence into a signed multiplier, and control the signed multiplier to perform a multiplication operation on the first short sequence and the second short sequence;

[0164] The shift-accumulate unit 74 is adapted to perform shift-accumulation on the multiplication operation result to obtain the multiplication operation result of the first operand and the second operand;

[0165] The number of the second short sequences is the same as the number of the first short sequences; the bit widths of the first short sequences and the second short sequences are the same as the input bit widths of the signed multipliers; the number of the signed multipliers is greater than or equal to the number of the first short sequences.

[0166] Regarding the various functional units included in the operation control device 70, they can be implemented specifically with reference to the description of the corresponding steps in the above-mentioned operation control method, and will not be repeated here.

[0167] Reference Figure 8 The embodiment of the present invention further provides an operation control system, which includes the above-mentioned operation control device 70 and a plurality of signed multipliers 80.

[0168] The operation control device 70 can be connected to the signed multiplier 80; the signed multiplier 80 is suitable for performing multiplication operations under the control of the operation control device 70; the number of the signed multipliers 80 is greater than or equal to the number of the first short sequences in the operation control device 70.

[0169] In a specific implementation, the operation control device 70 may input the first short sequence and the second short sequence, the first short sequence and the second input sequence, the first input sequence and the second short sequence, or the first input sequence and the second input sequence into the signed multiplier 80, and control the signed multiplier 80 to perform a multiplication operation on them. After the multiplication operation, the operation control device 70 may obtain the multiplication operation result, perform a shift-accumulate operation, and finally output the final multiplication operation result of the first operand and the second operand.

[0170] An embodiment of the present invention further provides a processor, which includes the above-mentioned operation control system.

[0171] In a specific implementation, the processor may be an NPU or a processor, and there is no specific limitation thereto.

[0172] By using the processor, a plurality of signed multipliers can be used to implement multiplication operations of two operands of arbitrary bit widths, and the overall operation control is simple and the complexity is low.

[0173] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the steps of the above-mentioned operation control method, which will not be described in detail.

[0174] In a specific implementation, the computer-readable storage medium may include: ROM, RAM, magnetic disk or optical disk, etc.

[0175] Regarding the various modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, or hardware modules / units, or they can be partially software modules / units and partially hardware modules / units. For example, for various devices and products applied to or integrated in a chip, the various modules / units included therein can all be implemented in the form of hardware such as circuits, or at least some of the modules / units can be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in a chip module, the various modules / units included therein can all be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least some of the modules / units can be implemented in the form of hardware such as circuits. The element can be implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.

[0176] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.

Claims

1. A calculation control method, characterized in that: include: Obtain a first operand, and convert the first operand into a plurality of first short sequences, each of which is a signed number represented by a binary complement code; Obtain a second operand, and convert the second operand into a plurality of second short sequences, each of which is a signed number represented by a two's complement code; Inputting the first short sequence and the second short sequence into a signed multiplier, and controlling the signed multiplier to perform a multiplication operation on the first short sequence and the second short sequence; Shifting and accumulating the multiplication operation result to obtain the multiplication operation result of the first operand and the second operand; The number of the second short sequences is the same as the number of the first short sequences; the bit widths of the first short sequence and the second short sequence are the same as the input bit width of the signed multiplier; the number of the signed multipliers is greater than or equal to the product of the number of the first short sequences and the number of the second short sequences; The converting the first operand into a plurality of first short sequences comprises: splitting the first operand into a plurality of first split sequences according to the input bit width of the signed multiplier; obtaining a first short sequence corresponding to the current first split sequence according to the binary complement sequence of the current first split sequence and the value of the highest bit of the binary complement sequence corresponding to the next first split sequence; The converting the second operand into a plurality of second short sequences includes: splitting the second operand into a plurality of second split sequences according to the input bit width of the signed multiplier; and obtaining a second short sequence corresponding to the current second split sequence according to the binary complement sequence of the current second split sequence itself and the value of the highest bit of the binary complement sequence corresponding to the next second split sequence.

2. The operation control method according to claim 1, characterized in that: The first operand X is converted into a plurality of first short sequences by the following method: in, is the first split sequence P i The two's complement sequence, c i The first split sequence The value of the highest bit of , i∈[0,k-1], k is the number of the first short sequence.

3. The calculation control method according to claim 1 or 2, characterized in that: After obtaining the first short sequence, before inputting the first short sequence into the signed multiplier, the method further includes: According to the value of the highest bit of the binary complement sequence corresponding to the subsequent first split sequence, the current first short sequence is adjusted to obtain a first input sequence corresponding to the current first short sequence, and the first input sequence is input to a signed multiplier; the current first short sequence is the first short sequence corresponding to the current first split sequence.

4. The calculation control method according to claim 3, characterized in that: The step of adjusting the current first short sequence according to the value of the highest bit of the binary complement sequence corresponding to the subsequent first split sequence to obtain the first input sequence corresponding to the current first short sequence includes: When the value of the highest bit of the binary complement sequence corresponding to the subsequent first split sequence is 1, a bitwise inversion operation is performed on the first short sequence corresponding to the current split sequence, and the binary complement sequence obtained after the bitwise inversion operation is marked to obtain a first input sequence corresponding to the current first split sequence; When the value of the highest bit of the binary complement sequence corresponding to the subsequent first split sequence is 0, the first short sequence corresponding to the current first split sequence is used as the first input sequence.

5. The calculation control method according to claim 1, characterized in that: The second operand Y is converted into a plurality of second short sequences by the following method: in, The second split sequence Q j The two's complement sequence, w j The second split sequence Q j The value of the highest bit of , j∈[0,h-1], h is the number of the second shortest sequence.

6. The calculation control method according to claim 1 or 5, characterized in that: After obtaining the second short sequence, before inputting the second short sequence into the signed multiplier, the method further includes: According to the value of the highest bit of the binary complement sequence corresponding to the subsequent second split sequence, the current second short sequence is adjusted to obtain a second input sequence corresponding to the current second short sequence, and the second input sequence is input to the signed multiplier, and the current second short sequence is the second short sequence corresponding to the current second split sequence.

7. The calculation control method according to claim 6, characterized in that: The step of adjusting the current second short sequence according to the value of the highest bit of the binary complement sequence corresponding to the subsequent second split sequence to obtain the second input sequence corresponding to the current second short sequence includes: When the value of the highest bit of the binary complement sequence corresponding to the subsequent second split sequence is 1, a bitwise inversion operation is performed on the second short sequence corresponding to the current second split sequence, and the binary complement sequence obtained after the bitwise inversion operation is marked to obtain a second input sequence corresponding to the current second split sequence; When the value of the highest bit of the binary complement sequence corresponding to the subsequent second split sequence is 0, the second short sequence corresponding to the current second split sequence is used as the second input sequence.

8. The calculation control method according to claim 1, characterized in that: After obtaining the multiplication operation result, and before performing shift accumulation on the multiplication operation result, the method further includes: Determine a first input sequence and a second input sequence corresponding to the multiplication operation result; the first input sequence is a sequence obtained by adjusting the current split sequence according to the value of the highest bit of the binary complement sequence corresponding to the next first split sequence; the second input sequence is a sequence obtained by adjusting the current second short sequence according to the value of the highest bit of the binary complement sequence corresponding to the next second split sequence; Based on the highest bit value of the next split sequence corresponding to the first input sequence and the highest bit value of the next split sequence corresponding to the second input sequence, the multiplication operation result is adjusted positively or negatively, and the adjusted multiplication operation result is shifted and accumulated.

9. A computing control device, characterized in that: include: A first conversion unit, adapted to obtain a first operand and convert the first operand into a plurality of first short sequences, each of which is a signed number represented by a binary complement code; A second conversion unit, adapted to obtain a second operand and convert the second operand into a plurality of second short sequences, each of which is a signed number represented by a two's complement code; an operation control unit, adapted to input the first short sequence and the second short sequence into a signed multiplier, and control the signed multiplier to perform a multiplication operation on the first short sequence and the second short sequence; a shift-accumulate unit, adapted to perform shift-accumulation on the multiplication operation result to obtain a multiplication operation result of the first operand and the second operand; The number of the second short sequences is the same as the number of the first short sequences; the bit widths of the first short sequence and the second short sequence are the same as the input bit width of the signed multiplier; the number of the signed multipliers is greater than or equal to the product of the number of the first short sequences and the number of the second short sequences; The first conversion unit is adapted to split the first operand into a plurality of first split sequences according to the input bit width of the signed multiplier; obtain a first short sequence corresponding to the current first split sequence according to the binary complement sequence of the current first split sequence and the value of the highest bit of the binary complement sequence corresponding to the next first split sequence; The second conversion unit is suitable for splitting the second operand into a plurality of second split sequences according to the input bit width of the signed multiplier; and obtaining a second short sequence corresponding to the current second split sequence based on the binary complement sequence of the current second split sequence itself and the value of the highest bit of the binary complement sequence corresponding to the next second split sequence.

10. A computing control system, characterized in that: include: The operation control device according to claim 9; and a number of signed multipliers; Wherein, the operation control device is connected to the signed multiplier; the signed multiplier is suitable for performing multiplication operations under the control of the operation control device; the number of the signed multipliers is greater than or equal to the product of the number of first short sequences and the number of second short sequences in the operation control device.

11. A processor, comprising the operation control system according to claim 10.

12. A computer storage medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement the steps of the method according to any one of claims 1 to 8.