CN118092855A - Integrated storage and calculation multiplier supporting floating-point number mantissa multiplication and multiplication operation method - Google Patents
Integrated storage and calculation multiplier supporting floating-point number mantissa multiplication and multiplication operation method Download PDFInfo
- Publication number
- CN118092855A CN118092855A CN202410142246.6A CN202410142246A CN118092855A CN 118092855 A CN118092855 A CN 118092855A CN 202410142246 A CN202410142246 A CN 202410142246A CN 118092855 A CN118092855 A CN 118092855A
- Authority
- CN
- China
- Prior art keywords
- multiplier
- multiplication
- addition
- decoding
- bit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/491—Computations with decimal numbers radix 12 or 20.
- G06F7/498—Computations with decimal numbers radix 12 or 20. using counter-type accumulators
- G06F7/4983—Multiplying; Dividing
Landscapes
- Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Complex Calculations (AREA)
Abstract
Description
技术领域Technical Field
本发明属于集成电路设计技术领域,具体涉及一种支持浮点数尾数乘法的存算一体乘法器以及乘法运算方法。The present invention belongs to the technical field of integrated circuit design, and in particular relates to a storage-calculation integrated multiplier supporting floating-point number mantissa multiplication and a multiplication operation method.
背景技术Background technique
近几年来,随着大数据和人工智能领域技术的快速发展,数据密集型和计算密集型的应用场景越来越多。而且这些应用场景往往有着高访存性、大规模并行性、多重复性的特点。数据量大、计算量多对集成电路的高速低功耗提出了更加严峻的考验。现有的冯诺依曼架构中存储和计算分离的机制,使得消耗在数据传输上的能量和时间,在消耗的总能量和总时间中占比十分巨大,不能满足运算发展的需求。此外,在科学计算和高性能计算领域,例如自动驾驶、航空航天、力学计算领域,核心运算类型往往是浮点运算。传统处理器中的浮点运算单元通常消耗的资源、功耗都很大。当执行高并行的浮点乘加运算时,则需要更多的浮点单元,消耗巨大的资源和功耗。因此,亟需新型的运算架构来克服这一瓶颈。In recent years, with the rapid development of technologies in the fields of big data and artificial intelligence, there are more and more data-intensive and computing-intensive application scenarios. Moreover, these application scenarios often have the characteristics of high memory access, large-scale parallelism, and multiple repetitions. Large amounts of data and large amounts of computation pose a more severe test to the high speed and low power consumption of integrated circuits. The existing von Neumann architecture separates storage and computation, which makes the energy and time consumed in data transmission account for a very large proportion of the total energy and total time consumed, and cannot meet the needs of computing development. In addition, in the fields of scientific computing and high-performance computing, such as autonomous driving, aerospace, and mechanical computing, the core computing type is often floating-point computing. The floating-point computing units in traditional processors usually consume a lot of resources and power. When performing highly parallel floating-point multiplication and addition operations, more floating-point units are required, which consumes huge resources and power. Therefore, a new computing architecture is urgently needed to overcome this bottleneck.
存算一体技术是在存储器里或者附近直接进行运算,能解决计算密集型应用中访问存储器所带来的数据搬运开销,能提高运算的速度和能效,是一种有潜力的运算架构。现有技术中存在一些存算一体乘法器,但这些存算一体乘法器仍有其不足之处。The storage-computation technology is to perform calculations directly in or near the memory, which can solve the data transfer overhead caused by accessing the memory in computing-intensive applications, improve the speed and energy efficiency of calculations, and is a potential computing architecture. There are some storage-computation multipliers in the prior art, but these storage-computation multipliers still have their shortcomings.
例如,文献【Ping-Chun Wu1,Jian-Wei Su,et al.A 22nm 832Kb Hybrid-DomainFloating-Point SRAMIn-Memory-Compute Macro with16.2-70.2TFLOPS/W for High-Accuracy AI-Edge Devices[C]//2023IEEE International Solid-State CircuitsConference(ISSCC).IEEE,2023,65:1-3.】提出了基于SRAM的数模混合型存算一体结构,用于神经网络推理。它的存算结构支持BFP16型浮点乘加运算,对于浮点权重的尾数采用三角阵列存储,按列加权排布的方法。这种存算一体结构虽然实现了较大的数据输入并行度,但不足在于三角阵列的存储方式导致SRAM的利用率不高,如果将此架构拓展到FP32模式,依然采用三角阵列的方式来排放尾数,那么将会形成更多的SRAM冗余阵列,面积效率很低。For example, the document [Ping-Chun Wu1, Jian-Wei Su, et al. A 22nm 832Kb Hybrid-Domain Floating-Point SRAM In-Memory-Compute Macro with 16.2-70.2TFLOPS/W for High-Accuracy AI-Edge Devices [C] // 2023 IEEE International Solid-State Circuits Conference (ISSCC). IEEE, 2023, 65: 1-3.] proposed a SRAM-based digital-analog hybrid storage-computation integrated structure for neural network reasoning. Its storage-computation structure supports BFP16-type floating-point multiplication and addition operations, and uses a triangular array to store the mantissa of the floating-point weight, and arranges it by column weights. Although this storage-computation integrated structure achieves a large degree of data input parallelism, its disadvantage is that the storage method of the triangular array leads to low utilization of SRAM. If this architecture is expanded to FP32 mode, and the triangular array method is still used to arrange the mantissa, more SRAM redundant arrays will be formed, and the area efficiency will be very low.
文献【Lee J,Kim J,Jo W,et al.A 13.7TFLOPS/W floating-point DNNprocessor using heterogeneous computing architecture with exponent-computing-in-memory[C]//2021Symposium on VLSI Circuits.IEEE,2021:1-2.】提出了基于SRAM的“异构”型存算一体结构,同样是用于神经网络推理。它的存算结构支持FP32型浮点乘加运算,对于浮点权重的指数采用SRAM阵列配合逻辑门来处理,浮点权重的尾数采用SRAM阵列外围的数字电路来处理。这种存算一体结构虽然可以实现浮点运算,但不足在于仅优化了指数运算,没有优化功耗、速度开销大的尾数运算,因此无法有效的发挥存算一体的低功耗优势。The literature [Lee J, Kim J, Jo W, et al. A 13.7TFLOPS/W floating-point DNN processor using heterogeneous computing architecture with exponent-computing-in-memory [C] // 2021 Symposium on VLSI Circuits. IEEE, 2021: 1-2.] proposed a "heterogeneous" storage-computing integrated structure based on SRAM, which is also used for neural network reasoning. Its storage-computing structure supports FP32 floating-point multiplication and addition operations. The exponent of the floating-point weight is processed by the SRAM array in combination with the logic gate, and the mantissa of the floating-point weight is processed by the digital circuit outside the SRAM array. Although this storage-computing integrated structure can realize floating-point operations, its disadvantage is that it only optimizes the exponential operation, and does not optimize the mantissa operation with high power consumption and speed overhead. Therefore, it cannot effectively exert the low power consumption advantage of storage-computing integrated.
专利CN2021108325336中提出了一种基于DRAM和查找表的存算一体浮点乘加结构。在移位对齐方面,利用循环移位产生所有指数对齐可能需要的结果,然后遍历查找表搜索目标操作数。在浮点尾数乘法方面,遍历n比特数据片段和源尾数乘法,而后将部分积直接存在DRAM里作为查找表,查找累加。这种存算一体浮点乘加结构可将部分积累加次数从m降低到m/n,但不足之处在于,第一它的硬件不支持可重构,也就是说只能支持一种数据位宽,不能重构成支持多种位宽的运算。第二它的输入并行度只能取决于单个译码器的输入地址位宽,并行度难以很好的提高。Patent CN2021108325336 proposes a storage-computation integrated floating-point multiplication-addition structure based on DRAM and a lookup table. In terms of shift alignment, circular shift is used to generate all the results that may be required for exponent alignment, and then the lookup table is traversed to search for the target operand. In terms of floating-point mantissa multiplication, the n-bit data fragment and the source mantissa multiplication are traversed, and then the partial product is directly stored in the DRAM as a lookup table for search and accumulation. This storage-computation integrated floating-point multiplication-addition structure can reduce the number of partial accumulations from m to m/n, but the disadvantage is that, first, its hardware does not support reconfiguration, that is, it can only support one data bit width and cannot be reconstructed to support operations with multiple bit widths. Second, its input parallelism can only depend on the input address bit width of a single decoder, and the parallelism is difficult to improve well.
如上所述,现有技术中的存算一体结构存在扩展性差、效率提升有限的问题,因此,需要一种更易扩展的支持浮点数尾数乘法的存算一体结构。As described above, the storage-computation integrated structure in the prior art has the problems of poor scalability and limited efficiency improvement. Therefore, a more scalable storage-computation integrated structure that supports floating-point mantissa multiplication is needed.
发明内容Summary of the invention
本发明是为解决上述问题而进行的,目的在于提供一种更易扩展且支持浮点数尾数乘法的存算一体乘法器以及利用该乘法器进行乘法运算的方法,本发明采用了如下技术方案:The present invention is made to solve the above problems, and aims to provide a storage-computation integrated multiplier which is easier to expand and supports floating-point number mantissa multiplication, and a method for performing multiplication operation using the multiplier. The present invention adopts the following technical solutions:
本发明提供了一种支持浮点数尾数乘法的存算一体乘法器,其特征在于,包括:译码阵列,包含至少一个地址译码器,用于对输入的乘数的多个乘数片段进行地址译码,得到译码结果;存储器,其输入端与所述译码阵列的输出端连接,用于存储被乘数的多个部分积并根据所述译码结果输出相应的所述部分积;加法阵列,其输入端与所述存储器的输出端连接,用于对所述部分积进行错位相加,输出加法结果;以及移位累加器,其输入端与所述加法阵列的输出端连接,用于对所述加法结果进行移位累加,得到乘法结果。The present invention provides a storage-calculation integrated multiplier supporting floating-point mantissa multiplication, characterized in that it comprises: a decoding array, comprising at least one address decoder, for performing address decoding on multiple multiplier fragments of an input multiplier to obtain a decoding result; a memory, whose input end is connected to the output end of the decoding array, for storing multiple partial products of a multiplicand and outputting corresponding partial products according to the decoding result; an addition array, whose input end is connected to the output end of the memory, for performing staggered addition on the partial products and outputting an addition result; and a shift accumulator, whose input end is connected to the output end of the addition array, for performing shift accumulation on the addition result to obtain a multiplication result.
本发明提供的支持浮点数尾数乘法的存算一体乘法器,还可以具有这样的技术特征,其中,所述地址译码器的数量为n个,每个所述地址译码器的位宽为m位,用于输入m位的所述乘数片段,所述部分积为所述被乘数与所有可能的m位比特数的遍历乘法结果。The storage-and-computation-in-one multiplier supporting floating-point mantissa multiplication provided by the present invention may also have such a technical feature, wherein the number of the address decoders is n, the bit width of each address decoder is m bits, and it is used to input the m-bit multiplier fragment, and the partial product is the ergodic multiplication result of the multiplicand and all possible m-bit bit numbers.
本发明提供的支持浮点数尾数乘法的存算一体乘法器,还可以具有这样的技术特征,其中,所述存储器包括:多个存储单元;多条位线,用于读或写对应的所述存储单元,所述存储单元按行分组地连接到对应的所述位线上;以及位线选通器,所述多条位线分别连接至所述位线选通器的读写端,所述译码阵列的输出端连接至所述位线选通器的输入端,所述位线选通器用于根据所述译码结果选通相应的所述位线,从而选通对应的所述存储单元的行。The storage-computation integrated multiplier supporting floating-point mantissa multiplication provided by the present invention may also have such technical features, wherein the memory includes: a plurality of storage cells; a plurality of bit lines for reading or writing the corresponding storage cells, the storage cells being connected to the corresponding bit lines in row groups; and a bit line selector, the plurality of bit lines being respectively connected to the read and write ends of the bit line selector, the output end of the decoding array being connected to the input end of the bit line selector, the bit line selector being used to select the corresponding bit lines according to the decoding results, thereby selecting the corresponding rows of the storage cells.
本发明提供了一种利用上述支持浮点数尾数乘法的存算一体乘法器进行乘法运算的方法,其特征在于,包括以下步骤:将乘数以预定位宽为单位划分成多个乘数片段,并将多个所述乘数片段串行地加载到所述译码阵列的输入端;所述译码阵列对所述乘数片段进行地址译码得到译码结果,并将所述译码结果向所述存储器输出;所述存储器根据所述译码结果,将其存储的相应的被乘数的部分积向所述加法阵列输出;所述加法阵列基于所述部分积进行错位相加得到加法结果,并将所述加法结果向所述移位累加器输出;所述移位累加器对所述加法结果进行移位累加,得到乘法结果。The present invention provides a method for performing multiplication operations using the above-mentioned storage-computation integrated multiplier that supports floating-point mantissa multiplication, characterized in that it includes the following steps: dividing the multiplier into multiple multiplier fragments in units of a predetermined bit width, and serially loading the multiple multiplier fragments to the input end of the decoding array; the decoding array performs address decoding on the multiplier fragments to obtain a decoding result, and outputs the decoding result to the memory; the memory outputs the partial products of the corresponding multiplicands stored in it to the addition array according to the decoding result; the addition array performs staggered addition based on the partial products to obtain an addition result, and outputs the addition result to the shift accumulator; the shift accumulator performs shift accumulation on the addition result to obtain a multiplication result.
本发明提供了一种支持浮点数尾数乘法的高位宽存算一体乘法器,其特征在于,包括:多个上述的支持浮点数尾数乘法的存算一体乘法器;以及错位相加器,多个支持浮点数尾数乘法的存算一体乘法器的输出端分别连接至所述错位相加器的输入端,所述错位相加器用于对多个所述支持浮点数尾数乘法的存算一体乘法器的乘法结果进行错位相加,得到高位宽乘法结果。The present invention provides a high-bit-width storage-and-calculation integrated multiplier supporting floating-point number mantissa multiplication, characterized in that it comprises: a plurality of the above-mentioned storage-and-calculation integrated multipliers supporting floating-point number mantissa multiplication; and an offset adder, wherein the output ends of the plurality of storage-and-calculation integrated multipliers supporting floating-point number mantissa multiplication are respectively connected to the input ends of the offset adders, and the offset adder is used for performing offset addition on the multiplication results of the plurality of storage-and-calculation integrated multipliers supporting floating-point number mantissa multiplication to obtain a high-bit-width multiplication result.
本发明提供的支持浮点数尾数乘法的高位宽存算一体乘法器,还可以具有这样的技术特征,其中,多个所述支持浮点数尾数乘法的存算一体乘法器的所述译码阵列用于输入相同的所述乘数片段,多个所述支持浮点数尾数乘法的存算一体乘法器的多个所述存储器分别用于存储所述部分积的不同的权重位段,所述错位相加器根据对应的所述权重位段将多个所述乘法结果进行移位相加,从而得到所述高位宽乘法结果。The high-bit-width storage-and-calculation integrated multiplier supporting floating-point mantissa multiplication provided by the present invention may also have such a technical feature, wherein the decoding arrays of multiple storage-and-calculation integrated multipliers supporting floating-point mantissa multiplication are used to input the same multiplier fragments, the multiple memories of multiple storage-and-calculation integrated multipliers supporting floating-point mantissa multiplication are respectively used to store different weight bit segments of the partial products, and the offset adder shifts and adds multiple multiplication results according to the corresponding weight bit segments, thereby obtaining the high-bit-width multiplication result.
本发明提供了一种利用上述支持浮点数尾数乘法的高位宽存算一体乘法器进行乘法运算的方法,其特征在于,包括以下步骤:将乘数以预定位宽为单位划分成多个乘数片段,并将所述多个乘数片段串行地加载到多个所述支持浮点数尾数乘法的存算一体乘法器的所述译码阵列的输入端;多个所述译码阵列分别对所述乘数片段进行地址译码得到译码结果,并将所述译码结果向对应的所述存储器输出;多个所述存储器分别根据所述译码结果,将其存储的相应的被乘数的部分积向对应的所述加法阵列输出;多个所述加法阵列分别基于相应的所述部分积进行错位相加得到加法结果,并将所述加法结果向对应的所述移位累加器输出;在所述乘数的所有比特位输入完毕后,多个所述移位累加器分别对相应的多个加法结果进行移位累加,得到乘法结果,并将所述乘法结果向所述错位相加器进行输出;所述错位相加器将多个所述乘法结果错位相加,得到所述高位宽乘法结果。The present invention provides a method for performing multiplication operation using the high-bit-width storage-and-calculation integrated multiplier supporting floating-point number mantissa multiplication, characterized in that it comprises the following steps: dividing a multiplier into a plurality of multiplier fragments in units of a predetermined bit width, and serially loading the plurality of multiplier fragments into the input ends of the decoding arrays of the plurality of storage-and-calculation integrated multipliers supporting floating-point number mantissa multiplication; the plurality of decoding arrays respectively perform address decoding on the multiplier fragments to obtain decoding results, and output the decoding results to the corresponding memories; the plurality of memories respectively perform address decoding on the multiplier fragments according to the decoding results The plurality of addition arrays respectively perform staggered addition based on the corresponding partial products to obtain addition results, and output the addition results to the corresponding shift accumulators; after all bits of the multiplier are input, the plurality of shift accumulators respectively perform shift accumulation on the corresponding plurality of addition results to obtain multiplication results, and output the multiplication results to the staggered adders; the staggered adders perform staggered addition on the plurality of multiplication results to obtain the high bit width multiplication result.
发明作用与效果Function and Effect of the Invention
根据本发明的支持浮点数尾数乘法的存算一体乘法器以及相应的乘法运算方法,与现有技术的存算结构相比,具有以下优势:The storage-computation integrated multiplier supporting floating-point number mantissa multiplication and the corresponding multiplication operation method according to the present invention have the following advantages compared with the storage-computation structure of the prior art:
在输入位宽方面,本发明的存算一体乘法器支持多地址输入,总输入位宽为地址数乘以地址位宽。地址位宽越高、相应配置的存储器的查找阵列越大,数据处理的速度就越快,因此,本发明的存算一体乘法器能大大提高数据处理速度。In terms of input bit width, the storage-computation integrated multiplier of the present invention supports multiple address inputs, and the total input bit width is the number of addresses multiplied by the address bit width. The higher the address bit width and the larger the search array of the corresponding memory, the faster the data processing speed. Therefore, the storage-computation integrated multiplier of the present invention can greatly improve the data processing speed.
在功耗以及运算速度方面,在硬件层面上,乘法运算的本质是部分积的错位相加,传统存算结构需要先根据动态的输入,算出单比特部分积,而后再送到后续的错位相加电路来完成累加,与之相比,本发明的存算一体乘法器则是直接读取存储器的存储阵列中存储的多比特遍历部分积编码而后进行压缩相加、错位相加,因此大大减少了部分积累加的次数,有利于降低动态功耗,提高运算速度。因此,无论是在功耗还是速度方面,本发明的存算一体乘法器都显著优于传统预存储权重的存算架构以及背景技术中所提到的存算一体结构。In terms of power consumption and computing speed, at the hardware level, the essence of multiplication is the staggered addition of partial products. The traditional storage and computing structure needs to first calculate the single-bit partial product based on the dynamic input, and then send it to the subsequent staggered addition circuit to complete the accumulation. In comparison, the storage and computing integrated multiplier of the present invention directly reads the multi-bit traversal partial product code stored in the storage array of the memory and then performs compression addition and staggered addition, thereby greatly reducing the number of partial accumulation additions, which is conducive to reducing dynamic power consumption and improving computing speed. Therefore, whether in terms of power consumption or speed, the storage and computing integrated multiplier of the present invention is significantly superior to the traditional storage and computing architecture of pre-storing weights and the storage and computing integrated structure mentioned in the background technology.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本发明实施例中存算一体乘法器的结构示意图;FIG1 is a schematic diagram of the structure of a storage-computation integrated multiplier according to an embodiment of the present invention;
图2是本发明实施例中存储器的结构示意图;FIG2 is a schematic diagram of the structure of a memory in an embodiment of the present invention;
图3是本发明实施例中利用存算一体乘法器进行乘法运算的流程图;3 is a flow chart of performing a multiplication operation using a storage-computation integrated multiplier according to an embodiment of the present invention;
图4是本发明实施例中高位宽存算一体乘法器的结构示意图;FIG4 is a schematic diagram of the structure of a high-bit-width storage-computation integrated multiplier according to an embodiment of the present invention;
图5是本发明实施例中利用高位宽存算一体乘法器进行乘法运算的流程图。FIG5 is a flow chart of performing multiplication operations using a high-bit-width storage-and-calculation integrated multiplier in an embodiment of the present invention.
附图标记:Reference numerals:
存算一体乘法器10;译码阵列11;存储器12;加法阵列13;移位累加器14;高位宽存算一体乘法器100;错位相加器20。Storage-computation integrated multiplier 10; decoding array 11; memory 12; adding array 13; shift accumulator 14; high-bit width storage-computation integrated multiplier 100; offset adder 20.
具体实施方式Detailed ways
为了使本发明实现的技术手段、创作特征、达成目的与功效易于明白了解,以下结合实施例及附图对本发明的支持浮点数尾数乘法的存算一体乘法器以及乘法运算方法作具体阐述。In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the following is a detailed description of the storage-calculation integrated multiplier supporting floating-point mantissa multiplication and the multiplication method of the present invention in combination with the embodiments and drawings.
<实施例一><Example 1>
本实施例提供一种支持浮点数尾数乘法的存算一体乘法器,用于进行浮点数的尾数的乘法运算。为更好说明该乘法器的作用,以下将先对浮点数乘法的过程进行简要说明。This embodiment provides a storage-computation integrated multiplier supporting floating-point number mantissa multiplication, which is used to perform floating-point number mantissa multiplication. To better illustrate the function of the multiplier, the floating-point number multiplication process will be briefly described below.
已知浮点数A和浮点数B,分别以SA、EA、MA代指浮点数A的符号位、指数位、尾数位(包含隐藏位“1”),分别以SB、EB、MB代指浮点数B的符号位、指数位、尾数位(包含隐藏位“1”),以ES代表浮点的指数偏移量,则对浮点数A和浮点数B进行乘法运算(即求解Y=A×B)的流程包括以下步骤:Given a floating point number A and a floating point number B, SA , EA , and MA represent the sign bit, exponent bit, and mantissa bit (including the hidden bit "1") of the floating point number A, SB , EB , and MB represent the sign bit, exponent bit, and mantissa bit (including the hidden bit "1") of the floating point number B, and ES represents the exponent offset of the floating point. The process of multiplying the floating point numbers A and B (i.e., solving Y=A×B) includes the following steps:
步骤S1,将浮点数A的符号位SA与浮点数B的符号位SB进行异或运算,即: Step S1, perform an XOR operation on the sign bit SA of the floating point number A and the sign bit SB of the floating point number B, that is:
步骤S2,将浮点数A的指数位EA与浮点数B的指数位EB相加,即:EY=EA+EB-ES。Step S2, adding the exponent bit EA of the floating point number A and the exponent bit EB of the floating point number B, that is: E Y = EA + EB - ES .
步骤S3,将浮点数A的尾数位MA与浮点数B的尾数位MB相乘,即:MY=MA×MB。Step S3, multiplying the mantissa MA of the floating point number A and the mantissa MB of the floating point number B, that is: MY = MA × MB .
步骤S4,将上述步骤的计算结果归一化成浮点格式,从而得到浮点数A和浮点数B的乘法运算结果。Step S4, normalizing the calculation results of the above steps into a floating point format, thereby obtaining a multiplication result of the floating point number A and the floating point number B.
上述四个步骤示出了浮点数的乘法运算中所涉及到的所有运算类型,其中,尾数乘法步骤S3是整个浮点数的乘法运算中耗费功耗时间面积成本最大的,本实施例的存算一体乘法器正是针对步骤S3而做出的设计优化。The above four steps illustrate all types of operations involved in the multiplication of floating-point numbers, among which the mantissa multiplication step S3 consumes the most power consumption, time and area costs in the entire floating-point multiplication operation. The storage-computation integrated multiplier of this embodiment is designed and optimized for step S3.
图1是本实施例中支持浮点数尾数乘法的存算一体乘法器的结构示意图。FIG1 is a schematic diagram of the structure of a storage-and-calculation-in-one multiplier supporting floating-point mantissa multiplication in this embodiment.
如图1所示,支持浮点数尾数乘法的存算一体乘法器10包括译码阵列11、存储器12、加法阵列13以及移位累加器14。As shown in FIG. 1 , the integrated storage and calculation multiplier 10 supporting floating-point mantissa multiplication includes a decoding array 11 , a memory 12 , an addition array 13 , and a shift accumulator 14 .
译码阵列11包含一个或多个地址译码器,为便于叙述,记作包含n个地址译码器,每个地址译码器的地址位宽为m位,n和m可以是任意非零自然数。相应地,译码阵列11具有n位输入端以及n位输出端。其输入端用于输入n个乘数片段,输出端连接至存储器12的行字线。译码阵列11用于对输入的乘数的片段进行地址译码,并将相应的译码结果输出至存储器12。The decoding array 11 includes one or more address decoders. For the convenience of description, it is recorded as including n address decoders. The address bit width of each address decoder is m bits, and n and m can be any non-zero natural numbers. Accordingly, the decoding array 11 has an n-bit input terminal and an n-bit output terminal. Its input terminal is used to input n multiplier fragments, and its output terminal is connected to the row word line of the memory 12. The decoding array 11 is used to perform address decoding on the input multiplier fragments and output the corresponding decoding results to the memory 12.
存储器12具有多位输入端(包括上述行字线)以及多位输出端,其输出端连接至加法阵列13的输入端。存储器12用于存储被乘数的部分积。The memory 12 has a multi-bit input terminal (including the above-mentioned row word line) and a multi-bit output terminal, and the output terminal is connected to the input terminal of the addition array 13. The memory 12 is used to store the partial product of the multiplicand.
图2是本实施例中存储器的结构示意图。FIG. 2 is a schematic diagram of the structure of the memory in this embodiment.
如图2所示,本实施例的存储器12包括多个存储单元121、位线选通器122、位线BL[1]至BL[n],每条位线上连接k个存储单元121,形成k行n列存储阵列。位线均连接至位线选通器122,位线选通器122的输入线SEL连接至译码阵列11的输出端,位线选通器122根据来自译码阵列11的译码结果选通相应的位线。As shown in FIG2 , the memory 12 of this embodiment includes a plurality of storage units 121, a bit line selector 122, and bit lines BL[1] to BL[n]. Each bit line is connected to k storage units 121 to form a k-row n-column storage array. The bit lines are all connected to the bit line selector 122, and the input line SEL of the bit line selector 122 is connected to the output end of the decoding array 11. The bit line selector 122 selects the corresponding bit line according to the decoding result from the decoding array 11.
加法阵列13具有多位输入端以及多位输出端,其输出端连接至移位累加器14的输入端。加法阵列13用于将输入的多个加数相加得到一个相加结果的数。The addition array 13 has a multi-bit input terminal and a multi-bit output terminal, and the output terminal is connected to the input terminal of the shift accumulator 14. The addition array 13 is used to add a plurality of input addends to obtain an addition result number.
移位累加器14具有多位输入端以及多位输出端,其输出端用于输出乘法结果。移位累加器14用于对依次输入的多个数进行加权后再进行累加。The shift accumulator 14 has a multi-bit input terminal and a multi-bit output terminal, and its output terminal is used to output the multiplication result. The shift accumulator 14 is used to weight a plurality of numbers input in sequence and then accumulate them.
在进行乘法运算时,被乘数以部分积的形式配置在存储器12内,部分积具体为被乘数的m bit部分积,即被乘数与所有可能的m bit数的遍历乘法结果;乘数则以特定位宽为单位划分成多个乘数片段,以片段为单位串行地加载到译码阵列11的输入端,直到完成一个完整乘数的输入。When performing a multiplication operation, the multiplicand is configured in the memory 12 in the form of a partial product, and the partial product is specifically the m-bit partial product of the multiplicand, that is, the ergodic multiplication result of the multiplicand and all possible m-bit numbers; the multiplier is divided into multiple multiplier fragments in units of a specific bit width, and is serially loaded into the input end of the decoding array 11 in units of fragments until the input of a complete multiplier is completed.
译码阵列11对输入的n个乘数片段进行地址译码,并将相应的译码结果输出至存储器12,以选通n个存储器行。The decoding array 11 performs address decoding on the input n multiplier fragments, and outputs the corresponding decoding results to the memory 12 to select n memory rows.
存储器12将n个选通的存储器行中的数作为n个加数输出至加法阵列13。The memory 12 outputs the numbers in the n selected memory rows to the addition array 13 as n addends.
加法阵列13将n个加数进行错位相加,输出加法结果。根据乘数片段的数量,加法阵列13将按照时钟周期依次输出多个加法结果。The addition array 13 performs staggered addition on the n addends and outputs the addition result. According to the number of multiplier segments, the addition array 13 outputs multiple addition results in sequence according to the clock cycle.
移位累加器14将来自加法阵列13的多个和数进行加权后再累加,输出乘法结果数。The shift accumulator 14 weights and accumulates the multiple sums from the addition array 13 and outputs a multiplication result.
以下将示例性地具体示出利用上述存算一体乘法器10进行乘法运算的流程。The following will exemplarily illustrate the process of performing multiplication operations using the above-mentioned storage-calculation multiplier 10.
在该示例性的乘法运算中,乘数为IN,被乘数为W,IN和W都是8bit原码整型,上述n=2,m=2。译码阵列11包含两个2-4地址译码器。存储器12具有4行10列存储单元121,并且支持两个查找地址同时查找。In this exemplary multiplication operation, the multiplier is IN, the multiplicand is W, both IN and W are 8-bit original integers, and n=2, m=2. The decoding array 11 includes two 2-4 address decoders. The memory 12 has 4 rows and 10 columns of storage units 121, and supports simultaneous search of two search addresses.
在开始乘法运算之前,需要先计算被乘数W的部分积,具体地,计算2bit索引与被乘数W的乘法的结果,即将2’d0、2’d1、2’d2、2’d3分别与W进行相乘,得到W的2bit部分积PP[0]、PP[1]、PP[2]、PP[3],其中,每个部分积都是10bit。Before starting the multiplication operation, it is necessary to calculate the partial products of the multiplicand W. Specifically, calculate the result of the multiplication of the 2-bit index and the multiplicand W, that is, multiply 2’d0, 2’d1, 2’d2, and 2’d3 by W respectively to obtain the 2-bit partial products PP[0], PP[1], PP[2], and PP[3] of W, where each partial product is 10 bits.
然后,将计算出的部分积以查找表的形式存储在存储器12内,具体地,将上述四个部分积以索引值为行地址按行存储在存储器12内。之后,就可以输入乘数IN,开始进行乘法运算。Then, the calculated partial products are stored in the memory 12 in the form of a lookup table. Specifically, the four partial products are stored row by row in the memory 12 with the index value as the row address. After that, the multiplier IN can be input to start the multiplication operation.
图3是本实施例中利用存算一体乘法器进行乘法运算的流程图。FIG3 is a flow chart of performing multiplication operations using the integrated storage and calculation multiplier in this embodiment.
如图3所示,该乘法运算可分解为以下步骤:As shown in Figure 3, the multiplication operation can be decomposed into the following steps:
步骤S1-1,在第一个时钟周期,向译码阵列11输入乘数片段IN[1:0]、IN[3:2],译码阵列11向存储器12输出相应的译码结果。Step S1 - 1 , in the first clock cycle, the multiplier fragments IN[1:0] and IN[3:2] are input to the decoding array 11 , and the decoding array 11 outputs the corresponding decoding results to the memory 12 .
步骤S1-2,存储器12基于译码结果,查找出被乘数W的两个部分积PP[IN[1:0]]、PP[IN[3:2]],并向加法阵列13输出两个部分积。In step S1 - 2 , the memory 12 finds out the two partial products PP[IN[1:0]] and PP[IN[3:2]] of the multiplicand W based on the decoding result, and outputs the two partial products to the addition array 13 .
步骤S1-3,加法阵列13基于两个部分积进行加法运算,得到加法结果adder_outclk1=PP[IN[1:0]]+22*PP[IN[3:2]],并向移位累加器14输出加法结果。Step S1 - 3 : the adder array 13 performs an addition operation based on the two partial products to obtain an addition result adder_out clk1 =PP[IN[1:0]]+2 2 *PP[IN[3:2]], and outputs the addition result to the shift accumulator 14 .
步骤S1-4,在第二个时钟周期,向译码阵列11输入乘数片段IN[5:4]、IN[7:6],译码阵列11向存储器12输出相应的译码结果。Step S1 - 4 , in the second clock cycle, the multiplier segments IN[5:4] and IN[7:6] are input to the decoding array 11 , and the decoding array 11 outputs the corresponding decoding results to the memory 12 .
步骤S1-5,存储器12基于译码结果,查找出被乘数W的两个部分积PP[IN[5:4]]、PP[IN[7:6]],并向加法阵列13输出两个部分积。In step S1 - 5 , the memory 12 finds out the two partial products PP[IN[5:4]] and PP[IN[7:6]] of the multiplicand W based on the decoding result, and outputs the two partial products to the addition array 13 .
步骤S1-6,加法阵列13基于两个部分积进行错位相加,得到加法结果adder_outclk2=PP[IN[5:4]]+22*PP[IN[7:6],并向移位累加器14输出加法结果。In step S1 - 6 , the addition array 13 performs shifted addition based on the two partial products to obtain an addition result adder_out clk2 =PP[IN[5:4]]+2 2 *PP[IN[7:6]], and outputs the addition result to the shift accumulator 14 .
步骤S1-7,移位累加器14对两个时钟周期的加法结果进行加权后再进行累加,得到乘法结果Step S1-7, the shift accumulator 14 weights the addition results of the two clock cycles and then accumulates them to obtain the multiplication result.
OUT=adder_outclk1+24*adder_outclk2=IN*W,并将乘法结果进行输出。OUT = adder_out clk1 + 2 4 * adder_out clk2 = IN*W, and the multiplication result is output.
实施例一作用与效果Example 1 Function and Effect
根据本实施例提供的支持浮点数尾数乘法的存算一体乘法器10,与现有技术的存算结构相比,具有以下优势:The storage-computation integrated multiplier 10 supporting floating-point mantissa multiplication provided in this embodiment has the following advantages compared with the storage-computation structure in the prior art:
在输入位宽方面,本实施例的存算一体乘法器10支持多地址输入,总输入位宽为地址数乘以地址位宽,即:m*n。地址位宽越高、相应配置的存储器的查找阵列越大,数据处理的速度就越快,例如对于具有8bit尾数的高精度浮点数BFP16,可以将译码阵列11配置成m=4,n=2,将存储器12配置成具有16行12列存储单元,这样一来,一节拍即可输入一个BFP16浮点数,这是基于预存储权重原理的传统存算架构所不能达到的。In terms of input bit width, the storage-computation integrated multiplier 10 of this embodiment supports multi-address input, and the total input bit width is the number of addresses multiplied by the address bit width, that is, m*n. The higher the address bit width and the larger the search array of the corresponding configured memory, the faster the data processing speed. For example, for a high-precision floating point number BFP16 with an 8-bit mantissa, the decoding array 11 can be configured to m=4, n=2, and the memory 12 can be configured to have 16 rows and 12 columns of storage units. In this way, one BFP16 floating point number can be input in one beat, which is not achievable by the traditional storage-computation architecture based on the principle of pre-storage weights.
在功耗以及运算速度方面,在硬件层面上,乘法运算的本质是部分积的错位相加,传统存算结构需要先根据动态的输入,算出单比特部分积,而后再送到后续的错位相加电路来完成累加,与之相比,本实施例的存算一体乘法器10则是直接读取存储器12的存储阵列中存储的多比特遍历部分积编码而后进行压缩相加、错位相加,因此大大减少了部分积累加的次数,有利于降低动态功耗,提高运算速度。因此,无论是在功耗还是速度方面,本实施例的存算一体乘法器10都显著优于传统预存储权重的存算架构以及背景技术中所提到的存算一体结构。In terms of power consumption and computing speed, at the hardware level, the essence of multiplication is the staggered addition of partial products. The traditional storage and computing structure needs to first calculate the single-bit partial product based on the dynamic input, and then send it to the subsequent staggered addition circuit to complete the accumulation. In comparison, the storage and computing integrated multiplier 10 of this embodiment directly reads the multi-bit traversal partial product code stored in the storage array of the memory 12 and then performs compression addition and staggered addition, thereby greatly reducing the number of partial accumulation additions, which is conducive to reducing dynamic power consumption and improving computing speed. Therefore, whether in terms of power consumption or speed, the storage and computing integrated multiplier 10 of this embodiment is significantly superior to the traditional storage and computing architecture of pre-storing weights and the storage and computing integrated structure mentioned in the background technology.
<实施例二><Example 2>
基于实施例一提供的支持浮点数尾数乘法的存算一体乘法器,本实施例提供一种支持浮点数尾数乘法的高位宽存算一体乘法器。Based on the storage-calculation integrated multiplier supporting floating-point mantissa multiplication provided in the first embodiment, this embodiment provides a high-bit-width storage-calculation integrated multiplier supporting floating-point mantissa multiplication.
图4是本实施例中高位宽存算一体乘法器的结构示意图。FIG4 is a schematic diagram of the structure of a high-bit-width storage-computation integrated multiplier in this embodiment.
如图4所示,高位宽存算一体乘法器100包含多个实施例一的存算一体乘法器10以及错位相加器20。为便于叙述,将存算一体乘法器10记作q个,q是任意大于1的自然数,将q个存算一体乘法器10分别记作INST[1]至INST[q],将其存储器12分别记作MEM[1]至MEM[q]。As shown in Fig. 4, the high-bit-width storage-computation integrated multiplier 100 includes a plurality of storage-computation integrated multipliers 10 and a staggered adder 20 of the first embodiment. For ease of description, the storage-computation integrated multipliers 10 are recorded as q, where q is any natural number greater than 1, and the q storage-computation integrated multipliers 10 are recorded as INST[1] to INST[q], respectively, and their memories 12 are recorded as MEM[1] to MEM[q], respectively.
q个存算一体乘法器10的输入来自相同的乘数片段,其输出端依次连接至错位相加器20的多个输入端,存算一体乘法器10将其乘法结果输出至错位相加器20。The inputs of the q integrated storage-computation multipliers 10 come from the same multiplier fragment, and their output ends are sequentially connected to multiple input ends of the offset adder 20 , and the integrated storage-computation multipliers 10 output their multiplication results to the offset adder 20 .
错位相加器20将来自不同存算一体乘法器10的乘法结果按不同的权重段移位相加,输出一个高位宽乘法结果。The offset adder 20 shifts and adds the multiplication results from different integrated storage and calculation multipliers 10 according to different weight segments, and outputs a high-bitwidth multiplication result.
以下将示例性地具体示出利用上述高位宽存算一体乘法器100进行乘法运算的流程。The following will exemplarily illustrate the process of performing multiplication operations using the high-bit-width integrated storage and calculation multiplier 100 described above.
在该示例性的乘法运算中,乘数IN和被乘数W都是16bit原码整型,n=2,m=2,q=2,也即高位宽存算一体乘法器100包含两个存算一体乘法器10。In this exemplary multiplication operation, the multiplier IN and the multiplicand W are both 16-bit original code integers, n=2, m=2, q=2, that is, the high-bit-width storage-and-calculation multiplier 100 includes two storage-and-calculation multipliers 10.
同样地,在进行乘法运算前,需要先计算被乘数W的部分积,具体地,计算任意2bit索引与W的乘法结果,即将2’d0、2’d1、2’d2、2’d3分别与W相乘,得到W的2bit部分积PP[0]、PP[1]、PP[2]、PP[3],其中,每个部分积都是18bit。Similarly, before performing a multiplication operation, it is necessary to calculate the partial products of the multiplicand W. Specifically, calculate the multiplication result of any 2-bit index and W, that is, multiply 2’d0, 2’d1, 2’d2, 2’d3 by W respectively to obtain the 2-bit partial products PP[0], PP[1], PP[2], PP[3] of W, where each partial product is 18 bits.
然后,将计算出的部分积以查找表的形式存储在存储器12内,具体地,将上述四个部分积的高9bit(即PP[x][17:9])以索引值为行地址按行存储在存储器MEM[1]内,并将上述四个部分积的低9bit(即PP[x][8:0])以索引值为行地址按行存储在存储器MEM[2]内。之后,就可以输入乘数IN,开始进行乘法运算。Then, the calculated partial products are stored in the memory 12 in the form of a lookup table. Specifically, the upper 9 bits (i.e., PP[x][17:9]) of the above four partial products are stored in the memory MEM[1] by row with the index value as the row address, and the lower 9 bits (i.e., PP[x][8:0]) of the above four partial products are stored in the memory MEM[2] by row with the index value as the row address. After that, the multiplier IN can be input to start the multiplication operation.
图5是本实施例中利用高位宽存算一体乘法器进行乘法运算的流程图。FIG5 is a flow chart of performing multiplication operations using a high-bit-width integrated storage and calculation multiplier in this embodiment.
如图5所示,该乘法运算可分解为以下步骤:As shown in Figure 5, the multiplication operation can be decomposed into the following steps:
步骤S2-1,在第一个时钟周期,向两个译码阵列11分别输入乘数片段IN[1:0]、IN[3:2],两个译码阵列11分别向对应的存储器MEM[1]、MEM[2]输出相应的译码结果。Step S2-1, in the first clock cycle, the multiplier fragments IN[1:0] and IN[3:2] are respectively input to the two decoding arrays 11, and the two decoding arrays 11 output corresponding decoding results to the corresponding memories MEM[1] and MEM[2].
步骤S2-2,存储器MEM[1]基于相应的译码结果,查找出被乘数W的两个部分积INST[1]:PPMEM[1][IN[1:0]]、PPMEM[1][IN[3:2]]并向相应的加法阵列13输出;Step S2-2, based on the corresponding decoding result, the memory MEM[1] finds out two partial products INST[1] of the multiplicand W: PP MEM[1] [IN[1:0]], PP MEM[1] [IN[3:2]] and outputs them to the corresponding addition array 13;
存储器MEM[2]基于相应的译码结果,查找出被乘数W的两个部分积INST[2]:PPMEM[2][IN[1:0]]、PPMEM[2][IN[3:2]],并向相应的加法阵列13输出。Based on the corresponding decoding result, the memory MEM[2] finds out the two partial products INST[2] of the multiplicand W: PP MEM[2] [IN[1:0]], PP MEM[2] [IN[3:2]], and outputs them to the corresponding addition array 13.
步骤S2-3,存算一体乘法器INST[1]的加法阵列13分别基于对应的两个部分积进行错位相加运算,得到加法结果adder_outclk1=PPMEM[1][IN[1:0]]+22*PPMEM[1][IN[3:2]],并向对应的移位累加器14输出;Step S2-3, the adder array 13 of the integrated storage and calculation multiplier INST[1] performs a shifted addition operation based on the two corresponding partial products to obtain an addition result adder_out clk1 =PP MEM[1] [IN[1:0]] + 2 2 *PP MEM[1] [IN[3:2]], and outputs it to the corresponding shift accumulator 14;
存算一体乘法器INST[2]的加法阵列13分别基于对应的两个部分积进行错位相加运算,得到加法结果adder_outclk1=PPMEM[2][IN[1:0]]+22*PPMEM[2][IN[3:2]],并向对应的移位累加器14输出。The adder array 13 of the integrated storage-calculation multiplier INST[2] performs shifted addition operations based on the two corresponding partial products to obtain an addition result adder_out clk1 =PP MEM[2] [IN[1:0]]+2 2 *PP MEM[2] [IN[3:2]], and outputs it to the corresponding shift accumulator 14 .
步骤S2-4,在第二个时钟周期,向两个译码阵列11输入乘数片段IN[5:4]、IN[7:6],两个译码阵列11分别向对应的存储器MEM[1]、MEM[2]输出相应的译码结果。Step S2-4, in the second clock cycle, the multiplier segments IN[5:4] and IN[7:6] are input to the two decoding arrays 11, and the two decoding arrays 11 output corresponding decoding results to the corresponding memories MEM[1] and MEM[2] respectively.
步骤S2-5,存储器MEM[1]基于相应的译码结果,查找出被乘数W的两个部分积INST[1]:PPMEM[1][IN[5:4]]、PPMEM[1][IN[7:6]]并向相应的加法阵列13输出;Step S2-5, based on the corresponding decoding result, the memory MEM[1] finds out the two partial products INST[1] of the multiplicand W: PP MEM[1] [IN[5:4]], PP MEM[1] [IN[7:6]] and outputs them to the corresponding addition array 13;
存储器MEM[2]基于相应的译码结果,查找出被乘数W的两个部分积INST[2]:PPMEM[2][IN[5:4]]、PPMEM[2][IN[7:6]],并向相应的加法阵列13输出。Based on the corresponding decoding result, the memory MEM[2] finds out the two partial products INST[2] of the multiplicand W: PP MEM[2] [IN[5:4]], PP MEM[2] [IN[7:6]], and outputs them to the corresponding addition array 13.
步骤S2-6,存算一体乘法器INST[1]的加法阵列13分别基于对应的两个部分积进行错位相加运算,得到加法结果adder_outclk2=PPMEM[1][IN[5:4]]+22*PPMEM[1][IN[7:6]],并向对应的移位累加器14输出;Step S2-6, the adder array 13 of the integrated storage and calculation multiplier INST[1] performs a shifted addition operation based on the two corresponding partial products to obtain an addition result adder_out clk2 =PP MEM[1] [IN[5:4]] + 2 2 *PP MEM[1] [IN[7:6]], and outputs it to the corresponding shift accumulator 14;
存算一体乘法器INST[2]的加法阵列13分别基于对应的两个部分积进行错位相加运算,得到加法结果adder_outclk2=PPMEM[2][IN[5:4]]+22*PPMEM[2][IN[7:6]],并向对应的移位累加器14输出。The adder array 13 of the integrated storage-calculation multiplier INST[2] performs shifted addition operations based on the two corresponding partial products to obtain an addition result adder_out clk2 =PP MEM[2] [IN[5:4]]+2 2 *PP MEM[2] [IN[7:6]], and outputs it to the corresponding shift accumulator 14 .
在步骤S2-6之后,省略了若干步骤,参照步骤S2-1至步骤S2-6,以此类推,直到将乘数IN的所有比特位都输入完毕,进入步骤S2-7。After step S2-6, several steps are omitted, referring to step S2-1 to step S2-6, and so on, until all bits of the multiplier IN are input, and then the process proceeds to step S2-7.
步骤S2-7,两个移位累加器14分别对多个时钟周期的相应的加法结果进行加权后再进行累加,得到乘法结果,并将乘法结果向错位相加器20进行输出。Step S2 - 7 , the two shift accumulators 14 respectively weight the corresponding addition results of multiple clock cycles and then accumulate them to obtain multiplication results, and output the multiplication results to the shift adder 20 .
步骤S2-8,错位相加器20将多个乘法结果按不同权重段移位相加,得到高位宽乘法结果OUT=shift_out[1]*29+shift_out[2]=IN*W。Step S2-8: the shift adder 20 shifts and adds the multiple multiplication results according to different weight segments to obtain a high-bit-width multiplication result OUT=shift_out[1]*2 9 +shift_out[2]=IN*W.
实施例二作用与效果Example 2 Function and Effect
根据本实施例提供的支持浮点数尾数乘法的高位宽存算一体乘法器100,由于包含多个存算一体乘法器10以及错位相加器20,因此在实施例一的作用与效果的基础上,能够实现更高位宽的乘法运算,并且该结构采用模块化的设计,易于扩展,可方便地扩展至各种所需位宽。According to the high-bit-width storage-and-calculation multiplier 100 supporting floating-point mantissa multiplication provided in this embodiment, since it includes multiple storage-and-calculation multipliers 10 and staggered adders 20, it can implement multiplication operations with higher bit widths based on the functions and effects of the first embodiment, and the structure adopts a modular design, which is easy to expand and can be conveniently expanded to various required bit widths.
上述实施例仅用于举例说明本发明的具体实施方式,而本发明不限于上述实施例的描述范围,本行业的技术人员应该了解,本发明不受上述实施例的限制,上述实施例和说明书中描述的只是说明本发明的原理,在不脱离本发明精神和范围的前提下,本发明还会有各种变化和改进,这些变化和改进都落入要求保护的本发明范围内。本发明要求保护范围由所附的权利要求书及其等效物界定。The above embodiments are only used to illustrate the specific implementation of the present invention, and the present invention is not limited to the description scope of the above embodiments. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only to illustrate the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
例如,在上述实施例中,存算一体乘法器包括移位累加器,而对于位宽较少的乘数来说,只需要查找一次存储器,然后通过加法阵列进行相加就可得出乘法结果,因此对于仅处理位宽较少的乘数的情况,存算一体乘法器也可以不具有移位累加器。For example, in the above embodiment, the storage-computation multiplier includes a shift accumulator. For a multiplier with a smaller bit width, it is only necessary to search the memory once, and then add the multiplication result through the addition array. Therefore, for the case of only processing multipliers with a smaller bit width, the storage-computation multiplier may not have a shift accumulator.
Claims (7)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410142246.6A CN118092855A (en) | 2024-02-01 | 2024-02-01 | Integrated storage and calculation multiplier supporting floating-point number mantissa multiplication and multiplication operation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410142246.6A CN118092855A (en) | 2024-02-01 | 2024-02-01 | Integrated storage and calculation multiplier supporting floating-point number mantissa multiplication and multiplication operation method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118092855A true CN118092855A (en) | 2024-05-28 |
Family
ID=91148527
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410142246.6A Pending CN118092855A (en) | 2024-02-01 | 2024-02-01 | Integrated storage and calculation multiplier supporting floating-point number mantissa multiplication and multiplication operation method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118092855A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119322910A (en) * | 2024-08-06 | 2025-01-17 | 南京大学 | Maxout activation function operation accelerating device and method based on memory integrated device |
| WO2026108885A1 (en) * | 2024-11-20 | 2026-05-28 | 电子科技大学 | High-speed matrix computation circuit |
-
2024
- 2024-02-01 CN CN202410142246.6A patent/CN118092855A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119322910A (en) * | 2024-08-06 | 2025-01-17 | 南京大学 | Maxout activation function operation accelerating device and method based on memory integrated device |
| CN119322910B (en) * | 2024-08-06 | 2025-11-11 | 南京大学 | Maxout activation function operation accelerating device and method based on memory integrated device |
| WO2026108885A1 (en) * | 2024-11-20 | 2026-05-28 | 电子科技大学 | High-speed matrix computation circuit |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Bavikadi et al. | A review of in-memory computing architectures for machine learning applications | |
| KR102780371B1 (en) | Method for performing PIM (PROCESSING-IN-MEMORY) operations on serially allocated data, and related memory devices and systems | |
| KR102780370B1 (en) | Method for performing PIM (PROCESSING-IN-MEMORY) operations, and related memory devices and systems | |
| CN112711394A (en) | Circuit based on digital domain memory computing | |
| CN110442323B (en) | Device and method for performing floating point number or fixed point number multiply-add operation | |
| Ding et al. | HAIMA: A hybrid SRAM and DRAM accelerator-in-memory architecture for transformer | |
| Roohi et al. | Processing-in-memory acceleration of convolutional neural networks for energy-effciency, and power-intermittency resilience | |
| TW202203053A (en) | Memory circuit and operating method thereof | |
| Angizi et al. | Parapim: a parallel processing-in-memory accelerator for binary-weight deep neural networks | |
| CN119831067B (en) | Quantum error mitigation acceleration method and accelerator exploiting sparsity in tensor products | |
| Tsai et al. | RePIM: Joint exploitation of activation and weight repetitions for in-ReRAM DNN acceleration | |
| Yang et al. | A parallel processing CNN accelerator on embedded devices based on optimized MobileNet | |
| Srinivasa et al. | Trends and opportunities for SRAM based in-memory and near-memory computation | |
| CN118245431A (en) | A storage and calculation integrated circuit with configurable logic operation based on SRAM | |
| CN115495152A (en) | Memory computing circuit with variable length input | |
| US20230376273A1 (en) | Booth multiplier for compute-in-memory | |
| US20230161556A1 (en) | Memory device and operation method thereof | |
| Zou et al. | An efficient and precision-reconfigurable digital CIM macro for DNN accelerators | |
| Yu et al. | Dcirom: A fully digital compute-in-rom design approach to high energy efficiency of dnn inference at task level | |
| Xia et al. | Reconfigurable spatial-parallel stochastic computing for accelerating sparse convolutional neural networks | |
| Sonnino et al. | DAISM: Digital approximate in-SRAM multiplier-based accelerator for DNN training and inference | |
| CN116522967A (en) | Multipliers and Chips | |
| CN116543808A (en) | All-digital domain in-memory approximate calculation circuit based on SRAM unit | |
| Karamuftuoglu et al. | Optimized bistable vortex memory arrays for superconducting in-memory matrix-vector multiplication | |
| Qiu et al. | DCIM-GCN: Digital computing-in-memory to efficiently accelerate graph convolutional networks |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |