Serial multiplier, data processing method, electronic equipment and medium

By using bit-width splicing modules and registers in the serial multiplier, only the M bits of the multiplier accumulation data signal and the multiplicand accumulation data signal are added, and the L minus M bits of the result are bit-width spliced, It solves the problem that traditional serial multipliers occupy large circuit resources when multiplying large bit-width data, and achieves the effect of reducing system power consumption.

CN118626048APending Publication Date: 2024-09-10VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410829859.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

When the data bit width that needs to be multiplied is large, the adder of the traditional serial multiplier needs to support a larger bit width, resulting in large circuit resource usage and high system power consumption.

Method used

By introducing a bit-width splicing module and register in the serial multiplier, only the M bits of the multiplier accumulation data signal and the multiplicand accumulation data signal are added, and the L minus M bits of the result are bit-width spliced. Reduce the input bit width of the adder, thereby reducing the circuit resources occupied by the adder.

Benefits of technology

It effectively reduces the circuit resources occupied by the adder, reduces the system power consumption, and optimizes the circuit overhead during the multiplication process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626048A
    Figure CN118626048A
Patent Text Reader

Abstract

The invention discloses a serial multiplier, a data processing method, electronic equipment and a medium, and belongs to the technical field of electronic circuits. Comprising an adder, a bit width splicing module and a first register, the first input end of the bit width splicing module is connected with the output end of the summator; the second input end of the bit width splicing module is connected with the output end of the first register; the output end of the bit width splicing module is connected with the input end of the first register; the adder is used for carrying out additive operation on M bits in the input multiplicand accumulation data signal and the multiplication accumulation storage data signal to obtain and output the multiplication accumulation data signal, and the bit width of the M bits is the same as that of the multiplicand accumulation data signal; and the bit width splicing module is used for carrying out bit width splicing on the product accumulation data signal and N bits of a first product output signal output by the first register and generating and outputting a second product output signal to the first register, the bit width of the first product output signal is L, and N is equal to L minus M.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of electronic circuit technology, and specifically relates to a serial multiplier, a data processing method, an electronic device and a medium. Background Art

[0002] A serial multiplier is a digital circuit that works by splitting the multiplication operation into a series of bit operations and implementing the multiplication operation through bitwise shift, addition, and accumulation. Serial multipliers are often used in digital signal processing, inter-frame operations, and other scenarios.

[0003] In the related art, when the bit width of the data to be multiplied is large, when a serial multiplier is used to multiply the data, the adder in the serial multiplier needs to support a large bit width. For example, when a serial multiplier is used to multiply a multiplicand with a bit width of 5 bits and a multiplier with a bit width of 5 bits, the minimum bit width of the input end of the adder in the serial multiplier is 9 bits. Since the adder needs to support a large bit width, it occupies a large amount of circuit resources, resulting in a large power consumption of the system. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a serial multiplier, which can reduce the circuit resources occupied by the adder in the serial multiplier, thereby reducing the power consumption of the system.

[0005] In a first aspect, an embodiment of the present application provides a serial multiplier, which includes: an adder, a bit width splicing module and a first register, wherein the first input end of the bit width splicing module is connected to the output end of the adder, and the second input end of the bit width splicing module is connected to the output end of the first register; the output end of the bit width splicing module is connected to the input end of the first register; the adder is used to perform addition operation on the M bits of the input multiplicand accumulation data signal and the product accumulation storage data signal to obtain and output the product accumulation data signal, and the bit width of M bits is the same as the bit width of the multiplicand accumulation data signal; the bit width splicing module is used to perform bit width splicing on the product accumulation data signal and the N bits of the first product output signal output by the first register to generate a second product output signal, and output the second product output signal to the first register, and the bit width of the first product output signal is L, and N is equal to L minus M.

[0006] In the second aspect, an embodiment of the present application provides a data processing method based on a serial multiplier, the method comprising: obtaining a multiplicand accumulation data signal and a product accumulation storage data signal; performing addition operation on the M bits of the multiplicand accumulation data signal and the product accumulation storage data signal to obtain and output the product accumulation data signal, the bit width of the M bits being the same as the bit width of the multiplicand accumulation data signal; performing bit width splicing on the product accumulation data signal and the N bits of the first product output signal to generate and output a second product output signal, the bit width of the first product output signal being L, and N being equal to L minus M.

[0007] In the third aspect, an embodiment of the present application provides a data processing device based on a serial multiplier, which includes: an acquisition module and a processing module; the acquisition module is used to acquire the multiplicand accumulation data signal and the product accumulation storage data signal; the processing module is used to perform addition operation on the M bits of the multiplicand accumulation data signal and the product accumulation storage data signal to obtain and output the product accumulation data signal, and the bit width of the M bits is the same as the bit width of the multiplicand accumulation data signal; the processing module is also used to perform bit width splicing on the product accumulation data signal and the N bits of the first product output signal to generate and output a second product output signal, and the bit width of the first product output signal is L, and N is equal to L minus M.

[0008] In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the second aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the second aspect are implemented.

[0010] In a sixth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the second aspect.

[0011] In a seventh aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the second aspect.

[0012] In an embodiment of the present application, a serial multiplier includes an adder, a bit width splicing module and a first register, a first input end of the bit width splicing module is connected to the output end of the adder, a second input end of the bit width splicing module is connected to the output end of the first register, and the output end of the bit width splicing module is connected to the input end of the first register, the adder is used to perform addition operation on the input multiplicand accumulation data and the M bits in the product accumulation storage data signal to obtain and output the product accumulation data signal, the bit width of the M bits is the same as the bit width of the multiplicand accumulation data signal, the bit width splicing module is used to perform bit width splicing on the product accumulation data signal and the N bits of the first product output signal output by the first register to generate a second product output signal, and output the second product output signal to the first register, the bit width of the first product output signal is L, and N is equal to L minus M. In this way, the M bits in the product-accumulation storage data signal and the multiplicand accumulation data signal are added by an adder, and then the obtained product-accumulation data signal and the L minus M bits of the first product output signal output by the first register are bit-width spliced ​​to obtain a second product output signal. Since the adder only needs to add the M bits in the product-accumulation storage data signal that have the same bit width as the multiplicand accumulation data signal, the bit width of the input end of the adder can be the bit width M of the multiplicand, thereby reducing the circuit resources occupied by the adder and reducing the system power consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 One of the circuit diagrams of the circuit working process and composition overview of the serial multiplier provided in the embodiment of the present application;

