Integrated circuits for constant multiplication, methods for operating them, and apparatus including them.
By using lookup tables and processing circuits in integrated circuits to generate partial products and then summing them, the cost and complexity issues of large-digit multiplication operations are solved, improving the computational efficiency and scalability of machine learning models.
Patent Information
- Application Number
- CN202110924369.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-12-02
- Filing Date
- 2021-08-12
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2041-08-12
AI Technical Summary
Existing technologies suffer from increased cost and complexity when handling large-digit multiplication, especially in machine learning models. In particular, the efficiency and performance of multiplication operations become difficult to meet the requirements when the feature map size of neural networks increases.
By combining a lookup table memory and processing circuitry, a seed is obtained from the lookup table and a partial product is generated by generating an address corresponding to the input part. The summation is then performed using an adder, reducing the number of seeds to be stored and thus improving efficiency.
It achieves efficient and low-cost constant multiplication operations, adapts to performance requirements as input size increases, and improves the computational efficiency and scalability of machine learning models.
Smart Images

Figure CN114579079B_ABST
Abstract
Description
[0001] This application is based on and claims priority to Korean Patent Application No. 10-2020-0166966, filed on December 2, 2020, with the Korean Intellectual Property Office, the entire disclosure of which is incorporated herein by reference. Technical Field
[0002] The inventive concept relates to multiplication, and more specifically, to an integrated circuit for constant multiplication, a method of operating thereon, and an apparatus including thereon. Background Technology
[0003] In devices used for processing digital signals, multiplication for calculating the product of the multiplicand and the multiplier can occur frequently. For example, many multiplicative accumulation (MAC) operations can occur in devices designed to execute machine learning models. For more accurate results, it may be important to process the multiplication with inputs (e.g., multiplicands and / or multipliers) of increased size (e.g., number of bits) at low cost and high speed. Summary of the Invention
[0004] The inventive concept relates to multiplication, and more specifically, to an integrated circuit for constant multiplication that simultaneously possesses high performance and efficiency, and to a device comprising the integrated circuit.
[0005] According to some exemplary embodiments of the inventive concept, an integrated circuit is provided for generating a product of an input and a constant. The integrated circuit includes: a lookup table memory configured to store seeds corresponding to multiples of the constant; and processing circuitry configured to generate multiple addresses corresponding to multiple parts extracted from the input, configured to receive multiple seeds from the lookup table memory based on the multiple addresses, and configured to generate multiple partial products based on the multiple seeds. The processing circuitry is configured to sum the multiple partial products. The number of seeds stored in the lookup table memory is less than the number of possible values for the multiple partial products.
[0006] According to some exemplary embodiments of the inventive concept, an apparatus is provided comprising: a plurality of units configured to generate in parallel products of an input and weights, the weights being included in a feature map. Each of the plurality of units includes: a lookup table memory configured to store seeds corresponding to multiples of the weights; processing circuitry configured to generate addresses corresponding to portions extracted from the input and to generate partial products based on the seeds corresponding to the addresses; and processing circuitry configured to sum the plurality of partial products. The number of seeds stored in the lookup table memory is less than the number of possible values for the partial products.
[0007] According to some exemplary embodiments of the inventive concept, a method for generating a product of an input and a constant is provided. The method includes: extracting multiple parts from the input; generating multiple addresses corresponding to each of the multiple parts; obtaining multiple seeds from a lookup table memory storing seeds corresponding to multiples of the constant, the obtaining step being based on the multiple addresses; generating multiple partial products based on the multiple seeds; and summing the multiple partial products. The number of seeds stored in the lookup table memory is less than the number of possible values for the multiple partial products. Attached Figure Description
[0008] Some exemplary embodiments of the inventive concept will become clearer from the following detailed description taken in conjunction with the accompanying drawings, in which:
[0009] Figure 1 This is a block diagram illustrating an integrated circuit according to some example embodiments;
[0010] Figure 2 This is a block diagram illustrating examples of integrated circuits according to some example embodiments;
[0011] Figure 3 This is a block diagram illustrating an integrated circuit according to some example embodiments, and Figure 4 This illustrates, according to some example embodiments, the inclusion of by Figure 3 A graph of the partial product of the integrated circuits generated;
[0012] Figure 5 This is a block diagram illustrating an integrated circuit according to some example embodiments, and Figure 6 This illustrates, according to some example embodiments, the inclusion of by Figure 5 A graph of the partial product of the integrated circuits generated;
[0013] Figure 7 This is a block diagram illustrating an integrated circuit according to some example embodiments, and Figure 8 This illustrates some example embodiments. Figure 7 A diagram illustrating an example of the operation of an integrated circuit;
[0014] Figure 9 This is a block diagram illustrating an integrated circuit according to some example embodiments;
[0015] Figure 10 This is a flowchart illustrating a method for constant multiplication according to some example embodiments;
[0016] Figure 11 This is a flowchart illustrating a method for constant multiplication according to some example embodiments;
[0017] Figure 12 This is a flowchart illustrating a method for constant multiplication according to some example embodiments;
[0018] Figure 13 This is a flowchart illustrating a method for constant multiplication according to some example embodiments;
[0019] Figure 14 This is a flowchart illustrating a method for constant multiplication according to some example embodiments;
[0020] Figure 15 This is a diagram illustrating an example of the operation of storing a seed in a lookup table according to some example embodiments;
[0021] Figure 16A and Figure 16B This is a block diagram illustrating an example of the operation of storing seeds in a lookup table according to an embodiment; and
[0022] Figure 17 This is a block diagram illustrating a system according to some example embodiments. Detailed Implementation
[0023] Figure 1 This is a block diagram illustrating an integrated circuit 100 according to some example embodiments. More specifically, Figure 1 The block diagram illustrates a portion of an integrated circuit 100 that performs constant multiplication to generate an output OUT by multiplying an input IN by a constant. The input IN and output OUT can be multi-bit signals or corresponding multi-bit signals, and can be signed or unsigned. Here, it is assumed that the input IN, output OUT, and constant are unsigned values, but the example embodiment is not limited to this. Figure 1 As shown, integrated circuit 100 may include logic circuitry 120, at least one adder 140, and a lookup table 160. In some example embodiments, integrated circuit 100 may be fabricated using semiconductor processes, and logic circuitry 120, at least one adder 140, and lookup table 160 may be integrated into a single die / chip, or may be integrated into two or more dies / chips respectively. Logic circuitry 120 and at least one adder 140 may be collectively referred to as processing circuitry.
[0024] For more accurate results, the size (e.g., number of bits) of the input IN can be increased. For example, in a machine learning model used to recognize features from an image, the size of the input image can be increased, and / or the number of quantization levels applied to a mobile system can be increased for higher accuracy. To handle the increased size of the input IN, there can be exponentially increased cost / complexity scaling in the multipliers. For example, when the number of bits of the input IN increases by a factor of 2 from 8 to 16, four 8-bit multipliers may be needed, and / or one multiplier may be needed to perform 8-bit multiplications four times. As described later with reference to the accompanying drawings, the integrated circuit 100 can have a more efficient structure for constant multiplication, thereby providing high-speed and / or low-cost multiplication and / or improved scalability. Alternatively or additionally, the performance and efficiency of operations based on multiple multiplications can be improved due to high-performance and high-efficiency multiplication, such as inference in neural networks and / or computation in proof-of-work-based blockchains. Alternatively or additionally, machine learning-based applications can be widely used in mobile systems because machine learning models (e.g., neural networks) provide improved performance and efficiency. Alternatively or additionally, blockchain-based applications can be used more widely.
[0025] Reference Figure 1 The logic circuit 120 can receive input IN and access lookup table 160. For example, as Figure 1 As shown, logic circuit 120 can provide address ADR to lookup table 160 and receive seed SD from lookup table 160. Logic circuit 120 can generate partial product PP based on the seed SD received from lookup table 160. In some example embodiments, as will be referred to later... Figure 2 As described above, logic circuit 120 can extract multiple parts from input IN and provide multiple addresses to lookup table 160, thereby receiving multiple seeds from the lookup table and generating multiple partial products based on the multiple seeds. Here, the parts extracted from input IN can be referred to as input parts. (See below for further details.) Figure 2 Examples describing logic circuit 120, etc.
[0026] At least one adder 140 can receive a partial product PP from logic circuit 120 and can generate an output OUT based on the partial product PP. For example, as will be referred to later. Figure 2 As described above, at least one adder 140 can receive multiple partial products from logic circuit 120 and generate an output OUT by summing (adding) the multiple partial products. Here, at least one adder 140 that sums the partial products may be referred to as at least one first adder.
[0027] The lookup table memory / lookup table 160 can be accessed by logic circuitry 120 and can store seeds corresponding to multiples of the constant C multiplied by the input IN. The constant C can be an integer, for example, an integer greater than or equal to zero; however, the example embodiment is not limited thereto. For example, as... Figure 1 As shown, when n is an integer, lookup table 160 can store “n×C” as a seed. Logic circuit 120 can generate address ADR based on the partial value extracted from input IN, and can generate / more easily generate partial products based on the seed corresponding to address ADR. Therefore, the product of input IN and constant C (e.g., output OUT) can be computed more efficiently. In some example embodiments, when integrated circuit 100 is used in a machine learning model that identifies features from an input image and the size of the input image increases from, for example, 513×513 to 4023×3024, the size of the feature map of the neural network increases from 150MB to 6.2GB, while the size of the weights can increase from approximately 20MB to 30MB. Therefore, even if the size of input IN increases, the increase in the size of lookup table 160 storing multiples of weights / multiples of constants can be limited. Alternatively or additionally, as will be described later with reference to the figures, lookup table 160 can store only some of all possible values of the partial product (e.g., all possible multiples of the constant). For example, the number of seeds stored in lookup table 160 can be less than the number of possible values of the partial product, and therefore, lookup table 160 can have a reduced size. For example, the number of seeds stored in lookup table 160 can be half the number of possible values of the partial product, or it can be less than or greater than half the number of possible values of the partial product.
[0028] Lookup table 160 may have any structure for storing seeds. For example, lookup table 160 may be or may include at least one of volatile memory (such as static random access memory (SRAM), dynamic random access memory (DRAM), etc.), and / or may be or may include at least one of non-volatile memory (such as flash memory, resistive random access memory (RRAM), etc.), one-time programmable (OTP) memory, antifuse arrays and / or fuse arrays, and at least one of registers, flip-flops, etc.
[0029] Figure 2 This is a block diagram illustrating an example of an integrated circuit 200 according to some example embodiments. More specifically, Figure 2 The block diagram illustrates an integrated circuit 200 that generates the output OUT by multiplying the 16-bit input IN[16:1] (e.g., B01 to B16) by a constant. Similar to... Figure 1 Integrated circuit 100, Figure 2 The integrated circuit 200 may include logic circuit 220, at least one adder 240 and lookup table 260.
[0030] The logic circuit 220 may include an address generator 222 and arithmetic logic 224. The address generator 222 can receive 16-bit input IN[16:1] and can generate the address ADR and control signal CTR. The address generator 222 can extract multiple parts from the 16-bit input IN[16:1]. For example, such as... Figure 2 As shown, address generator 222 can extract first part P1 to fourth part P4 from 16-bit input IN[16:1], and each of first part P1 to fourth part P4 can have a length of four (4) bits. In some example embodiments, as will be referred to later... Figure 9 As described, address generator 222 can extract a portion that shares at least one bit with another portion from a 16-bit input IN[16:1]. Although Figure 2 The example shows the input IN[16:1] divided into four (4) equal parts, each of length four (4) bits, but the example embodiment is not limited thereto. For example, the input IN[16:1] may be divided into unequal parts, and / or may be divided into fewer or more than four (4) parts.
[0031] Address generator 222 can generate multiple address ADRs and control signals CTR based on the first portion P1 to the fourth portion P4 extracted from the 16-bit input IN[16:1]. In some example embodiments, address generator 222 can generate at least one address based on a portion. In some example embodiments, address generator 222 may not generate an address when the portion extracted from the 16-bit input IN[16:1] is zero. Lookup table 260 can provide multiple seed SDs corresponding to the multiple address ADRs to logic circuit 220. In some example embodiments, multiple address ADRs can be provided to lookup table 260 in parallel, and multiple seed SDs can also be provided to logic circuit 220 in parallel and simultaneously. Alternatively, in some example embodiments, multiple address ADRs can be provided to lookup table 260 sequentially, and multiple seed SDs can also be provided to logic circuit 220 sequentially.
[0032] Arithmetic logic 224 can receive a control signal CTR from address generator 222 and can receive multiple seed SDs from lookup table 260. Arithmetic logic 224 may be referred to as or correspond to an arithmetic logic unit (ALU) and can perform arithmetic operations and / or bit shift operations based on the control signal CTR to generate first partial products PP1 to fourth partial products PP4 according to the multiple seed SDs. Here, arithmetic operations and bit shift operations can be collectively referred to as operations. Furthermore, bit shift operations can be simply referred to as shifting and can refer to left shifting. In some example embodiments, the first partial product PP1 to the fourth partial product PP4 may each correspond to a value obtained by multiplying the first portion P1 to the fourth portion P4 extracted from the 16-bit input IN[16:1] by a constant (e.g., multiplying by the same constant). See below for further details. Figure 3 , Figure 5 , Figure 7 and Figure 9 Examples describing arithmetic logic 224, etc.
[0033] At least one adder 240 can generate an output OUT by summing the first partial products PP1 to the fourth partial products PP4. In some example embodiments, arithmetic logic 224 can sequentially output the first partial products PP1 to the fourth partial products PP4, and at least one adder 240 can generate an output OUT by sequentially accumulating the first partial products PP1 to the fourth partial products PP4. At least one adder 240 can have any structure for summing the first partial products PP1 to the fourth partial products PP4, and can include three adders (e.g., in some example embodiments, three adders including half-adder circuitry and / or full-adder circuitry). In the following, as... Figure 2 The example shown will primarily describe an example of processing 16-bit input IN[16:1], but it will be understood that the example embodiment is not limited thereto.
[0034] Figure 3 This is a block diagram illustrating an integrated circuit 300 according to some example embodiments. Figure 4 This illustrates, according to some example embodiments, the inclusion of by Figure 3 The figure shows the partial product generated by integrated circuit 300 in Table 400. Specifically, Figure 3 The block diagram shows the logic circuit 320 that generates a partial product PP, and Figure 4 Table 400 shows all possible values of the partial product PP from... Figure 3 The integrated circuit 300 was generated.
[0035] Reference Figure 3Integrated circuit 300 may include logic circuitry 320 and lookup table 360. Lookup table 360 may store seeds corresponding to odd multiples of the constant C, and may not store seeds corresponding to even multiples of the constant C. For example, as... Figure 3 As shown, lookup table 360 can store eight seeds "C, 3C, ..., 15C". Therefore, lookup table 360 does not need to store all possible values of the partial product PP, and can store only half of the 16 possible values of the partial product PP. As will be described later, when the partial IN[k+3:k] is odd, the seed provided by lookup table 360 in response to address ADR can be output as the partial product PP, while when the partial IN[k+3:k] is even, the value obtained by shifting the seed provided by lookup table 360 in response to address ADR at least once can be output as the partial product PP.
[0036] Logic circuit 320 can receive a portion of IN[k+3:k] (k = 1, 5, 9, or 13) of a specific length (e.g., 4 bits) extracted from input IN, and can generate a partial product PP. For example... Figure 3 As shown, integrated circuit 300 may include address generator 322 and arithmetic logic 324. Address generator 322 may generate address ADR and control signal CTR based on a portion IN[k+3:k]. When the portion IN[k+3:k] is odd, address generator 322 may generate address ADR indicating the location where the seed corresponding to the product of the portion IN[k+3:k] and the constant C is stored. Alternatively, when the portion IN[k+3:k] is even, address generator 322 may generate address ADR indicating the location where the seed that can be generated by shifting the partial product PP is stored.
[0037] Arithmetic logic 324 may include at least one shifter 324_2 and a multiplexer (MUX) 324_4. At least one shifter 324_2 can generate a shifted seed SD' by shifting a seed SD received from lookup table 360 based on a control signal CTR received from address generator 322. When a portion IN[k+3:k] is even, address generator 322 can determine the number of shifts to the seed SD and can generate the control signal CTR based on the determined number of shifts.
[0038] MUX 324_4 can select and output a seed SD provided from lookup table 360 or a shifted seed SD' received from at least one shifter 324_2 as a partial product PP based on the control signal CTR received from address generator 322. When the partial IN[k+3:k] is odd, address generator 322 can generate the control signal CTR for selecting the seed SD, and when the partial IN[k+3:k] is even, address generator 322 can generate the control signal CTR for selecting the shifted seed SD'.
[0039] Reference Figure 4 Table 400 represents the operations (e.g., arithmetic operations and / or bit shift operations) used to generate the partial product PP based on the partial IN[k+3:k] (e.g., 0000 to 1111). See above for reference. Figure 3 As stated, lookup table 360 can store odd multiples of constant C, but does not need to store even multiples of constant C. Therefore, the partial product PP corresponding to the odd-valued part IN[k+3:k] can be the same as the seed SD.
[0040] The partial product PP corresponding to the even-valued partial IN[k+3:k] can be generated by shifting the seed SD at least once. As used herein, the operation "<<" can or may correspond to a shift operation (e.g., bitwise shift). For example, the partial product "2C" can be generated by shifting the seed "C" by one bit (C<<1), the partial product "12C" can be generated by shifting the seed "3C" by two bits (3C<<2), and the partial product "8C" can be generated by shifting the seed "C" by three bits (C<<3). Thus, all 16 values of the partial product PP can be generated.
[0041] Figure 5 This is a block diagram illustrating an integrated circuit 500 according to some example embodiments. Figure 6 This illustrates, according to some example embodiments, the inclusion of by Figure 5 The partial product of integrated circuit 500 is shown in Table 600. More details... Figure 5 The block diagram shows the logic circuit 520 that generates a partial product PP, and Figure 6 Table 600 shows all possible values of the partial product PP generated by integrated circuit 500.
[0042] Reference Figure 5 Integrated circuit 500 may include logic circuitry 520 and lookup table 560. Lookup table 560 may store two or more seeds, and partial product PP may be generated based on one or more operations on at least one seed. For example, as... Figure 5As shown, lookup table 560 can store two seeds "C, 3C", and as described later, a partial product PP can be generated based on an operation of at least one of the two seeds "C, 3C". When compared with... Figure 3 When comparing the lookup table 360, Figure 5 The lookup table 560 can store fewer seeds, while when compared with... Figure 3 When comparing the arithmetic logic 324, as will be described later. Figure 5 The arithmetic logic 524 may also include at least one adder 524_4. In some example embodiments, see below. Figure 6 The lookup table 560 can store a small number (e.g., a minimum number) of seeds, such that a partial product PP is generated by an addition and / or at least a shift based on at least one seed.
[0043] Logic circuit 520 can receive a 4-bit partial IN[k+3:k] extracted from input IN and can generate a partial product PP. For example... Figure 5 As shown, logic circuit 520 may include address generator 522 and arithmetic logic 524. Address generator 522 can generate address ADR and control signal CTR based on a portion IN[k+3:k]. For example, see later. Figure 6 The address generator 522 can generate an address ADR corresponding to at least one of the two seeds "C, 3C" based on a portion IN[k+3:k], and can generate an address corresponding to at least one of the two seeds "C, 3C" based on a portion IN[k+3:k] (in parallel and / or sequentially).
[0044] Arithmetic logic 524 may include at least one shifter 524_2 and at least one adder 524_4. At least one shifter 524_2 may receive a seed SD provided from lookup table 560 based on a control signal CTR and / or may receive the output of at least one adder 524_4, and may shift the received value. Additionally, at least one adder 524_4 may receive a seed SD provided from lookup table 560 based on a control signal CTR and / or may receive the output of at least one shifter 524_2, and may add or subtract the received value based on the control signal CTR. Here, at least one adder 524_4 included in arithmetic logic 524 may be referred to as at least one second adder.
[0045] Reference Figure 6 Table 600 represents the operations (e.g., arithmetic operations and / or bit shift operations) used to generate the partial product PP based on the partial [k+3:k]. See above for reference. Figure 5The lookup table 560 can store (e.g., it can store only) two seeds “C, 3C”, and therefore, the partial product PP corresponding to the partial IN[k+3:k] (which is 1 or 3) can be the same as the seed SD.
[0046] Some values of the partial product PP can be generated by shifting the seed SD. For example, as Figure 6 As shown, four partial products "2C, 4C, 8C, 12C" can be generated by shifting one of the two seeds "C, 3C", and such partial products can be generated without additional operations. Some values of the partial product PP can be generated by adding the seed SD and / or the shifted seed to the seed SD and / or the shifted seed. For example, the partial product "10C" can be generated by adding the value obtained by shifting the seed "3C" once to the value obtained by shifting the seed "C" twice. Some values of the partial product PP can be generated by subtracting the seed SD and / or the shifted seed from the seed SD and / or the shifted seed. For example, the partial product "15C" can be generated by subtracting the seed "C" from the value obtained by shifting the seed "C" four times. In some example embodiments, it can be... Figure 6 The methods shown are different in generating some values of the partial product PP. For example, with Figure 6 The difference shown can be achieved by adding the value obtained by shifting the seed "3C" once to the seed "3C" to generate the partial product "9C".
[0047] Figure 7 This is a block diagram illustrating an integrated circuit 700 according to some example embodiments, and Figure 8 This illustrates some example embodiments. Figure 7 A diagram illustrating an example of the operation of integrated circuit 700. More detailed... Figure 7 The block diagram shows the logic circuit 720 used to generate a partial product PP, and Figure 8 The operation of updating lookup table 760 by logic circuit 720 is shown.
[0048] Reference Figure 7 Integrated circuit 700 may include logic circuitry 720 and lookup table 760. Lookup table 760 can store not only seeds but also the valid bits corresponding to each seed. The active valid bit VB indicates that the seed SD corresponding to the valid bit VB is valid, while the deactivated valid bit VB indicates that the seed SD corresponding to the valid bit VB is invalid. For example, as... Figure 7As shown, in lookup table 760, the active valid bit VB corresponding to the constant C can be "1", while the deactivated valid bit VB corresponding to the invalid value X can be "0". As used herein, the active valid bit VB can have a value of "1", and the deactivated valid bit VB can have a value of "0"; however, the example embodiments are not limited to this. For example, the active valid bit VB can have a value of "0", and the deactivated valid bit VB can have a value of "1". In some example embodiments, a seed SD can be generated during the process of generating the partial product PP, and the generated seed SD can be stored in lookup table 760, thus the valid bit VB can be activated. See also... Figure 8 When part "0110" is received in the lookup table 760 storing constant C, such as Figure 8 As shown, "3C" can be generated by summing the value shifted according to the seed "C" with the seed "C", and the partial product "6C" can be generated by shifting "3C". For example, the "3C" generated in the process of generating the partial product PP can be used as a seed later, thus, as Figure 8 As shown, the updated lookup table 760' can store the seed "3C" and the "1" indicating the active valid bit.
[0049] Return to reference Figure 7 The logic circuit 720 can receive a 4-bit portion IN[k+3:k] extracted from the input IN and calculate the partial product PP. For example... Figure 7 As shown, logic circuit 720 may include address generator 722 and arithmetic logic 724. Address generator 722 can generate address ADR and control signal CTR based on a portion IN[k+3:k]. Address generator 722 can receive the valid bit VB corresponding to address ADR and can identify whether seed SD is valid based on the valid bit VB. For example, when the valid bit VB is activated (e.g., has a value "1"), address generator 722 can identify that the seed SD received by arithmetic logic 724 along with the valid bit VB is valid. Conversely, when the valid bit VB is deactivated (e.g., has a value "0"), address generator 722 can identify that the seed SD received by arithmetic logic 724 along with the valid bit VB is invalid.
[0050] Address generator 722 can generate control signal CTR, causing the seed SD required / used to generate partial product PP to be generated by arithmetic logic 724 in response to the deactivated valid bit VB. For example... Figure 7As shown, arithmetic logic 724 can provide the generated seed SD to lookup table 760, and address generator 722 can provide address ADR and the active write enable signal WE to lookup table 760. Therefore, the seed SD generated by arithmetic logic 724 can be stored in lookup table 760. Optionally or additionally, address generator 722 can provide not only address ADR and the active write enable signal WE to lookup table 760, but also the active valid bit VB. Therefore, the seed SD stored in lookup table 760 can be later used to generate partial product PP based on the partial IN[k+3:k]. As a result, the seed SD can be generated and stored in lookup table 760 upon first use, and the stored seed SD can be used later when generating partial product PP.
[0051] The arithmetic logic 724 may include at least one shifter 724_2 and at least one adder 724_4. At least one shifter 724_2 may receive a seed SD provided from lookup table 760 and / or the output of at least one adder 724_4 based on a control signal CTR, and may shift the received value. Additionally, at least one adder 724_4 may receive a seed SD provided from lookup table 760 and / or the output of at least one shifter 724_2 based on a control signal CTR, and may add or subtract the received value based on the control signal CTR. As described above, at least one shifter 724_2 and at least one adder 724_4 can be used not only to generate the partial product PP, but also to generate the seed SD used for the first time.
[0052] Figure 9 This is a block diagram illustrating an integrated circuit 900 according to some example embodiments. Specifically, Figure 9 The block diagram shows the logic circuit 920 that generates the first partial product PP1 to the fourth partial product PP4 from the input IN. Figure 9 As shown, integrated circuit 900 may include logic circuit 920 and lookup table 960.
[0053] In some example embodiments, partial products can be generated based on the Booth algorithm. The Booth algorithm can refer to a multiplication algorithm that provides reduced computation by encoding the multiplicand based on a portion of the multiplier and summing the encoded multiplicands. As described later, integrated circuit 900 can generate first partial products PP1 through fourth partial products PP4 by encoding the constant C based on a portion extracted from the input IN. The Booth algorithm can be based on the two's complement of the multiplicand.
[0054] Reference Figure 9The logic circuit 920 may include an address generator 922 and arithmetic logic 924. The address generator 922 can extract multiple parts from the input IN, and each of the multiple parts can share at least one bit with another part for Boolean encoding. For example, as... Figure 9 As shown, address generator 922 can extract first part P1 to fourth part P4 from input IN based on radix-10 Booth multiplication. First part P1 can share the fourth bit of input IN with second part P2 [4], second part P2 can share the eighth bit of input IN with third part P3 [8], and third part P3 can share the 12th bit of input IN with fourth part P4
[12] . Optionally or additionally, first part P1 can additionally include a bit IN that is not included in input IN [0]. Address generator 922 can provide first part P1 to fourth part P4 to arithmetic logic 924 and can generate multiple address ADRs based on the value of each of first part P1 to fourth part P4. Figure 2 As described above, multiple address ADRs can be provided to lookup table 960 simultaneously in parallel, or they can be provided to lookup table 960 sequentially. For example... Figure 9 As shown, lookup table 960 can store three seeds "C, 3C, 5C" and, in response to each of the multiple address ADRs, can output one of the three seeds "C, 3C, 5C".
[0055] Arithmetic logic 924 may include a first Booth encoder 924_1 to a fourth Booth encoder 924_4, and the first Booth encoder 924_1 to the fourth Booth encoder 924_4 may respectively receive a first part P1 to a fourth part P4 from the address generator 922. Each of the first Booth encoder 924_1 to the fourth Booth encoder 924_4 may receive a seed SD from a lookup table 960, and may generate a first partial product PP1 to a fourth partial product PP4 based on the seed SD from the first part P1 to the fourth part P4 respectively. According to the radix-10 Booth algorithm, the second Booth encoder 924_2, which receives the second part P2, can generate the second partial product PP2 by shifting the encoded value three times; the third Booth encoder 924_3, which receives the third part P3, can generate the third partial product PP3 by shifting the encoded value seven times; and the fourth Booth encoder 924_4, which receives the fourth part P4, can generate the fourth partial product PP4 by shifting the encoded value eleven times.
[0056] Figure 10 This is a flowchart illustrating a method for constant multiplication according to some example embodiments. For example... Figure 10 As shown, the method for constant multiplication may include multiple operations S10, S30, S50, S70, and S90. In some example embodiments, Figure 10 The method can be derived from Figure 2 The integrated circuit 200 executes, and Figure 10 The following will refer to Figure 2 describe.
[0057] Reference Figure 10 In operation S10, multiple parts can be extracted from the input IN. For example, the address generator 222 can receive an input IN with a length of 16 bits and extract the first part P1 to the fourth part P4 from the input IN. The multiple parts can be of the same size or can be of different sizes.
[0058] In operation S30, multiple address ADRs can be generated. For example, address generator 222 can generate multiple address ADRs based on the first portion P1 to the fourth portion P4. Address generator 222 can generate at least one address based on the portion extracted from the input IN. Optionally or additionally, address generator 222 can generate a control signal CTR based on the first portion P1 to the fourth portion P4. In some example embodiments, when the portion extracted from the input IN is zero, address generator 222 may not generate an address and may generate a control signal CTR such that the corresponding partial product is zero.
[0059] In operation S50, multiple seed SDs can be obtained from lookup table 260. For example, lookup table 260 can store seeds and can output multiple seed SDs simultaneously or sequentially in response to multiple address ADRs received in parallel or sequentially from address generator 222.
[0060] In operation S70, multiple partial products can be generated. For example, arithmetic logic 224 can generate multiple partial products (e.g., first partial product PP1 to fourth partial product PP4) based on the control signal CTR provided from address generator 222 and multiple seed SDs. The first partial product PP1 to fourth partial product PP4 can each correspond to the value obtained by multiplying the first part P1 to the fourth part P4 by a constant. Due to the multiple seed SDs provided in operation S50, the first partial product PP1 to the fourth partial product PP4 can be generated more easily with reduced computational cost.
[0061] In operation S90, multiple partial products can be summed (e.g., multiple partial products can be accumulated). For example, at least one adder 240 can receive first partial products PP1 to fourth partial products PP4 from arithmetic logic 224 and generate output OUT by summing the first partial products PP1 to fourth partial products PP4.
[0062] Figure 11 This is a flowchart illustrating a method for constant multiplication according to some example embodiments. Specifically, Figure 11 The flowchart shows Figure 10 An example of operation S70. See above for reference. Figure 10 As mentioned above, it can be found in Figure 11 Multiple partial products are generated in operation S70'. For example... Figure 11 As shown, operation S70' may include multiple operations S71, S72, and S73. In some example embodiments, operation S70' may be performed by... Figure 3 The integrated circuit 300 executes, and Figure 11 The following will refer to Figure 3 describe.
[0063] Reference Figure 11 In operation S71, the portion extracted from the input IN can be determined to be even. For example, the address generator 322 can receive a 4-bit portion IN[k+3:k] extracted from the input IN, and can determine whether the least significant bit (LSB) of the portion IN[k+3:k] (e.g., the k-th bit IN[k] of the input IN) is zero. (Refer to the above...) Figure 3 and Figure 4 As described, lookup table 360 can store odd multiples of the constant C, and arithmetic logic 324 can receive a seed SD corresponding to the odd multiples of the constant C from lookup table 360. Figure 11 As shown, when the portion IN[k+3:k] is odd (e.g., has the least significant bit "1"), operation S70' can end, and the seed SD received from lookup table 360 can be output as a partial product PP.
[0064] When a portion of IN[k+3:k] is even (e.g., has a "0" in the least significant bit), the seed SD can be shifted in operation S72. For example, when a portion of IN[k+3:k] is even, address generator 322 can generate a control signal CTR, causing the seed SD to be shifted by at least one shifter 324_2 of arithmetic logic 324. At least one shifter 324_2 can shift the seed SD in response to the control signal CTR.
[0065] In operation S73, the index k can be increased by 1, and then operation S71 can be performed based on the increased index k. (See above for reference.) Figure 4 As stated, when a portion of IN[k+3:k] has a value corresponding to a multiple of 4 (e.g., 4C, 12C), the seed SD can be or is required to be shifted twice, and when a portion of IN[k+3:k] has a value corresponding to a multiple of 8 (e.g., 8C), the seed SD can be or is required to be shifted three times. Therefore, as Figure 11 As shown, the seed SD can be shifted by the number of consecutive zeros based on the LSB of part IN[k+3:k]. For ease of illustration, in Figure 11 An example of seed SD being shifted sequentially is shown, but in some example embodiments, address generator 322 can identify the number of consecutive zeros from LSB in part IN[k+3:k] and generate control signal CTR based on the identified number, and at least one shifter 324_2 can shift seed SD once or multiple times based on control signal CTR.
[0066] Figure 12 This is a flowchart illustrating a method for constant multiplication according to some example embodiments. Specifically, Figure 12 The flowchart illustrates a method for generating partial products based on operations with two or more seeds. For example... Figure 12 As shown, the method for constant multiplication may include operations S37, S55, and S77, and operations S37, S57, and S77 may respectively include... Figure 9 In operations S30, S50, and S70. In some example embodiments, Figure 12 The method can be derived from Figure 5 The integrated circuit 500 executes, and Figure 12 The following will refer to Figure 5 describe.
[0067] Reference Figure 12 In operation S37, at least two addresses can be generated. For example, address generator 522 can generate at least two addresses based on the values of a portion IN[k+3:k] extracted from the input IN. (Refer to the above...) Figure 5 The lookup table 560 can store seed "C" and seed "3C", and the address generator 522 can generate at least two addresses corresponding to at least two seeds required to generate the partial product PP. For example, as described above... Figure 6 As stated, when part of "0101" is received, address generator 522 can generate two addresses corresponding to seed "C" and seed "3C" respectively.
[0068] In operation S57, at least two seeds can be obtained from lookup table 560. For example, lookup table 560 can output at least two seeds in response to at least two addresses provided in operation S37, and arithmetic logic 524 can receive at least two seeds from lookup table 560.
[0069] In operation S77, the partial product PP can be generated based on operations with at least two seeds. For example, in operation S37, the address generator 522 can generate not only at least two addresses but also a control signal CTR, and the arithmetic logic 524 can generate the partial product PP based on operations with at least two seeds, using the control signal CTR provided from the address generator 522. The arithmetic logic 524 may include at least one shifter 524_2 and at least one adder 524_4, and as referred to above... Figure 6 As described, partial products PP can be generated based on addition, subtraction, and / or shifting from at least two seeds.
[0070] Figure 13 This is a flowchart illustrating a method for constant multiplication according to some example embodiments. Specifically, Figure 13 The flowchart shows Figure 10 An example of operation S50. See above for reference. Figure 10 As mentioned above, in Figure 13 In operation S50', multiple seeds can be obtained from the lookup table. For example... Figure 13 As shown, operation S50' may include multiple operations S51 to S56. In some example embodiments, operation S50' may be performed by... Figure 7 The integrated circuit 700 performs this, and Figure 13 The following will refer to Figure 7 describe.
[0071] Reference Figure 13 In operation S51, the valid bit VB corresponding to the address ADR can be obtained. For example, lookup table 760 can store the seed and the valid bits corresponding to the seed, and each valid bit can indicate whether the seed corresponding to the valid bit is valid. Address generator 722 can receive the valid bit VB by providing the address ADR to lookup table 760.
[0072] In operation S52, it can be determined whether the valid bit VB is activated. For example, when the value of the valid bit VB received from lookup table 760 is "1", address generator 722 can determine that the valid bit VB is activated, and when the value of the valid bit VB is "0", address generator 722 can determine that the valid bit VB is deactivated. Figure 13 As shown, when the valid bit VB is activated, a seed SD corresponding to the address ADR can be provided to generate a partial product PP in operation S56.
[0073] When the valid bit VB is deactivated, the seed SD can be calculated in operation S53. For example, as shown above. Figure 8The arithmetic logic 724 can generate a seed SD in the process of generating the partial product PP based on the control signal CTR provided from the address generator 722. Then, in operation S54, the seed SD can be provided for calculation to generate the partial product PP.
[0074] In operation S55, the calculated seed SD and the active valid bit VB can be stored in lookup table 760. For example, arithmetic logic 724 can provide the seed SD calculated in operation S53 to lookup table 760, and address generator 722 can provide the active valid bit VB and the active write enable signal WE to lookup table 760. Lookup table 760 can store the active valid bit VB received from address generator 722 and the seed SD received from arithmetic logic 724 in response to the active write enable signal WE.
[0075] Figure 14 This is a flowchart illustrating a method for constant multiplication according to some example embodiments. Specifically, Figure 14 The flowchart illustrates a method for performing constant multiplication based on the Booth algorithm. Figure 14 As shown, the method for constant multiplication may include operations S18, S38, S58, and S78, and operations S18, S38, S58, and S78 may respectively include... Figure 10 In operations S10, S30, S50, and S70. In some example embodiments, Figure 14 The method can be derived from Figure 9 The integrated circuit 900 executes, and Figure 14 The following will refer to Figure 9 Described.
[0076] Reference Figure 14 In operation S18, a portion that shares at least one bit with another portion can be extracted from the input IN. For example, the address generator 922 can extract the first portion P1 to the fourth portion P4 from the input IN based on radix 10-Bouse multiplication, and each of the first portion P1 to the fourth portion P4 can share at least one bit with another portion.
[0077] In operation S38, at least one address can be generated. For example, address generator 922 can generate at least one address to receive from lookup table 960 at least one seed required to generate a partial product based on Booth multiplication according to the portion extracted in operation S18.
[0078] In operation S58, at least one seed can be obtained from lookup table 960. For example, address generator 922 can provide at least one address generated in operation S38 to lookup table 960, and lookup table 960 can provide at least one seed to arithmetic logic 924 in response to at least one address.
[0079] In operation S78, partial products of the Booth encoding can be generated. For example, arithmetic logic 924 may include a first Booth encoder 924_1 to a fourth Booth encoder 924_4, and the first Booth encoder 924_1 to the fourth Booth encoder 924_4 may generate first partial products PP1 to fourth partial products PP4 respectively based on at least one seed provided in operation S58 according to the first part P1 to the fourth part P4.
[0080] Figure 15 This is a diagram illustrating an example of the operation of storing seeds in lookup table 12_2 according to some example embodiments. Specifically, Figure 15 The left side shows operations S1, S3, S5, S7, and S9 of mounting a machine learning model on a processing device 10 designed to execute machine learning models, and... Figure 15 The right side shows a detailed example of operation S9.
[0081] A machine learning model can refer to, or may refer to, any model such as one trained on multiple samples. For example, a machine learning model can be a model based on at least one of artificial neural networks (ANNs), decision trees, support vector machines, regression analysis, Bayesian networks, genetic algorithms, etc. In some example embodiments, when the machine learning model is based on an ANN (or a simple neural network), as a non-limiting example, the ANN may include at least one of convolutional neural networks (CNNs), region-with-convolution neural networks (R-CNNs), region proposal networks (RPNs), recurrent neural networks (RNNs), stacking-based deep neural networks (S-DNNs), state-space dynamic neural networks (S-SDNNs), deconvolutional networks, deep belief networks (DBNs), restricted Boltzmann machines (RBMs), fully convolutional networks, long short-term memory (LSTM) networks, and classification networks.
[0082] Processing device 10 can execute machine learning models. For example, processing device 10 may include dedicated hardware (such as a neural processor (NPU)) designed to execute machine learning models, and may also include hardware for various purposes capable of executing machine learning models (such as a central processing unit (CPU), a mining accelerator, a graphics processing unit (GPU), etc.). Furthermore, in some example embodiments, processing device 10 may include a processor-in-memory (PIM) (such as computational RAM). Figure 15 As shown, the processing device 10 may include an integrated circuit 12 and a non-volatile memory (NVM) 14, and the integrated circuit 12 may include a lookup table 12_2, logic circuitry 12_4, and at least one adder 12_6. In some example embodiments, the processing device 10 may include a plurality of units (such as a plurality of standard units) that generate, in parallel, the product of the input and weights included in the feature map, and each of the plurality of units may include a lookup table 12_2, logic circuitry 12_4, and at least one adder 12_6. Here, the processing device 10 may be simply referred to as a device.
[0083] Reference Figure 15 On the left side, in operation S1, a floating-point model can be prepared. For more accurate results, a floating-point model trained using floating-point arithmetic instead of fixed-point arithmetic can be prepared.
[0084] In operation S3, quantization can be performed. For example, a processing device 10 designed to execute machine learning models can be included in the mobile system and can include limited resources. Therefore, floating-point models can be quantized, and the quantized model can be mounted on the processing device 10. (Refer to the above...) Figure 1 As described, the number of quantization levels can be increased to obtain more accurate results.
[0085] In operation S5, seed computation can be performed. The fully trained floating-point model in operation S1 can include floating-point weights, and in operation S3, the floating-point weights can be quantized. As described above with reference to the accompanying drawings, the seed pre-stored in lookup table 12_2 can be used for multiplication of the input with the weights included in the feature map, and the seed stored in lookup table 12_2 can be computed in operation S5. Because the weights are determined in operation S3, the seed can be computed a priori (e.g., pre-computed in operation S5) independently of the inference performed by the machine learning model executed by the processing device 10.
[0086] In operation S7, compilation can be performed. For example, a compiler executed by the computing system can convert the model quantized in operation S3 and the seed calculated in operation S5 into a form executable by the processing device 10.
[0087] In operation S9, supply can be executed. For example, such as... Figure 15 As shown on the right, the data DAT compiled in operation S7 can be provided to the processing device 10. As described above, the data DAT can include the seed calculated in operation S5. The data DAT provided to the processing device 10 can be programmed into NVM 14, and lookup table 12_2 can load the seed SD from NVM 14. As a result, some of the operations required / used when the machine learning model is executed can be pre-executed, and the inference of the machine learning model can be performed more efficiently.
[0088] Figure 16A and Figure 16B This is a block diagram illustrating an example of the operation of storing seeds in lookup tables 22_2a and 22_2b according to an embodiment. Figure 15 Unlike the example, the data compiled by the compiler may not include the seed, and the seed can be... Figure 16A and Figure 16B The processing devices 20a and 20b are calculated. In the following text, Figure 16A and Figure 16B and Figure 15 Redundant descriptions have been omitted.
[0089] Reference Figure 16A The processing device 20a may include an integrated circuit 22a, an NVM 24a, and a seed calculator 26a, and the integrated circuit 22a may include a lookup table 22_2a, a logic circuit 22_4a, and at least one adder 22_6a. (Refer to the above.) Figure 15 In order to provide the machine learning model to the processing device 20a, the data DAT can be programmed in the NVM 24a.
[0090] The seed calculator 26a can receive multiple weighted WTs from the data DAT programmed in NVM 24a, and generate multiple seeded SDs based on the multiple weighted WTs. For example... Figure 16A As shown, the seed calculator 26a can provide multiple seed SDs to the NVM 24a, and these seed SDs can be programmed into the NVM 24a along with the data DAT. Therefore, when a machine learning model is provided, multiple seed SDs can be computed, and lookup table 22_2a can load multiple seed SDs from the NVM 24a.
[0091] Reference Figure 16B The processing device 20b may include an integrated circuit 22b, an NVM 24b, and a seed calculator 26b, and the integrated circuit 22b may include a lookup table 22_2b, logic circuitry 22_4b, and at least one adder 22_6b. (Refer to the above.) Figure 15In order to provide the machine learning model to the processing device 20b, the data DAT can be programmed in the NVM 24b.
[0092] The seed calculator 26b can receive weights WT from NVM 24b and can calculate seed SD (e.g., at least one seed SD) based on the weights WT to provide the seed SD to lookup table 12_2b. Therefore, with... Figure 15 and Figure 16A Unlike other examples, the seed SD may not be stored in NVM 24b, and the seed SD may be calculated by the seed calculator 26b based on the weight WT, and provided to lookup table 12_2b before the multiplication of the input with the weight WT is performed.
[0093] Figure 17 This is a block diagram illustrating a system 30 according to some example embodiments. In some example embodiments, system 30 may be a system-on-a-chip in which components are integrated into a single chip (or die), and may be referred to as an application processor (AP). Figure 17 As shown, system 30 may include CPU 31, GPU 32, NPU 33, modem 34, memory 35, accelerator 36, interface 37 and at least one sensor 38, and CPU 31, GPU 32, NPU 33, modem 34, memory 35, accelerator 36, interface 37 and at least one sensor 38 may communicate with each other via bus 39.
[0094] CPU 31 can execute a series of instructions and control system 30. In some example embodiments, CPU 31 can execute an operating system (OS) and can execute multiple applications on the OS. CPU 31 may include multiple cores capable of executing instructions independently of each other, and may include a cache memory accessed by the multiple cores. In some example embodiments, CPU 31 may include circuitry (such as the integrated circuit for constant multiplication described above with reference to the accompanying drawings).
[0095] GPU 32 may refer to dedicated hardware designed to process graphics data, and NPU 33 may refer to dedicated hardware designed to execute machine learning models. In some example embodiments, GPU 32 and / or NPU 33 may include multiple units that operate in parallel with each other, and each of the multiple units may include the integrated circuit for constant multiplication described above with reference to the accompanying drawings.
[0096] Modem 34 can extract information by demodulating and / or decoding signals received via wired and / or wireless channels. Furthermore, modem 34 can generate signals to be transmitted over wired or wireless channels by encoding and / or modulating the information. Memory 35 can be accessed by other components via bus 39 and may include volatile memory and / or NVM. In some example embodiments, memory 35 may store seeds to be loaded into a lookup table described above with reference to the accompanying drawings. Accelerator 36 may refer to hardware designed to perform a specific function at high speed. Interface 37 can provide an interface to external devices (e.g., input / output devices) of system 30. At least one sensor 38 can sense or detect at least one physical quantity (such as temperature, voltage, current, etc.).
[0097] As used herein, the various exemplary embodiments described are not necessarily mutually exclusive. For example, some exemplary embodiments may include features described with reference to one drawing, and may also include features described with reference to another drawing.
[0098] Furthermore, each or at least some of the aforementioned elements can be implemented as processing circuitry, for example, using logic gates (such as standard cells including various transistors, such as CMOS transistors). The elements can be designed or implemented as standard cells (such as full adders, half adders, multiplexers, decoders, encoders, etc.).
[0099] Any element and / or functional block disclosed above may include processing circuitry (such as hardware including logic circuitry, a hardware / software combination (such as a processor executing software), or a combination thereof) or implemented in processing circuitry (such as hardware including logic circuitry, a hardware / software combination (such as a processor executing software), or a combination thereof). For example, processing circuitry may more specifically include, but is not limited to, a central processing unit (CPU), an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field-programmable gate array (FPGA), a system-on-a-chip (SoC), a programmable logic unit, a microprocessor, an application-specific integrated circuit (ASIC), etc. Processing circuitry may include electronic components (such as at least one of transistors, resistors, capacitors, etc.). Processing circuitry may include electronic components (such as at least one of AND gates, OR gates, NAND gates, NOT gates, etc.).
[0100] Although the inventive concept has been specifically shown and described with reference to various exemplary embodiments thereof, it will be understood that various changes in form and detail may be made therein without departing from the spirit and / or scope of the appended claims.
Claims
1. An integrated circuit for generating a product of an input and a constant, the integrated circuit comprising: The lookup table memory is configured to store seeds corresponding to multiples of the constant; as well as The processing circuit is configured to generate multiple addresses corresponding to multiple parts extracted from the input, to receive multiple seeds from a lookup table memory based on the multiple addresses, and to generate multiple partial products based on the multiple seeds. The processing circuit is configured to sum the plurality of partial products. The number of seeds stored in the lookup table memory is less than the number of possible values for the plurality of partial products.
2. The integrated circuit as claimed in claim 1, wherein, The lookup table memory is configured to store seeds corresponding to odd multiples of the constant, and The processing circuit is configured to shift the seed received from the lookup table memory in response to the fact that the portion extracted from the input is even.
3. The integrated circuit as described in claim 1, wherein, The processing circuit is configured to: generate at least two addresses based on portions extracted from the input, receive at least two seeds from a lookup table memory based on the at least two addresses, and generate a partial product based on the at least two seeds.
4. The integrated circuit as described in claim 3, wherein, The lookup table memory is configured to store a first number of seeds such that a partial product is generated by at least one shift and one addition based on at least one seed.
5. The integrated circuit as described in claim 3, wherein, The processing circuit is configured to perform at least one of addition and subtraction, which are based on portions extracted from the input.
6. The integrated circuit as claimed in claim 1, wherein, The lookup table memory is configured to store the valid bits corresponding to the seed, and The processing circuit is configured to: receive the first valid bit of the first seed based on the address corresponding to the portion extracted from the input, and generate the first seed in response to the first valid bit being deactivated, store the generated first seed in a lookup table memory, and store the activated first valid bit in the lookup table memory.
7. The integrated circuit according to any one of claims 1 to 6, wherein, Each of the plurality of parts extracted from the input shares at least one bit with the other parts of the plurality of parts, and The processing circuit is configured to receive a portion extracted from the input and generate a partial product based on a seed, the processing of generating the partial product being based on Booth coding.
8. An apparatus for generating a product of an input and weights, the apparatus comprising: Multiple units are configured to generate the product of the input and weights, which are included in the feature map, in parallel. Each of the plurality of units includes: The lookup table memory is configured to store seeds corresponding to multiples of the weights; and The processing circuit is configured to: generate an address corresponding to a portion extracted from the input, and generate a partial product based on a seed corresponding to the address; The processing circuitry is configured to sum the products of multiple parts. The number of seeds stored in the lookup table memory is less than the number of possible values for the partial product.
9. The apparatus of claim 8, wherein, The lookup table memory is configured to store seeds corresponding to odd multiples of the weights, and The processing circuit is configured to generate a partial product by shifting the seed corresponding to the address in response to the fact that the part extracted from the input is even.
10. The apparatus of claim 8, wherein, The processing circuit is configured to generate at least two addresses based on portions extracted from the input, and to generate a partial product based on operations on at least two seeds corresponding to the at least two addresses.
11. The apparatus of claim 8, wherein, The lookup table memory is configured to store the valid bits corresponding to the seed, and In response to the first valid bit of the first seed corresponding to the address being deactivated, the processing circuit is configured to: generate a first seed, store the generated first seed in a lookup table memory, and store the activated first valid bit in the lookup table memory.
12. The apparatus of claim 8, wherein, The processing circuit is configured to extract multiple portions sharing at least one bit from the input and generate a partial product based on the portions extracted from the input and a seed, using the Booth algorithm.
13. The apparatus of claim 8, wherein, The lookup table memory is configured to load a seed from a memory programmed externally to the device.
14. The apparatus according to any one of claims 8 to 13, wherein, The processing circuit is configured to calculate at least one seed based on the weights.
15. The apparatus of claim 14, further comprising: A non-volatile memory is configured to store the weights and the calculated at least one seed. The lookup table memory is configured to load weights and at least one seed from non-volatile memory.
16. The apparatus of claim 14, wherein, The processing circuitry is configured to provide the at least one seed to the lookup table memory before calculating the product.
17. A method for generating a product of an input and a constant, the method comprising: Multiple parts are extracted from the input through processing circuitry; The processing circuit generates multiple addresses corresponding to the multiple parts respectively; The processing circuitry obtains multiple seeds from a lookup table memory that stores seeds corresponding to multiples of the constant, the obtaining steps being based on the multiple addresses; The processing circuit generates multiple partial products based on the multiple seeds. as well as The processing circuit sums the multiple partial products. The number of seeds stored in the lookup table memory is less than the number of possible values for the plurality of partial products.
18. The method of claim 17, wherein, The lookup table memory stores seeds corresponding to odd multiples of the constant, and The steps for generating multiple partial products include shifting the seed obtained from the lookup table memory when the number of parts extracted from the input is even.
19. The method of claim 17, wherein, The steps for generating multiple addresses include generating at least two addresses based on portions extracted from the input. The step of obtaining multiple seeds includes obtaining at least two seeds from the lookup table memory based on the at least two addresses, and The step of generating multiple partial products includes generating partial products based on operations on the at least two seeds.
20. The method according to any one of claims 17 to 19, wherein, The lookup table memory stores the valid bits corresponding to the seed, and The steps for obtaining multiple seeds also include: The first valid bit is obtained from the lookup table memory based on the address; When the first valid bit is deactivated, a first seed corresponding to the first valid bit is generated; and The generated first seed and the activated first valid bit are stored in the lookup table memory.
Citation Information
Patent Citations
Low complexity approximate multiplier based on lookup table
CN109117114A
Digital filter and method for performing a multiplication based on a look-up table
US20020118739A1