[0014] Figure 2 A second circuit diagram showing the circuit working process and configuration overview of the serial multiplier provided in an embodiment of the present application;

[0015] Figure 3 A third circuit diagram showing the circuit working process and configuration overview of the serial multiplier provided in an embodiment of the present application;

[0016] Figure 4 A fourth circuit diagram showing the circuit working process and configuration overview of the serial multiplier provided in an embodiment of the present application;

[0017] Figure 5 A schematic diagram of the control signal timing provided in an embodiment of the present application;

[0018] Figure 6 One of the flow charts of the data processing method based on the serial multiplier provided in the embodiment of the present application;

[0019] Figure 7 A second flow chart of a data processing method based on a serial multiplier provided in an embodiment of the present application;

[0020] Figure 8 A schematic diagram of the structure of a data processing device based on a serial multiplier provided in an embodiment of the present application;

[0021] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0022] Fig.10 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0024] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0025] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0026] In the field of Image Signal Processing (ISP) ASIC chips, inter-frame operation is an important image and video processing technology. Inter-frame operation mainly extracts useful information from the image or improves image quality by comparing and analyzing the differences and associations between consecutive image frames.

[0027] In the related art, there are many intra-frame statistical parameters that need to be multiplied between frames and used for the next frame calculation. For example, when processing continuous image frames, the image parameters obtained from the previous frame statistics, such as brightness information, are usually used to optimize the next frame through inter-frame multiplication by serial multipliers to improve the quality of the image frame. However, the intra-frame statistical parameters usually have a large data bit width, and the use of traditional parallel multipliers will result in huge multiplier circuit resource overhead. Since inter-frame calculations do not have subsequent data squeezing compared to intra-frame calculations, there are no excessive requirements for the multiplication calculation processing time. The serial multiplier can use its own time-sharing multiplexing method for the adder, replace parallel multiplication by continuous accumulation, and reduce the multiplier circuit resource overhead by exchanging time for space.

[0028] Traditional serial multipliers use simple and intuitive bitwise accumulation. Take 3'd7(3'b111)*3'd5(3'b101) as an example ((data width is based on binary)'(data value display system, d is decimal, b is binary) (data value), take 3'd7 as an example, 3-bit width data, data value is 7 in decimal), the calculation formula is:

[0029] 3'b111*3'b101=(1'b1&3'b111)+(1'b0&4'b1110)+(1'b1&5'b11100)

[0030] The calculation principle is: by judging whether each bit of the multiplier is 1, it is decided whether to add the multiplicand shifted to the left corresponding bit to get the result, and the adder used adopts a time-sharing multiplexing strategy.

[0031] Specifically, in the related art, when performing multiplication operations through a serial multiplier, it is checked whether the current lowest bit of the multiplier (usually the first bit from the right) is 1. If it is 1, the multiplicand is added to the current product through an adder as a contribution to the product. If it is not 1, the product remains unchanged. When performing addition operations through an adder, the bit width of the input end of the adder depends on the bit width of the last level of addition in the accumulation, which is usually the sum of the bit width of the multiplicand and the bit width of the multiplier minus one. Taking a 3bit*3bit multiplier as an example, based on the input maximum value 3'd7(3'b111)*3'd7(3'b111), it is: 5'b10101(3'b111+3'b1110)+5'b11100. As shown in the formula, the bit width of the input end of the adder is a minimum of 5 bits. When calculating data with a larger bit width, the adder circuit resources are relatively large, resulting in a larger circuit resource occupation.

[0032] The serial multiplier provided in the embodiment of the present application includes an adder, a bit width splicing module and a first register. The first input end of the bit width splicing module is connected to the output end of the adder, the second input end of the bit width splicing module is connected to the output end of the first register, and the output end of the bit width splicing module is connected to the input end of the first register. The above-mentioned adder is used to perform addition operation on the input multiplicand accumulation data and M bits in the product accumulation storage data signal to obtain and output the product accumulation data signal. The bit width of the above-mentioned M bits is the same as the bit width of the multiplicand accumulation data signal. The above-mentioned bit width splicing module is used to perform bit width splicing on the product accumulation data signal and N bits of the first product output signal output by the first register to generate a second product output signal, and output the second product output signal to the first register. The bit width of the first product output signal is L, and N is equal to L minus M. In this way, the M bits in the product-accumulation storage data signal and the multiplicand accumulation data signal are added by an adder, and then the obtained product-accumulation data signal and the L minus M bits of the first product output signal output by the first register are bit-width spliced ​​to obtain a second product output signal. Since the adder only needs to add the M bits in the product-accumulation storage data signal that have the same bit width as the multiplicand accumulation data signal, the bit width of the input end of the adder can be the bit width M of the multiplicand, thereby reducing the circuit resources occupied by the adder and reducing the system power consumption.

[0033] Figure 1 A circuit diagram showing the circuit working principle and structure overview of the serial multiplier provided in the embodiment of the present application, such as Figure 1 As shown, the serial multiplier includes an adder 11, a bit width splicing module 12 and a first register 13, the first input end of the bit width splicing module 12 is connected to the output end of the adder 11, the second input end of the bit width splicing module 12 is connected to the output end of the first register 13, and the output end of the bit width splicing module 12 is connected to the input end of the first register 13.

[0034] In some embodiments of the present application, the above-mentioned adder 11 is used to perform addition operation on the M bits in the input multiplicand accumulation data signal and the product accumulation storage data signal to obtain and output the product accumulation data signal, and the bit width of the above-mentioned M bits is the same as the bit width of the multiplicand accumulation data signal.

[0035] In some embodiments of the present application, the above-mentioned M bits are high M bits. For example, taking the multiplication-accumulation-storage data signal as 1110 and M equal to 3 as an example, the M bits of the multiplication-accumulation-storage data signal are the high three bits 111.

[0036] It should be noted that M bits refer to M bits.

[0037] It can be understood that, for a binary data, the rightmost bit of the binary data is the least significant bit, the leftmost bit is the most significant bit, the bit index of the least significant bit is 0, and the bit indexes increase from low to high.

[0038] For example, taking M as 3, assuming that the multiplicand accumulation data signal represents the binary data "111", the product accumulation storage data signal represents the data "0011", and the upper three bits of the product accumulation storage data signal are "001", then "111" and "001" are added to obtain "1000", and the output product accumulation data signal represents the binary data "1000".

[0039] It can be understood that the multiplication-accumulation data signal is obtained by calculation of an adder, wherein one addend is the multiplicand accumulation data signal and the other addend is the high ADW bit of the multiplication-accumulation storage data signal.

[0040] In some embodiments of the present application, the multiplicand accumulated data signal indicates an addend that needs to be accumulated during the multiplication of the multiplicand and the multiplier, that is, data obtained by multiplying the current bit of the multiplier by the multiplicand. For example, assuming that the multiplicand is a binary number "111" and the multiplier is a binary number "101", it is currently necessary to multiply the lowest bit of the multiplier, that is, "1", by each bit of "111", and the product obtained is "111", that is, an addend that needs to be accumulated.

[0041] It should be noted that the current bit of the multiplier refers to the bit that currently needs to be multiplied with the multiplicand. When multiplying two data, it starts from the lowest bit of the multiplier, first multiplying the lowest bit of the multiplier with the multiplicand to obtain the product data, then multiplying the second lowest bit of the multiplier with the multiplicand to obtain the product data and shifting the product data to the left and adding it to the product data obtained last time to obtain an accumulation result, then adding the result of this accumulation to the product data obtained by the next calculation to obtain the result of the second accumulation, and repeating the above process until all the bits of the multiplier are traversed to obtain the final accumulation result, that is, the product of the two data.

[0042] In some embodiments of the present application, the multiplicand is transmitted via a multiplicand data input signal, and the multiplier is transmitted via a multiplier data input signal. In some embodiments, the multiplicand data input signal may be represented as mul_a_in, the multiplier data input signal may be represented as mul_b_in, the multiplicand data input signal has a bit width of ADW, and the multiplier data input signal has a bit width of BDW.

[0043] In some embodiments of the present application, when the bit of the currently processed multiplier is 1, the multiplicand accumulated data signal is equal to the multiplicand input signal, and when the bit of the currently processed multiplier is 0, the multiplicand accumulated data signal is equal to 0.

[0044] In some embodiments of the present application, the bit width of the multiplicand accumulated data signal is the same as the data bit width of the multiplicand, and the bit width of the multiplicand accumulated data signal is expressed as ADW.

[0045] It should be noted that the multiplicand accumulation data signal can be expressed as mul_a_use.

[0046] It is understood that the bit width of a signal (or data bit width, data width) refers to the number of binary bits used to represent a single data value or data sample in a signal. For example, the binary data 1000 is a 4-bit number. Therefore, the bit width of the signal that transmits this binary data 1000 is 4.

[0047] The bit width can be a positive integer from 1 to an arbitrarily large number, and it determines the precision of the data and the number of different states that can be represented. For example, a 1-bit wide signal can represent two states (usually corresponding to 0 and 1), while an 8-bit wide signal can represent 256 different states (from 00000000 to 111111111).

[0048] In some embodiments of the present application, the above-mentioned product accumulation storage data signal represents data obtained by accumulating an addend to be accumulated and another addend.

[0049] It can be understood that the above addend is the product of the current digit of the multiplier and each digit of the multiplicand.

[0050] In some embodiments of the present application, the input bit width of the input end of the adder 11 is the same as the bit width of the multiplicand accumulation data signal input to the input end of the adder 11 .

[0051] In some embodiments of the present application, the above-mentioned bit width splicing module 12 is used to perform bit width splicing on the product accumulation data signal and the N bits of the first product output signal output by the first register 13 to generate a second product output signal, and output the second product output signal to the first register 13. The bit width of the first product output signal is L, and N is equal to L minus M.

[0052] In some embodiments of the present application, the first register is used to store the low-order product bits that have been calculated and output the product calculation result.

[0053] In some embodiments of the present application, the initial value of the first product output signal is 0.

[0054] In some embodiments of the present application, the N bits may be the first to BDW-1 bits of the first product output signal. Exemplarily, the first product output signal is represented as mul_c_out, and the N bits of the first product output signal may be represented as mul_c_out[BDW-1:1].

[0055] In some embodiments of the present application, the bit width of the first product output signal is ADW+BDW, wherein ADW is the bit width of the multiplicand, and BDW is the bit width of the multiplier.

[0056] For example, taking the product accumulation data signal representing the binary data "1000", the first product output signal representing the binary data "001110", and BDW equal to 3, the N-bit position of the first product output signal is "11", then "1000" and "11" are bit-width spliced ​​to obtain "100011".

[0057] It should be noted that concatenating two data of different bit widths means concatenating one number after another number. For example, concatenating 0111 and 11 means concatenating 11 to the right of 0111 to obtain the concatenated data 011111.

[0058] The serial multiplier provided in the embodiment of the present application performs an addition operation on the M bits in the product accumulation storage data signal and the multiplicand accumulation data signal through an adder, and then performs bit width splicing of the obtained product accumulation data signal and the L minus M bits of the first product output signal output by the first register to obtain a second product output signal. Since the adder only needs to perform an addition operation on the M bits in the product accumulation storage data signal that have the same bit width as the multiplicand accumulation data signal, the bit width of the input end of the adder can be the bit width M of the multiplicand, thereby reducing repeated calculations of low bits, reducing the overhead of adder circuit resources, and thus reducing system power consumption.

[0059] In some embodiments of the present application, the second product output signal carries the first product data.

[0060] Exemplarily, the first register 13 is further used to receive the second product output signal, store the first data product carried in the second product output signal, and transmit the second product output signal to the bit width splicing module 12 .

[0061] In some embodiments of the present application, the first product data is data obtained by splicing the data in the product-added data signal and the data in the first product output signal by N bits.

[0062] In some embodiments of the present application, the bit width splicing module 12 receives the second product output signal, and performs bit width splicing on the N bits of the second product output signal and the product accumulation data signal output by the adder to obtain and output the third product output signal, and then inputs the third product output signal to the first register 13, and the above process is executed in a loop until the entire accumulation process is completed, and the final target product output signal is output, which represents the product data obtained after multiplying the multiplicand and the multiplier.

[0063] In some embodiments of the present application, Figure 2 As shown, the serial multiplier may further include: a second register 14 , the input end of the second register 14 is connected to the output end of the adder 11 , and the output end of the second register 14 is connected to the input end of the adder 11 .

[0064] In some embodiments of the present application, the second register 14 is used to receive a multiplication-addition data signal, store the multiplication-addition data carried in the multiplication-addition data signal, and output a multiplication-addition storage data signal to the adder 11 based on the multiplication-addition data signal.

[0065] In some embodiments of the present application, the above-mentioned product-accumulate storage data signal can be expressed as sum_tmp_d1, with a bit width of ADW+1, which is used to store the product-accumulate data signal for one clock and is used for accumulation of the next clock.

[0066] In some embodiments of the present application, the above-mentioned second register 14 is also used to reset the multiplication-accumulation-storage data signal output by the second register 14 to 0 when the received reset signal is effective; or, the second register 14 is specifically used to output the multiplication-accumulation-storage data signal to the above-mentioned adder 11 based on the above-mentioned multiplication-accumulation-storage data signal when the received first identification signal is effective.

[0067] The first identification signal is used to indicate whether the current process is in the calculation process.

[0068] In some embodiments of the present application, the reset signal may be a hardware or software reset signal, and the first identification signal may be a calculation process identification signal, which is expressed as cal_phs.

[0069] In some embodiments of the present application, the bit width of the calculation process identification signal is 1, which is used to identify whether it is currently in the calculation process.

[0070] In some embodiments of the present application, Figure 3As shown, the above-mentioned serial multiplier also includes: a logic gate 15 and a selector 16; the first input end of the logic gate is connected to the multiplier data input signal, the second input end of the logic gate is connected to the calculation order control signal, the output end of the logic gate is connected to the first input end of the selector, the second input end of the selector is connected to the multiplicand data input signal, and the output end of the selector is connected to the input end of the adder.

[0071] In some embodiments of the present application, the above-mentioned logic gate 15 is used to perform an AND operation on the input multiplier data input signal and the calculation order control signal, and output a judgment signal.

[0072] In some embodiments of the present application, the above-mentioned selector 16 is used to output a multiplicand accumulated data signal to the adder 11 based on the input multiplicand data input signal when the judgment signal is a high level, or, when the judgment signal is a low level, set the multiplicand accumulated data signal input to the adder to 0.

[0073] In some embodiments of the present application, the above logic gate may be an AND gate.

[0074] In some embodiments of the present application, the bit width of the calculation order control signal is BDW, which is used to control the bit position of the multiplier at which the current accumulation progress is located.

[0075] In some embodiments of the present application, the above calculation order control signal can be expressed as mul_b_hit.

[0076] It should be noted that the description of the multiplier data input signal can refer to the relevant description of the above embodiment, which will not be repeated here.

[0077] Exemplarily, the multiplier data input signal and the current calculation order control signal are bitwise ANDed and then bitwise ORed to form a MUX judgment signal. When the judgment signal is 1, the multiplicand accumulated data signal is equal to the multiplicand input signal. When the judgment signal is 0, the multiplicand accumulated data signal is equal to 0.

[0078] In some embodiments of the present application, Figure 4 As shown, the serial multiplier further includes a shifter 17 , an input end of the shifter 17 is connected to a multiplier data input signal, and an output end of the shifter 17 is connected to an input end of the logic gate 15 .

[0079] In some embodiments of the present application, the shifter 17 is used to shift the calculation order control signal to the left, and input the shifted calculation order control signal to the logic gate.

[0080] In some embodiments of the present application, the above-mentioned shifter 17 is specifically used to reset the calculation order control signal to 1 when the reset signal is effective, or, when the calculation start signal is effective, shift the calculation order control signal one bit to the left until it moves to the highest bit, that is, BDW-1 bit.

[0081] Exemplarily, when the hardware or software reset signal is effective, the calculation order control signal is reset to 1; when the calculation start signal is effective, the calculation order control signal is shifted to the left by one bit until it moves to the highest bit BDW-1. For example, the calculation order control signal is initially 000, and when the hardware or software reset signal is effective, the calculation order control signal is reset to 001, shifted to the left by one bit to 010, and further shifted to the left by one bit to 100, at which time it moves to the highest bit.

[0082] In the related art, when performing multiplication operation through a serial multiplier, it is necessary to rely on a counter to control the traversal of the multiplier bit number, and realize the multiplication operation by bit-by-bit judgment and accumulation. In the process of controlling the traversal of the multiplier bit number through a counter, it is necessary to add 1 to the value of the counter after processing a multiplier bit, that is, to increase the value of the counter. Therefore, the existing method of controlling the calculation order through a counter requires an addition operation, which leads to a large circuit resource overhead.

[0083] In an embodiment of the present application, the counter in the traditional serial multiplier is replaced by a shifter, that is, the shift operation is used instead of the accumulation operation. Since the shift operation only needs to flip 2 bits at the same time each time the register is changed, the amount of calculation when traversing the multiplier bits during the multiplication operation is reduced compared to the counter method, thereby reducing power consumption.

[0084] The following is an explanation of the input and output ports and parameters of the serial multiplier provided in the embodiment of the present application.

[0085] Table 1 shows the parameters and descriptions of the serial multiplier provided in the embodiment of the present application.

[0086] Parameter name describe ADW Multiplicand data bit width BDW Multiplier data width

[0087] Table 1

[0088] Table 2 is an explanation of the input and output ports of the serial multiplier provided in the embodiment of the present application.

[0089] Port Name Port Width Input / Output describe clk 1 enter Clock signal rst_n 1 enter Hardware reset signal soft_rst 1 enter Software reset signal mul_start_in 1 enter Calculation start signal mul_a_in ADW enter Multiplicand data input mul_b_in BDW enter Multiplier data input mul_done_out 1 Output Calculation end signal mul_c_out ADW+BDW Output Product output

[0090] Table 2

[0091] For example, in combination with the above embodiment and Table 2, Figure 5 A timing diagram of control signals provided in an embodiment of the present application is shown in FIG. Figure 5As shown, taking a 3bit*3bit multiplier as an example, the calculation order control signal is a register with a bit width of BDW, which is used to control the bit position of the multiplier at which the current accumulation progress is. When the hardware / software reset signal takes effect, the calculation order control signal is reset to 1; when the calculation start signal takes effect, the calculation order control signal moves one bit to the left until it moves to the highest bit BDW-1 bit; the calculation process identification signal is a register with a bit width of 1, which is used to identify whether it is currently in the calculation process. When the hardware or software reset signal takes effect, the calculation process identification signal is reset to 0; when the calculation start signal takes effect, the calculation process identification signal is pulled up to 1; when the highest bit of the calculation order control signal is 1, the calculation process identification signal is reduced to 0.

[0092] In the embodiment of the present application, by controlling the calculation process through the above-mentioned control signal, the counter addition circuit resources in the traditional serial multiplier can be optimized, and its shift operation only needs to flip 2 bits at the same time each time the register is changed, which reduces power consumption compared to the counter method.

[0093] Figure 6 A flow chart of a data processing method based on a serial multiplier provided in an embodiment of the present application is provided below in combination with Figure 6 The serial multiplier provided in the embodiments of the present application and the data processing process based on the serial multiplier are exemplarily described through specific examples.

[0094] For example, taking the multiplicand as 111 and the multiplier as 101, Figure 6 As shown, the electronic device determines whether the highest bit of mul-b-hit is 1, that is, whether the highest bit of the multiplier has been traversed, that is, whether the calculation has been completed; if so, the calculation result is output, and mul-c-out is equal to the concatenation of sum-tmp and mul-c-out[BDW-1:1]. If not, that is, the calculation has not been completed, it continues to determine whether the current accumulation bit needs to be accumulated. If accumulation is required, the multiplicand is accumulated, otherwise it is not accumulated. During the accumulation, the previously saved accumulation result only needs to use the high ADW bit. After the accumulation is completed, the accumulation result is stored; after the accumulation result is stored, the low bit of the accumulation result is stored in the product output result. The entire calculation process is repeated until all bits of the multiplier are traversed.

[0095] Specifically, in the first loop process: mul_b_hit is 001, mul_b_hit and mul_b_in are ANDed to determine whether the current bit of the multiplier is 0 or 1. If the current bit of the multiplier is 1, mul_a_use (i.e., the value obtained by multiplying the current bit of the multiplier by each bit of the multiplicand) is assigned the multiplicand (i.e., 0111). If the current bit of the multiplier is 0, mul_a_use is assigned 0, the sum of sum_tmp is calculated, and sum_tmp_d1 (the multiplication accumulation storage data signal) is assigned the calculated sum_tmp (0111). Next, mul_b_hit is shifted left by one bit, and the shifted mul_b_hit is 010. mul_c_out is calculated to be equal to the sum_tmp obtained by this calculation (i.e., 0111) and the first and second bits of the initial mul_c_out (i.e., 00) (the first time mul_c_out is in a reset state, so the first and second bits are both 0). That is, the output result of the first loop is: mul_c_out=0111+00=011100.

[0096] It should be noted that sum_tmp represents the sum of the products of two calculations, that is, sum_tmp is the sum of mul_a_use (that is, 111) and sum_tmp_d1[ADW:1] (that is, 000). Since sum_tmp_d1 is the initial value (that is, 000000) in the first loop, sum_tmp_d1[ADW:1] is 000, so sum_tmp is the sum of 111 and 000, and since the bit width of sum_tmp is ADW+1, that is, the bit width of the multiplicand is added by one, therefore, the high bit of the result of adding 111 and 000 is filled with 0, and sum_tmp is 0111.

[0097] During the second loop: mul_b_hit is 010. The current bit of the multiplier is 0, mul_a_use is assigned 0, sum_tmp is calculated to be equal to the sum of mul_a_use(0) and sum_tmp_d1[ADW:1] (i.e. the upper three bits of the previous sum_tmp 011), that is, sum_tmp is equal to 0011, sum_tmp_d1 is assigned sum_tmp (i.e. 0011), mul_b_hit is shifted left by one bit (i.e. 100), and mul_c_out is calculated to be equal to the calculated sum_tmp (i.e. 0011) and the first and second bits (i.e. 10) of the previous mul_c_out (i.e. 011100). That is, the output result of the second loop is: mul_c_out = 0011 + 10 = 001110.

[0098] In the third loop: mul_b_hit = 100. The current bit of the multiplier is 1, mul_a_use is assigned the multiplicand (i.e. 111), sum_tmp is calculated to be equal to the sum of mul_a_use (i.e. 0111) and sum_tmp_d1[ADW:1] (i.e. the upper three bits of the previous sum_tmp 0001), that is, sum_tmp is equal to 1000, sum_tmp_d1 is assigned sum_tmp, i.e. 1000, mul_b_hit is shifted left by one bit (i.e. 000), and mul_c_out is calculated to be equal to the calculated sum_tmp (i.e. 1000) and the first and second bits (i.e. 11) of the previous mul_c_out (i.e. 001110). The output result of the third loop is: mul_c_out = 1000+11 = 100011.

[0099] In the embodiment of the present application, by optimizing the internal circuit structure of the serial multiplier and the data processing method based on the serial multiplier, the bit width of the port of the adder inside the serial multiplier is reduced. When calculating the product of 3-bit and 3-bit data, the bit width of the adder port is reduced from 5bit+5bit to 3bit+3bit, reducing repeated calculations for low bits, thereby reducing the cost of adder circuit resources. At the same time, by optimizing the control circuit method, the calculation sequence is controlled by the counter method to the calculation sequence controlled by the shift method, reducing one counter addition circuit resource, thereby further reducing the cost of adder circuit resources.

[0100] Table 3 shows the scale and area of ​​the serial multiplier provided in the embodiment of the present application and the traditional serial multiplier, as well as the optimized area, optimized number of logic gates and optimized percentage of the serial multiplier provided in the embodiment of the present application compared with the traditional serial multiplier.

[0101] It can be understood that optimizing the number of logic gates refers to the number of logic gates reduced in the serial multiplier provided by the embodiment of the application compared to the traditional serial multiplier.

[0102]

[0103] Table 3

[0104] As shown in Table 3, for a serial multiplier of 4*4 size, the area of ​​a traditional serial multiplier is 17.83 μm2, and the area of ​​the optimized serial multiplier provided in the embodiment of the present application is 10.14 μm2, which is 7.69 μm2 less than the area of ​​a traditional serial multiplier, the number of optimized logic gates is 188, and the optimization percentage is 43%.

[0105] It should be noted that the serial multiplier scale refers to the number of bits of data operations that the serial multiplier is designed to support. For example, when budgeting 3bit*3bit data, the minimum scale of a conventional serial multiplier is 5bit*5bit, and the scale of the serial multiplier provided in the embodiment of the present application is 3bit*3bit or 4bit*4bit.

[0106] According to Table 3, the optimized area increases linearly with the increase of the serial multiplier scale. The larger the serial multiplier scale, the more significant the optimization effect.

[0107] The serial multiplier provided in the embodiment of the present application is applicable to multiplication between two data of arbitrary bit widths. If the area requirement is high, since the adder size depends on the bit width of the multiplicand, the multiplicand can be data with a relatively small bit width. If the calculation time requirement is high, since the calculation time period depends on the bit width of the multiplier, the multiplier can be data with a relatively small bit width, thereby meeting different application scenarios.

[0108] An embodiment of the present application provides a data processing method based on a serial multiplier, which is applied to the serial multiplier described in the above embodiment.

[0109] The data processing method based on a serial multiplier provided in the embodiment of the present application can be executed by an electronic device, or at least one of a functional module and an entity module in the electronic device that can implement the data processing method based on a serial multiplier. The specific method can be determined according to actual use requirements, and the embodiment of the present application does not limit this. The following takes an electronic device executing a data processing method based on a serial multiplier as an example to illustrate the data processing method based on a serial multiplier provided in the embodiment of the present application.

[0110] The data processing method based on the serial multiplier provided in the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0111] The data processing method based on a serial multiplier provided in the embodiment of the present application can be applied to scenarios such as image processing scenarios where a multiplication operation needs to be performed using a traveling multiplier.

[0112] Figure 7 A flow chart of a data processing method based on a serial multiplier provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the data processing method based on the serial multiplier includes the following steps 201 to 203:

[0113] Step 201: The electronic device obtains a multiplicand accumulation data signal and a product accumulation storage data signal.

[0114] Step 202: The electronic device performs an addition operation on the multiplicand accumulation data signal and the M bits of the product accumulation storage data signal to obtain and output the product accumulation data signal.

[0115] The bit width of the M bits is the same as the bit width of the multiplicand accumulation data signal.

[0116] Step 203: The electronic device performs bit-width splicing on the product-added data signal and the N bits of the first product output signal to generate and output a second product output signal.

[0117] The bit width of the first product output signal is L, and N is equal to L minus M.

[0118] The data processing method based on the serial multiplier provided in the embodiment of the present application is that the electronic device obtains the multiplicand accumulation data signal and the product accumulation storage data signal, performs bit width splicing on the M bits of the multiplicand accumulation data signal and the product accumulation storage data signal, generates and outputs a second product output signal, the bit width of the above-mentioned first product output signal is L, N is equal to L minus M, through this method, the electronic device can perform addition operation on the M bits in the product accumulation storage data signal and the multiplicand accumulation data signal, and then perform bit width splicing on the obtained product accumulation data signal and L minus M bits of the first product output signal to obtain the second product output signal. Since only the M bits in the product accumulation storage data signal with the same bit width as the multiplicand accumulation data signal need to be added, the circuit resource overhead when performing the addition operation is reduced, thereby reducing the system power consumption.

[0119] In some embodiments of the present application, the second product output signal carries the first product data; illustratively, the data processing method based on the serial multiplier provided in the embodiment of the present application may further include the following steps 204:

[0120] Step 204: The electronic device stores the first product data carried in the second product output signal.

[0121] It should be noted that step 204 can be performed after step 203 above.

[0122] In some embodiments of the present application, before the above step 201, the data processing method based on the serial multiplier provided in the embodiment of the present application may further include the following steps 205 to 207:

[0123] Step 205: The electronic device obtains a multiplier data input signal and a calculation sequence control signal.

[0124] Step 206: The electronic device performs an AND operation on the multiplier data input signal and the calculation sequence control signal, and outputs a judgment signal.

[0125] Step 207: When the above judgment signal is at a high level, the electronic device obtains a multiplicand accumulated data signal based on the multiplicand data input signal, or, when the judgment signal is at a low level, sets the multiplicand accumulated data signal input to the adder to 0.

[0126] In some embodiments of the present application, before the above step 201 and after the above step 206, the data processing method based on the serial multiplier provided in the embodiment of the present application may further include the following step 208:

[0127] Step 208: The electronic device shifts the calculation order control signal to the left.

[0128] It should be noted that step 208 can be performed after step 207 above.

[0129] In some embodiments of the present application, the above step 208 can be specifically implemented through step 208a.

[0130] Step 208a: When the calculation start signal takes effect, the electronic device shifts the calculation sequence control signal one bit to the left until it moves to the highest bit.

[0131] It should be noted that, for the explanation of the embodiment of the method, please refer to the relevant description of the above embodiment, which will not be repeated here.

[0132] The above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0133] The data processing method provided in the embodiment of the present application can be executed by a data processing device based on a serial multiplier. In the embodiment of the present application, the data processing device provided in the embodiment of the present application is described by taking the data processing method executed by a data processing device based on a serial multiplier as an example.

[0134] Figure 8 A schematic diagram of the structure of a data processing device based on a serial multiplier provided in an embodiment of the present application is shown in FIG. Figure 8As shown, the data processing device 800 based on the serial multiplier may include an acquisition module 801 and a processing module 802, wherein the acquisition module 801 is used to acquire the multiplicand accumulation data signal and the product accumulation storage data signal; the processing module 802 is used to perform addition operation on the M bits of the multiplicand accumulation data signal and the product accumulation storage data signal to obtain and output the product accumulation data signal, and the bit width of the M bits is the same as the bit width of the multiplicand accumulation data signal; the processing module 802 is also used to perform bit width splicing on the product accumulation data signal and the N bits of the first product output signal to generate and output the second product output signal, and the bit width of the first product output signal is L, and N is equal to L minus M.

[0135] In some embodiments of the present application, the second product output signal carries first product data; the serial multiplier-based data processing device 800 may further include a storage module 803, which is used to store the first product data carried in the second product output signal.

[0136] In some embodiments of the present application, the above-mentioned acquisition module 801 is also used to obtain a multiplier data input signal and a calculation order control signal before obtaining the multiplicand accumulation data signal and the product accumulation storage data signal; perform an AND operation on the multiplier data input signal and the calculation order control signal, and output a judgment signal; when the judgment signal is at a high level, obtain the multiplicand accumulation data signal based on the multiplicand data input signal, or, when the judgment signal is at a low level, set the multiplicand accumulation data signal input to the adder to 0.

[0137] In some embodiments of the present application, the processing module 802 is further used to perform an AND operation on the multiplier data input signal and the calculation order control signal, output a judgment signal, and shift the calculation order control signal to the left.

[0138] In some embodiments of the present application, the processing module 802 is specifically configured to shift the calculation sequence control signal to the left by one bit until it reaches the highest bit when the calculation start signal takes effect.

[0139] The data processing device based on a serial multiplier provided in an embodiment of the present application obtains a multiplicand accumulation data signal and a product accumulation storage data signal, performs bit width splicing on the M bits of the multiplicand accumulation data signal and the product accumulation storage data signal, generates and outputs a second product output signal, the bit width of the above-mentioned first product output signal is L, N is equal to L minus M, through this method, the data processing device based on the serial multiplier can perform addition operation on the M bits in the product accumulation storage data signal and the multiplicand accumulation data signal, and then perform bit width splicing on the obtained product accumulation data signal and L minus M bits of the first product output signal to obtain the second product output signal, because only the M bits in the product accumulation storage data signal with the same bit width as the multiplicand accumulation data signal need to be added, therefore, the circuit resource overhead when performing the addition operation is reduced, thereby reducing the system power consumption.

[0140] The data processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0141] The data processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0142] The data processing device based on the serial multiplier provided in the embodiment of the present application can realize Figure 7 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0143] Alternatively, if Fig. 9 As shown, an embodiment of the present application further provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores a program or instruction that can be executed on the processor 901, and when the program or instruction is executed by the processor 901, each step of the above-mentioned data processing method embodiment based on the serial multiplier is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0144] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0145] Fig.10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0146] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0147] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.10 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0148] Among them, the processor 110 is used to obtain the multiplicand accumulation data signal and the product accumulation storage data signal; the processor 110 is used to perform addition operation on the M bits of the multiplicand accumulation data signal and the product accumulation storage data signal to obtain and output the product accumulation data signal, and the bit width of the M bits is the same as the bit width of the multiplicand accumulation data signal; the processor 110 is also used to perform bit width splicing on the product accumulation data signal and the N bits of the first product output signal to generate and output the second product output signal, and the bit width of the first product output signal is L, and N is equal to L minus M.

[0149] In some embodiments of the present application, the second product output signal carries first product data; the serial multiplier-based data processing device 800 may further include a memory 109, the memory 109 being used to store the first product data carried in the second product output signal.

[0150] In some embodiments of the present application, the above-mentioned processor 110 is also used to obtain a multiplier data input signal and a calculation order control signal before obtaining a multiplicand accumulation data signal and a product accumulation storage data signal; perform an AND operation on the multiplier data input signal and the calculation order control signal, and output a judgment signal; when the judgment signal is at a high level, obtain the multiplicand accumulation data signal based on the multiplicand data input signal, or, when the judgment signal is at a low level, set the multiplicand accumulation data signal input to the adder to 0.

[0151] In some embodiments of the present application, the processor 110 is further configured to perform an AND operation on the multiplier data input signal and the calculation order control signal, output a determination signal, and shift the calculation order control signal to the left.

[0152] In some embodiments of the present application, the processor 110 is specifically configured to shift the calculation sequence control signal to the left by one bit until it reaches the highest bit when the calculation start signal takes effect.

[0153] The electronic device provided in the embodiment of the present application obtains a multiplicand accumulation data signal and a product accumulation storage data signal, performs bit width splicing on the M bits of the multiplicand accumulation data signal and the product accumulation storage data signal, generates and outputs a second product output signal, the bit width of the above-mentioned first product output signal is L, N is equal to L minus M, through this method, the electronic device can perform addition operation on the M bits in the product accumulation storage data signal and the multiplicand accumulation data signal, and then perform bit width splicing on the obtained product accumulation data signal and L minus M bits of the first product output signal to obtain the second product output signal, because only the M bits in the product accumulation storage data signal with the same bit width as the multiplicand accumulation data signal need to be added, so the circuit resource overhead when performing the addition operation is reduced, thereby reducing the system power consumption.

[0154] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0155] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0156] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.

[0157] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned data processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0158] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0159] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned data processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0160] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0161] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned data processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0162] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0163] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0164] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A serial multiplier, characterized in that: The serial multiplier comprises: an adder, a bit width splicing module and a first register; The first input terminal of the bit width splicing module is connected to the output terminal of the adder; The second input end of the bit width splicing module is connected to the output end of the first register; The output end of the bit width splicing module is connected to the input end of the first register; The adder is used to perform addition operation on the input multiplicand accumulation data signal and the M bits in the product accumulation storage data signal to obtain and output the product accumulation data signal, wherein the bit width of the M bits is the same as the bit width of the multiplicand accumulation data signal; The bit width splicing module is used to perform bit width splicing on the product accumulation data signal and the N bits of the first product output signal output by the first register to generate a second product output signal, and output the second product output signal to the first register, the bit width of the first product output signal is L, and N is equal to L minus M.

2. The serial multiplier according to claim 1, characterized in that: The input bit width of the input terminal of the adder is the same as the bit width of the multiplicand accumulation data signal input into the input terminal of the adder.

3. The serial multiplier according to claim 1, characterized in that: The second product output signal carries the first product data; The first register is further used to receive the second product output signal, store the first data product carried in the second product output signal, and transmit the second product output signal to the bit width splicing module.

4. The serial multiplier according to claim 1, characterized in that: The serial multiplier further comprises: a second register, an input end of the second register is connected to an output end of the adder, and an output end of the second register is connected to an input end of the adder; The second register is used to receive the multiplication-accumulation data signal, store the multiplication-accumulation data carried in the multiplication-accumulation data signal, and output a multiplication-accumulation storage data signal to the adder based on the multiplication-accumulation data signal.

5. The serial multiplier according to claim 4, characterized in that: The second register is further used to reset the product-accumulation storage data signal output by the second register to 0 when the received reset signal takes effect; or, The second register is specifically used to output a multiplication-accumulation storage data signal to the adder based on the multiplication-accumulation data signal when the received first identification signal is effective, and the first identification signal is used to indicate whether it is currently in a calculation process.

6. The serial multiplier according to claim 1, characterized in that: The serial multiplier also includes: a logic gate and a selector; The first input terminal of the logic gate is connected to the multiplier data input signal; The second input terminal of the logic gate is connected to the calculation sequence control signal; The output terminal of the logic gate is connected to the first input terminal of the selector; The second input terminal of the selector is connected to the multiplicand data input signal, and the output terminal of the selector is connected to the input terminal of the adder; The logic gate is used to perform an AND operation on the input multiplier data input signal and the calculation order control signal, and output a judgment signal; The selector is used to output the multiplicand accumulated data signal to the adder based on the input multiplicand data input signal when the judgment signal is at a high level, or to set the multiplicand accumulated data signal input to the adder to 0 when the judgment signal is at a low level.

7. The serial multiplier according to claim 6, characterized in that: The serial multiplier further comprises a shifter, an input end of the shifter is connected to the multiplier data input signal, and an output end of the shifter is connected to an input end of the logic gate; The shifter is used to shift the calculation order control signal to the left, and input the shifted calculation order control signal to the logic gate.

8. The serial multiplier according to claim 7, characterized in that: The shifter is specifically used to reset the calculation order control signal to 1 when the reset signal is effective, or, when the calculation start signal is effective, shift the calculation order control signal to the left by one bit until it moves to the highest bit.

9. A data processing method based on a serial multiplier, characterized in that: The method comprises: Acquire a multiplicand accumulation data signal and a product accumulation storage data signal; Performing an addition operation on the multiplicand accumulation data signal and the M bits of the product accumulation storage data signal to obtain and output a product accumulation data signal, wherein the bit width of the M bits is the same as the bit width of the multiplicand accumulation data signal; The product-added data signal and N bits of the first product output signal are bit-width spliced ​​to generate and output a second product output signal, where the bit width of the first product output signal is L, and N is equal to L minus M.

10. The method according to claim 9, characterized in that The second product output signal carries the first product data; The method further comprises: The first product data carried in the second product output signal is stored.

11. The method according to claim 9, characterized in that Before acquiring the multiplicand accumulation data signal and the product accumulation storage data signal, the method further includes: obtaining a multiplier data input signal and a calculation sequence control signal; Performing an AND operation on the multiplier data input signal and the calculation order control signal, and outputting a judgment signal; When the judgment signal is at a high level, the multiplicand accumulated data signal is obtained based on the multiplicand data input signal, or, when the judgment signal is at a low level, the multiplicand accumulated data signal input to the adder is set to 0.

12. The method according to claim 11, characterized in that After performing an AND operation on the multiplier data input signal and the calculation order control signal and outputting a judgment signal, the method further includes: The calculation order control signal is shifted leftward.

13. The method according to claim 12, characterized in that The step of shifting the calculation order control signal to the left comprises: When the calculation start signal takes effect, the calculation sequence control signal is shifted to the left by one bit until it reaches the highest bit.

14. A data processing device based on a serial multiplier, characterized in that: The device comprises: an acquisition module and a processing module; The acquisition module is used to acquire the multiplicand accumulation data signal and the product accumulation storage data signal; The processing module is used to perform an addition operation on the multiplicand accumulation data signal and the M bits of the product accumulation storage data signal to obtain and output the product accumulation data signal, wherein the bit width of the M bits is the same as the bit width of the multiplicand accumulation data signal; The processing module is also used to perform bit width splicing on the product accumulation data signal and N bits of the first product output signal to generate and output a second product output signal, where the bit width of the first product output signal is L, and N is equal to L minus M.

15. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the data processing method based on a serial multiplier as described in any one of claims 9 to 13 are implemented.

16. A computer-readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the data processing method based on the serial multiplier as claimed in any one of claims 9 to 13 are implemented.

17. A chip, characterized in that: The chip includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or an instruction to implement the data processing method based on a serial multiplier as described in any one of claims 9 to 13.