Floating point type multiply-accumulate fast operation circuit based on SRAM and chip thereof

By designing a fast floating-point multiplication accumulation calculation circuit based on SRAM in CIM circuit, using parallel processing and pipeline strategies, the problem of low floating-point data computing efficiency in the existing technology is solved, and efficient floating-point data multiplication is achieved Accumulation operation.

CN119002859AActive Publication Date: 2024-11-22ANHUI UNIV

Patent Information

Application Number
CN202411116710.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-22
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

The existing CIM circuits are less efficient when performing floating-point data operations, and require multiple cycles to complete multiplication and accumulation operations, resulting in slower speed.

Method used

Design a floating-point multiplication and accumulation fast calculation circuit based on SRAM. By dividing the SRAM array into exponential and arrays, weight exponential arrays and weight mantissa arrays by columns, and adopting pipeline strategy, using exponential input modules, mantissa input modules, and addition The device array, maximum value search module, subtraction counter, shift register and standardization module are processed in parallel to realize the multiplication and accumulation operation between multi-bit floating-point operands and weights.

Benefits of technology

Complete the multiplication and accumulation operation task within at most two cycles, shortening the operation time, reducing time, area and power consumption overhead, and improving the MAC in-memory computing efficiency of floating-point data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119002859A_ABST
    Figure CN119002859A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of integrated circuits, and particularly relates to a floating point type multiply-accumulate fast operation circuit based on an SRAM (Static Random Access Memory) and a chip thereof. The circuit is designed based on an SRAM array and a peripheral circuit thereof, and the SRAM array is divided into an index sum array, a weight index array and a weight mantissa array according to columns. On the basis of the divided SRAM array, the floating point type multiply-accumulate fast operation circuit further comprises an index input module, a mantissa input module, an adder array, a maximum value searching module, a subtraction counter, a shift register, an adder tree and a standardization module. According to the method, a brand-new mantissa alignment floating point calculation process of high-bandwidth asynchronous index standardization and instruction parallel sorting is adopted, the maximum value can be found in parallel while indexes are added, and subtraction shift in mantissa alignment is replaced in a time period finding mode; and therefore, the MAC in-memory calculation of the floating point type data is realized under the lower time, area and power consumption overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of integrated circuits, and in particular relates to a floating-point multiplication-accumulation fast operation circuit based on SRAM and a CIM chip using the circuit. Background Art

[0002] In recent years, with the breakthrough of key technologies such as big data and artificial intelligence (AI), emerging intelligent applications represented by edge computing and smart life have emerged in the rapidly developing trend of the times. These emerging intelligent applications often need to frequently access memory when processing events. However, the von Neumann architecture is the most commonly used data processing architecture, which is achieved by separating memory and computing units. At first, the computing unit and the storage unit developed synchronously, which means that the storage speed of the memory and the computing speed of the operator are consistent. However, as semiconductor technology continues to develop in accordance with "Moore's Law", the computing unit develops in the direction of speed, while the storage continues to develop in terms of integration, which results in the storage speed of the memory being unable to match the computing speed of the computing unit, which is commonly known as the "storage wall" barrier.

[0003] Research shows that the time and power consumption required to access data are much greater than the time and power consumption required for computing, and this difference will become more obvious as technology continues to advance. How to achieve efficient and low-overhead computing on devices with limited resources is the future development direction. In response to this situation, technicians have proposed a memory-based computing-in-memory (CIM) architecture. This new computer architecture directly uses memory to implement logical operations, without the need to move data between memory and processor, thus greatly improving data processing efficiency and reducing device operating power consumption.

[0004] With the development of deep learning algorithms, the scale and complexity of neural networks continue to increase. This large-scale neural network model has now been widely used in computer vision, natural language processing, and recommendation systems, and its diverse application scenarios reflect its unique importance. Traditional integer neural networks are inherently at a disadvantage in large-scale model calculations due to problems such as too small a range of representation data and low calculation accuracy. Floating-point neural networks solve this problem well. With a higher numerical representation range and calculation accuracy, floating-point neural networks are more suitable for use in large-scale neural network models.

[0005] Data processing based on deep learning algorithms includes a large number of multiply-accumulate (MAC) tasks. Existing CIM circuits with MAC functions based on SRAM are highly efficient in integer operations. However, when performing floating-point data operations, traditional CIM circuits need to implement multiple consecutive steps such as "exponent addition, mantissa multiplication, exponent alignment, mantissa shifting, and data synthesis" respectively. This means that the circuit often needs to use multiple cycles to obtain the final multiply-accumulate operation result, which greatly reduces the efficiency of the circuit in performing multiply-accumulate operations on floating-point data. Summary of the invention

[0006] In order to solve the problem of low efficiency and slow speed of existing CIM circuits in processing floating-point data multiplication and accumulation operations, the present invention provides a floating-point multiplication and accumulation fast operation circuit based on SRAM and a CIM chip using the circuit.

[0007] The technical solution provided by the present invention is:

[0008] A floating-point multiplication-accumulation fast operation circuit based on SRAM is designed based on an SRAM array and its peripheral circuits, and is used to implement multiplication-accumulation operations between multiple groups of multi-bit floating-point operands and multi-bit floating-point weights. In the solution of the present invention, the SRAM array in the floating-point multiplication-accumulation fast operation circuit is divided into three parts by column, namely, an exponent sum array, a weight exponent array, and a weight mantissa array.

[0009] Based on the divided SRAM array, the floating-point multiplication and accumulation fast operation circuit also includes: an exponent input module, a mantissa input module, an adder array, a maximum value search module, a subtraction counter, a shift register, an adder tree and a standardization module.

[0010] Among them, each row of the weight exponent array is used to pre-store the exponent part of the weight bit by bit. The exponent input module is used to input the exponent part of the operand to each row in the adder array. The adder array is used to read the storage value of the weight exponent array and calculate the exponent sum of the weight and the operand. Each row in the weight mantissa array is used to pre-store the mantissa part of the weight bit by bit. The mantissa input module is used to input the mantissa part of the operand to each row in the weight mantissa array. Each row in the weight mantissa array is used to pre-store the mantissa part of the weight bit by bit, and uses its own logical operation function to perform multiplication operation on the mantissa part of the weight and the operand to obtain the mantissa product.

[0011] The maximum value search module is used to first obtain the calculation results of the exponent sum of each row output by the adder array, and determine the maximum exponent while writing the exponent sum back to the exponent sum array bit by bit. Then, the subtraction counter and the exponent sum array are combined to determine the number of bits difference between the exponent sum calculated in each row and the maximum exponent, and the shift register shifts the mantissa product calculated in the corresponding row according to the number of bits difference.

[0012] The adder tree is used to add the mantissa products of each row after the shift is completed to obtain the mantissa sum; finally, the normalization module generates the corresponding multiplication and accumulation operation result according to the maximum exponent and the mantissa sum.

[0013] The SRAM-based floating-point multiplication and accumulation fast operation circuit provided by the present invention adopts a pipeline strategy to complete the multiplication and accumulation operation task of floating-point numbers in practical applications. The process is as follows:

[0014] S1: Initial stage:

[0015] In the first cycle, the exponential input module, the weight exponential array and the adder array are used to complete the input and addition of the exponential parts of each operand and weight in the first round of operation tasks to obtain the exponential sum.

[0016] The maximum value search module reads the exponents and calculation results of each row in the adder array bit by bit in order from low to high.

[0017] S2: Operation phase:

[0018] In the second cycle, the mantissa input module and the weight mantissa array are used to complete the input and multiplication of the mantissa parts of each operand and weight in the first round of calculation tasks to obtain each mantissa product.

[0019] The maximum value search module writes the calculated result of the read exponent sum back to the exponent sum array, and determines the maximum exponent while writing back. Then, the maximum exponent is decremented by the subtraction counter and compared with each exponent sum in the exponent sum array, and after each comparison, the shift register is used to shift the corresponding mantissa product of the exponent sum that is less than the maximum exponent.

[0020] Then, the adder tree adds the mantissa products of each row after shifting to obtain the mantissa sum. Finally, the normalization module generates the corresponding multiplication and accumulation operation result according to the determined maximum exponent and mantissa sum.

[0021] At the same time, in the second cycle, the exponential operation array is also used to complete the input and addition of the exponential parts of each operand and weight in the second round of operation tasks, and the maximum value search module reads the calculation results of the exponential sum of each row in the adder array bit by bit in order from low to high.

[0022] S3: Cycle phase:

[0023] According to the same logic, in each subsequent cycle, the multiplication and accumulation results of the previous round are calculated and output, and the addition and caching of the exponential part in the back shift round operation are completed;

[0024] By analogy, the processing and output of the N-1th round of multiplication and accumulation operations can be achieved in the Nth cycle.

[0025] As a further improvement of the present invention, the maximum value search module includes a plurality of ping-pong units and a plurality of comparison units corresponding to the number of rows of the SRAM array; each ping-pong unit includes a register one and a register two.

[0026] In the previous cycle, the ping-pong unit is used to read the exponential sum calculated by the adder array in order from low to high and store it in register one; and write each bit of data in register one to register two bit by bit, and the data written into register two is restored to the exponential sum arranged from high to low.

[0027] In the next cycle, the ping-pong unit writes the data in register 2 back to the corresponding row in the index and array, and synchronously determines the maximum index during the write-back process. At the same time, the ping-pong unit also performs the index and read in the next round of calculation and updates register 1.

[0028] The comparison unit is used to compare the exponents of each row after writing back with the operation result to determine the maximum exponent.

[0029] As a further improvement of the present invention, the method for determining the maximum exponent in the process of writing back the exponent sum of each row by the maximum value finding module is:

[0030] (1) The exponent sum calculated by the adder array is written bit by bit from register 2 to the exponent sum array in order from high to low.

[0031] (2) When writing each bit of the exponent sum, determine the current value and make the following decisions:

[0032] A. If the value of the current bit of the sum of the exponents in different rows includes both 1 and 0, the number with the current bit being 1 is retained and the number with the current bit being 0 is removed.

[0033] B. If the values ​​of the current bits of the exponents and in different rows are both 1 or 0, the numbers on all rows are retained.

[0034] (3) If only one number remains or the lowest bit of the sum of the exponents has been written, the number that remains is the maximum exponent.

[0035] As a further improvement of the present invention, the exponent sum array, the subtraction counter and the shift register implement the operation strategy of shifting the mantissa product according to the maximum exponent output by the maximum value finding module as follows:

[0036] The subtraction counter decrements the maximum exponent by 1 in each cycle and sends it to the exponent sum array.

[0037] The index and array matches the maximum index at the current moment with the index and index stored in itself in each cycle. If the match is successful, a corresponding pairing flag is generated and sent to the shift register.

[0038] The shift register is used to shift the exponent and the corresponding mantissa product of each row in each cycle, and when any pairing flag is received in each cycle, the shift operation of the mantissa product of the corresponding row is stopped.

[0039] When the preset maximum number of cycles is reached, the shifting of all mantissa products is completed.

[0040] As a further improvement of the present invention, the weight mantissa array is composed of multiple 8T-SRAM units; each 8T-SRAM unit includes 2 PMOS tubes P1-P2 and 6 NMOS tubes N1-N6. The circuit connection relationship is:

[0041] P1, P2, N1, and N2 are cross-coupled in reverse phase to form a group of storage nodes Q and QB. N3 is used as a transmission tube between Q and the bit line BL, and N4 is used as a transmission tube between QB and the bit line BLB. The gates of N3 and N4 are connected to the word line W. The gate of N6 is connected to QB, the source of N6 is grounded, and the drain of N6 is connected to the drain of N5; the gate of N5 is connected to the computing word line RWL; the source of N5 is connected to the computing bit line CL.

[0042] As a further improvement of the present invention, the P1~P2 and N1~N4 parts in the 8T-SRAM unit constitute a 6T storage unit. The 6T storage unit in the 8T-SRAM unit is used to realize the data storage function in the storage mode, and is used to pre-store one of the decimal parts in the weight under the calculation module.

[0043] The operation logic of the storage unit in conjunction with N5 and N6 to implement multiplication is as follows:

[0044] (1) The mantissa part of the weight is pre-stored in the storage unit:

[0045] When Q is high and QB is low, it means that the corresponding bit of the mantissa of the weight is "1"; when Q is low and QB is high, it means that the corresponding bit of the mantissa of the weight is "0".

[0046] (2) Precharge the calculation bit line CL to a high level, and then input the mantissa of the operand through the calculation word line RWL:

[0047] When RWL is at a high level, it indicates that the corresponding bit of the mantissa of the input operand is "0". When RWL is at a low level, it indicates that the corresponding bit of the mantissa of the input operand is "1".

[0048] (3) Output the final calculation result of the mantissa product according to the level change of the calculated bit line CL:

[0049] When CL drops to a low level, it indicates that the product result is "1"; when CL remains in a high level state, it indicates that the product result is "0".

[0050] As a further improvement of the present invention, the index and array are composed of multiple 10T-SRAM units; each 10T-SRAM unit includes 2 PMOS tubes PM0-PM1 and 8 NMOS tubes NM0-NM7, and the circuit connection relationship is:

[0051] The sources of PM0 and PM1 are connected to VDD; the drain of PM0 is connected to the gates of PM1, NM3, NM4 and the drains of NM0 and NM2, and serves as the storage node Q; the drain of PM1 is connected to the gates of PM0, NM2, NM5 and the drains of NM1 and NM3, and serves as the inverting storage node QB; the sources of NM2 and NM3 are grounded; the source of NM0 is connected to the bit line BL; the source of NM1 is connected to the bit line BLB; the gates of NM0 and NM1 are connected to the word line WL.

[0052] The drain of NM4 and the source of NM5 are connected to the matching bit line TL; the source of NM4 and the drain of NM6 are connected; the drain of NM5 and the source of NM7 are connected; the source of NM6 and the drain of NM7 are connected to the matching bit line ML; the gate of NM6 is connected to the local word line WLL; the gate of NM7 is connected to the local word line WLR.

[0053] As a further improvement of the present invention, PM0-PM1 and NM0-NM3 parts in the 10T-SRAM unit constitute a 6T storage unit, and the 6T storage unit in the 10T-SRAM unit is used to realize the data storage function in the storage mode, and to store back one bit of the exponent sum in each row in the calculation mode. The remaining 4T parts constitute a matching unit; the matching unit uses one bit of the exponent sum stored back in the 6T storage unit as the target number; uses the corresponding bit of the successively decreasing maximum exponent as the query number, and then outputs the query result of whether the target number matches the query number.

[0054] The operation logic of the matching unit to achieve data matching is as follows:

[0055] (1) Write each bit of the sum of the weight and the exponent of the operand back to the 6T storage unit part of each 10T-SRAM unit to form the target number:

[0056] When Q is high and QB is low, it indicates that the target number is "1"; when Q is low and QB is high, it indicates that the target number is "0".

[0057] (2) Precharge the matching bit lines TL and ML to a high level; then input the encoded query number to the matching unit through the local word lines WLL and WLR:

[0058] When WLL is high and WLR is low, it indicates that the query number is "1"; when WLL is low and WLR is high, it indicates that the query number is "0".

[0059] (3) Ground the matching bit line TL and determine the matching result based on the level change of the matching bit line ML:

[0060] When the query number and the target number are the same, a discharge path is formed between ML and TL, and ML drops to a low level, indicating that the two are matched successfully.

[0061] When the query number and the target number are different, a discharge path cannot be formed between ML and TL, and ML remains at a high level, indicating that the matching between the two has failed.

[0062] The present invention also includes a CIM chip, which integrates the aforementioned SRAM-based floating-point multiplication and accumulation fast operation circuit. The CIM chip has a storage mode and a calculation mode; in the storage mode, the CIM chip is used as a memory. In the calculation mode, the CIM chip is used to implement multiplication and accumulation operations between multiple groups of multi-bit floating-point operands and multi-bit floating-point weights.

[0063] The technical solution provided by the present invention has the following beneficial effects:

[0064] The present invention provides a new circuit architecture and operation logic of a floating-point multiplication and accumulation fast operation circuit. A new high-bandwidth asynchronous exponent standardization and instruction parallel ordering mantissa alignment floating-point calculation process is applied in the circuit scheme, which can find the maximum value in parallel while adding the exponents, and replace the subtraction and shift in the mantissa alignment by a time period search method, thereby realizing MAC in-memory calculation of floating-point data with lower time, area and power consumption.

[0065] The present invention reasonably allocates and parallelizes different links in the floating-point multiplication and accumulation process through the cooperation between different modules, thereby completing a multiplication and accumulation task within at most two cycles. The solution of the present invention also reasonably allocates the processing timing of different links in the calculation process, thereby shortening the overall time of a large number of calculation tasks through the "pipeline" method, and limiting the average time consumption of a single calculation task to about one cycle. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 This is a circuit architecture diagram of the SRAM-based floating-point multiplication-accumulation fast calculation circuit provided in Embodiment 1 of the present invention.

[0067] Figure 2 1 is a circuit schematic diagram of the index and array parts in Example 1 of the present invention.

[0068] Figure 3 1 is a circuit diagram of a 10T-SRAM cell used in the index and array in Example 1 of the present invention.

[0069] Figure 4 4 is a circuit schematic diagram of mutually cascaded matching units in the index and array in Example 1 of the present invention.

[0070] Figure 5 This is a circuit diagram of the 8T-SRAM unit used in the finger weight mantissa array in Example 1 of the present invention.

[0071] Figure 6 It is a timing allocation diagram of the pipeline strategy of floating-point multiplication-accumulation operation adopted by the circuit in embodiment 1 of the present invention.

[0072] Figure 7 This is a flow chart of determining the maximum index by the maximum value finding module in Embodiment 1 of the present invention.

[0073] Figure 8 This is a circuit module diagram for realizing index and alignment functions in Example 1 of the present invention.

[0074] Fig. 9 This is a flow chart of implementing the mantissa product shift operation in embodiment 1 of the present invention. DETAILED DESCRIPTION

[0075] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0076] Example 1

[0077] The present embodiment provides a floating-point multiplication-accumulation fast operation circuit based on SRAM, which is designed based on an SRAM array and its peripheral circuits, and is used to implement multiplication-accumulation operations between multiple groups of multi-bit floating-point operands and multi-bit floating-point weights. The floating-point multiplication-accumulation fast operation circuit in the present embodiment has two working modes, storage and calculation, and controls the function switching of the circuit through a mode switching module. Among them, the peripheral circuit of the SRAM array refers to the relevant circuits and modules related to the use of the SRAM array to realize data reading, writing and saving.

[0078] like Figure 1 As shown, in order to realize the operation function, in the scheme of this embodiment, the SRAM array in the floating-point multiplication and accumulation fast operation circuit is divided into three parts by column, namely, the exponent sum array, the weight exponent array and the weight mantissa array. Among them, the weight exponent array is mainly used to process the tasks related to the exponent part of the floating-point number during the operation process; the weight mantissa array is used to process the tasks related to the mantissa part of the floating-point number during the operation process; the exponent sum array is used to store the sum of the exponents between the operand and the weight.

[0079] Specifically, in practical applications, for a fully functional floating-point multiplication and accumulation fast operation circuit, the number of columns of the SRAM units in the exponent sum array, weight exponent array, and weight mantissa array contained therein can be reasonably divided according to the specific number of bits of the exponent part and the mantissa part contained in the floating-point number type to be processed. For example, for a floating-point number in BF16 format, it contains 8 exponent bits and 7 decimal places; considering the overflow in the actual operation process, the number of columns of the exponent sum array, weight exponent array, and weight mantissa array can be set to 8:8:8 respectively; and for a floating-point number in FP32 format, it contains 8 exponent bits and 23 decimal places, then the number of columns of the exponent sum array, weight exponent array, and weight mantissa array can be set to 8:8:24 respectively.

[0080] Based on the divided SRAM array, the floating-point multiplication and accumulation fast operation circuit provided in this embodiment also includes: an exponent input module, a mantissa input module, an adder array, a maximum value search module, a subtraction counter, a shift register, an adder tree and a standardization module.

[0081] Among them, each row of the weight exponent array is used to pre-store the exponent part of the weight bit by bit. The exponent input module is used to input the exponent part of the operand to each row in the adder array. The adder array is used to read the storage value of the weight exponent array and calculate the exponent sum of the weight and the operand. Each row in the weight mantissa array is used to pre-store the mantissa part of the weight bit by bit. The mantissa input module is used to input the mantissa part of the operand to each row in the weight mantissa array. Each row in the weight mantissa array is used to pre-store the mantissa part of the weight bit by bit, and uses its own logical operation function to perform multiplication operation on the mantissa part of the weight and the operand to obtain the mantissa product.

[0082] In practical applications, the exponents or mantissas of the same operand and weight are input bit by bit into the same row of the array, and one of the bits is stored in the same cell of the array. Different rows are used to store different multi-bit exponents or multi-bit mantissas. On this basis, the maximum number of groups of floating-point multiplication and accumulation operands or weights that can be supported by the floating-point multiplication and accumulation fast operation circuit provided in this embodiment is determined by the number of rows of the SRAM array. For example, in a circuit where the scales of the exponent and array, the weight exponent array, and the weight mantissa array are 64×8, 64×8, and 64×8, respectively, it supports a maximum of 64 floating-point operands and 64 floating-point weights.

[0083] In the solution of this embodiment, the maximum value search module is used to first obtain the calculation results of the sum of the exponents of each row output by the adder array, and determine the maximum exponent while writing the sum of the exponents back to the exponent sum array bit by bit. Then, the number of bits of the sum of the exponents calculated in each row relative to the maximum exponent is determined in combination with the subtraction counter and the exponent sum array, and the shift register shifts the mantissa product calculated in the corresponding row according to the number of bits.

[0084] The adder tree is used to add the mantissa products of each row after the shift is completed to obtain the mantissa sum; finally, the normalization module generates the corresponding multiplication and accumulation operation result according to the maximum exponent and the mantissa sum.

[0085] In detail, Figure 2 As shown, the index and array in this embodiment are composed of multiple 10T-SRAM units. Figure 3 As shown, each 10T-SRAM unit includes 2 PMOS transistors PM0-PM1 and 8 NMOS transistors NM0-NM7. The circuit connection relationship is:

[0086] The sources of PM0 and PM1 are connected to VDD; the drain of PM0 is connected to the gates of PM1, NM3, NM4 and the drains of NM0 and NM2, and serves as the storage node Q; the drain of PM1 is connected to the gates of PM0, NM2, NM5 and the drains of NM1 and NM3, and serves as the inverted storage node QB; the sources of NM2 and NM3 are grounded; the source of NM0 is connected to the bit line BL; the source of NM1 is connected to the bit line BLB; the gates of NM0 and NM1 are connected to the word line WL. The drain of NM4 and the source of NM5 are connected to the matching bit line TL; the source of NM4 is connected to the drain of NM6; the drain of NM5 is connected to the source of NM7; the source of NM6 and the drain of NM7 are connected to the matching bit line ML; the gate of NM6 is connected to the local word line WLL; the gate of NM7 is connected to the local word line WLR.

[0087] Combination Figure 3 , PM0~PM1, NM0~NM3 parts in each 10T-SRAM unit in the index and array of this embodiment constitute a 6T storage unit. The 6T storage unit in the 10T-SRAM unit can realize the data storage function in the storage mode, and store back one bit of the index and sum in each row in the calculation mode. The remaining 4T parts constitute a matching unit; the matching unit uses one bit of the index and sum stored back in the 6T storage unit as the target number; the corresponding bit of the successively decreasing maximum index is used as the query number, and then outputs the query result of whether the target number matches the query number.

[0088] It is common knowledge for those skilled in the art that a 6T storage unit can realize data storage, and can read, write and retain data, and this embodiment will not be described in detail. The following only explains in detail the operation logic of the matching unit to realize data matching in the embodiment.

[0089] This embodiment uses a 10T-SRAM cell to match a single-bit query number with a single-bit target number in one cycle, or to match a multi-bit query number with one of the multi-bit target numbers. Using a row of 10T-SRAM cells, a full match between a multi-bit query number and a multi-bit target number can be achieved in one cycle.

[0090] Specifically, the process of matching the single-bit query number and the single-bit target number by the 10T-SRAM unit is as follows:

[0091] (1) Write each bit of the sum of the weight and the exponent of the operand back to the 6T storage unit part of each 10T-SRAM unit to form the target number:

[0092] When Q is high and QB is low, it indicates that the target number is "1"; when Q is low and QB is high, it indicates that the target number is "0".

[0093] (2) Precharge the matching bit lines TL and ML to a high level; then input the encoded query number to the matching unit through the local word lines WLL and WLR:

[0094] In this embodiment, the encoding rule of the query number is: when WLL is high and WLR is low, it indicates that the query number is "1"; when WLL is low and WLR is high, it indicates that the query number is "0".

[0095] (3) Ground the matching bit line TL and determine the matching result based on the level change of the matching bit line ML:

[0096] Specifically, when the query number is "1" and the target number is "1", Q is high, QB is low, WLL is high, and WLR is low. At this time, NM4 is off and NM5 is on; NM6 is off and NM7 is on. In this state, a discharge path is formed between TL and ML through NM5 and NM7, and ML eventually drops to a low level, indicating that the query number and the target number match successfully.

[0097] When the query number is "1" and the target number is "0", Q is high, QB is low, WLL is low, and WLR is high. At this time, NM4 is off and NM5 is on; NM6 is on and NM7 is off. In this state, a discharge path cannot be formed between TL and ML, and ML remains high, indicating that the query number and the target number fail to match.

[0098] When the query number is "0" and the target number is "1", Q is low, QB is high, WLL is high, and WLR is low; at this time, NM4 is turned on and NM5 is turned off; NM6 is turned off and NM7 is turned on; in this state, a discharge path cannot be formed between TL and ML, and ML remains high, which means that the query number and the target number fail to match.

[0099] When the query number is "0" and the target number is "0", Q is low, QB is high, WLL is low, and WLR is high; at this time, NM4 is turned on and NM5 is turned off; NM6 is turned on and NM7 is turned off; in this state, a discharge path is formed between TL and ML through NM4 and NM6, and ML eventually drops to a low level, indicating that the query number and the target number match successfully.

[0100] The truth table corresponding to the above process is shown in the following table:

[0101] Table 1: Truth table of data matching operation in 10T-SRAM

[0102]

[0103] In summary, in the matching unit of the 10T-SRAM designed in this embodiment, if the query number and the target number are the same, ML and TL will be directly connected and form a discharge path. If the query number and the target number are the same, ML and TL will not be connected and will not form a discharge path. The existence of the connection path will eventually affect the level state of ML. According to the change of the ML level state, it can be determined whether the query number and the target number are matched successfully.

[0104] The index and array provided in this embodiment are arranged by multiple 10T-SRAM arrays, such as Figure 4 As shown, in this array, for each 10T-SRAM cell in the same row, the matching bit line TL of the leftmost 10T-SRAM cell serves as an independent port, and the matching bit line ML of the rightmost 10T-SRAM cell serves as an independent port, and the ML end of each 10T-SRAM cell is connected to the TL end of the adjacent 10T-SRAM cell on the right.

[0105] Under this circuit design, if a multi-bit query number and a multi-bit target number are matched as follows, the target number only needs to be input bit by bit into the 6T storage unit part of each 10T-SRAM unit, and then the target number is input bit by bit into the matching unit in each 10T-SRAM unit; if the query number and the target number are exactly the same, TL and ML will be fully connected and form a discharge path, and the level state of ML will drop, indicating that the two multi-bit numbers are matched successfully. When any bit in the query number and the target number is different, the match fails and is disconnected at the 10T-SRAM unit, which leads to the inability to connect TL and ML, and the inability to form a discharge path. ML is kept at a high level, indicating that the two multi-bit numbers fail to match.

[0106] In the solution of this embodiment, Figure 5 As shown, the weight mantissa array is composed of multiple 8T-SRAM units; each 8T-SRAM unit includes 2 PMOS tubes P1~P2 and 6 NMOS tubes N1~N6. The circuit connection relationship is:

[0107] P1, P2, N1, and N2 are cross-coupled in reverse phase to form a group of storage nodes Q and QB. N3 is used as a transmission tube between Q and the bit line BL, and N4 is used as a transmission tube between QB and the bit line BLB. The gates of N3 and N4 are connected to the word line W. The gate of N6 is connected to QB, the source of N6 is grounded, and the drain of N6 is connected to the drain of N5; the gate of N5 is connected to the computing word line RWL; the source of N5 is connected to the computing bit line CL.

[0108] The P1~P2 and N1~N4 parts of the 8T-SRAM unit used in the weight mantissa array constitute a 6T storage unit, which is used to implement the data storage function in the storage mode and to pre-store one of the mantissa parts in the weight under the calculation module. N5 and N6 constitute the multiplication unit.

[0109] In the solution of this embodiment, each 8T-SRAM unit in the weight mantissa array needs to store the mantissa of the weight in advance and also needs to calculate the product of the mantissa of the operand and the weight according to the mantissa of the input operand. In this embodiment, the storage unit cooperates with N5 and N6 to realize the multiplication operation, and the operation logic of the process is as follows:

[0110] (1) The mantissa part of the weight is pre-stored in the storage unit:

[0111] When Q is high and QB is low, it means that the corresponding bit of the mantissa of the weight is "1"; when Q is low and QB is high, it means that the corresponding bit of the mantissa of the weight is "0".

[0112] (2) Precharge the calculation bit line CL to a high level, and then input the mantissa of the operand through the calculation word line RWL:

[0113] When RWL is at a high level, it indicates that the corresponding bit of the mantissa of the input operand is "0". When RWL is at a low level, it indicates that the corresponding bit of the mantissa of the input operand is "1".

[0114] (3) Output the final calculation result of the mantissa product according to the level change of the calculated bit line CL:

[0115] In this embodiment, when CL drops to a low level, it indicates that the multiplication result is "1", and when CL maintains a high level state, it indicates that the multiplication result is "0".

[0116] Specifically, when RWL is at a low level, Q is at a high level, and QB is at a low level, N5 and N6 are both turned on, and at this time, the bit line CL forms a discharge path, and CL drops to a low level, completing the operation "1×1=1".

[0117] When RWL is low, Q is low, and QB is high, N5 is turned on and N6 is turned off. At this time, the calculation bit line CL cannot form a discharge path, and CL remains high, completing the operation "0×1=0".

[0118] When RWL is high, Q is high, and QB is low, N5 is turned off and N6 is turned on. At this time, the calculation bit line CL cannot form a discharge path and CL remains high, completing the operation "1×0=0".

[0119] When RWL is high, Q is low, and QB is high, N5 and N6 are both turned off. At this time, the calculation bit line CL cannot form a discharge path, and CL remains high, completing the operation "0×0=0".

[0120] The truth table corresponding to the above process is shown in the following table:

[0121] Table 1: Truth table of multiplication operation in 8T-SRAM

[0122]

[0123] In the scheme of this embodiment, in addition to data storage, the index and array also need to have a data matching function; in addition to data storage, the weight mantissa array also needs to have a multiplication function. The weight index only needs to have the function of pre-storing the exponential part of the weight during the operation process, so the weight index array can use any SRAM unit with data storage function. Of course, the SRAM unit in the weight index array can also use the aforementioned 8T-SRAM and 10T-SRAM.

[0124] In the SRAM-based floating-point multiplication and accumulation fast operation circuit provided in this embodiment, in order to further shorten the time to complete the floating-point multiplication and accumulation operation, this embodiment borrows the pipeline strategy in industrial production to design the circuit and perform the operation task during the circuit operation. The principle of the pipeline strategy of this embodiment is to divide the entire circuit into an exponential operation part including an exponent input unit, an exponent sum array, a weight exponent array and an adder array, and a mantissa operation part including a mantissa input module, a weight mantissa array, a shift register, an adder number, a subtraction counter, a normalization module and a maximum value search module.

[0125] In the multiplication and accumulation process of floating-point numbers, the exponential operation part completes the "process" of exponential operation and addition of each round of operation tasks in the previous cycle, and the mantissa operation part completes the "process" of exponent alignment, mantissa offset and synthesis of the final multiplication and accumulation result according to each exponent sum that has been calculated in a delayed cycle. Since the circuit modules in the exponential operation part and the mantissa operation part in the circuit designed in this embodiment can be independently synchronized, the circuit designed in this embodiment can also synchronously complete the remaining operations except the exponential addition in the previous round when executing the exponential addition operation of the current round, thereby making efficient use of each clock cycle.

[0126] Based on this special pipeline strategy, the floating-point multiplication-accumulation fast operation circuit of this embodiment distributes a complete multiplication-accumulation operation task into two cycles for completion. And because two "processes" in different rounds of operation can be completed synchronously in each cycle, after multiple multiplication-accumulation operation tasks are completed, the average time taken for each multiplication-accumulation operation is only one cycle.

[0127] Specifically, Figure 6 As shown, the process of implementing the multiplication and accumulation operation by the SRAM-based floating-point multiplication and accumulation fast operation circuit provided in this embodiment is as follows:

[0128] S1: Initial stage:

[0129] In the first cycle, the exponential input module, the weight exponential array and the adder array are used to complete the input and addition of the exponential parts of each operand and weight in the first round of operation tasks to obtain the exponential sum.

[0130] The maximum value search module reads the exponents and calculation results of each row in the adder array bit by bit in order from low to high.

[0131] S2: Operation phase:

[0132] In the second cycle, the mantissa input module and the weight mantissa array are used to complete the input and multiplication of the mantissa parts of each operand and weight in the first round of calculation tasks to obtain each mantissa product.

[0133] The maximum value search module writes the calculated result of the read exponent sum back to the exponent sum array, and determines the maximum exponent while writing back. Then, the maximum exponent is decremented by the subtraction counter and compared with each exponent sum in the exponent sum array, and after each comparison, the shift register is used to shift the corresponding mantissa product of the exponent sum that is less than the maximum exponent.

[0134] Then, the adder tree adds the mantissa products of each row after shifting to obtain the mantissa sum. Finally, the normalization module generates the corresponding multiplication and accumulation operation result according to the determined maximum exponent and mantissa sum.

[0135] At the same time, in the second cycle, the exponential operation array is also used to complete the input and addition of the exponential parts of each operand and weight in the second round of operation tasks, and the maximum value search module reads the calculation results of the exponential sum of each row in the adder array bit by bit in order from low to high.

[0136] S3: Cycle phase:

[0137] According to the same logic, in each subsequent cycle, the multiplication and accumulation results of the previous round are calculated and output, and the addition and caching of the exponential part in the back shift round operation are completed;

[0138] By analogy, the processing and output of the N-1th round of multiplication and accumulation operations can be achieved in the Nth cycle.

[0139] The main function of the maximum value finding module in the floating-point multiplication-accumulation fast operation circuit provided in this embodiment is to compare the exponent sums obtained in each row in each round of multiplication-accumulation operation tasks to determine the maximum exponent in each exponent sum. The maximum exponent determined by the maximum value finding module will be used to align the exponent sums in each row and shift the mantissa product in the later stage.

[0140] In order to achieve the required functions, the maximum value search module provided in this embodiment includes a plurality of ping-pong units and a plurality of comparison units corresponding to the number of rows of the SRAM array; each ping-pong unit includes register 1 and register 2. The functions of the ping-pong unit and the comparison unit are as follows:

[0141] In the previous cycle, the ping-pong unit is used to read the exponential sum calculated by the adder array in order from low to high and store it in register one; and write each bit of data in register one to register two bit by bit, and the data written into register two is restored to the exponential sum arranged from high to low.

[0142] In the next cycle, the ping-pong unit writes the data in register 2 back to the corresponding row in the index and array, and synchronously determines the maximum index during the write-back process. At the same time, the ping-pong unit also performs the index and read in the next round of calculation and updates register 1.

[0143] The ping-pong unit used in this embodiment has the function of simultaneously writing the exponent and operation result of the next cycle bit by bit in the order from low to high, and reading the exponent and operation result of the previous cycle in the order from high to low. Therefore, the ping-pong unit serves as a link between the two major "processes" divided in the floating-point multiplication and accumulation operation task in this embodiment, so that the entire operation process can run continuously and smoothly.

[0144] The function of the comparison unit in the maximum value search module is to compare the exponents of each row after writing back with the operation results to determine the maximum exponent. Figure 7 As shown, in the process of writing back the sum of the exponents of each row, the maximum value finding module of this embodiment determines the maximum exponent by comparing the exponents bit by bit, and the process is as follows:

[0145] (1) The exponent sum calculated by the adder array is written bit by bit from register 2 to the exponent sum array in order from high to low.

[0146] (2) When writing each bit of the exponent sum, determine the current value and make the following decisions:

[0147] A. If the value of the current bit of the sum of the exponents in different rows includes both 1 and 0, the number with the current bit being 1 is retained and the number with the current bit being 0 is removed.

[0148] B. If the values ​​of the current bits of the exponents and in different rows are both 1 or 0, the numbers on all rows are retained.

[0149] (3) According to the strategy in the previous step, if there is only one number left or the lowest bit of the exponent sum has been written, the number finally retained is the maximum exponent.

[0150] For example, suppose the two exponents calculated by the adder array are 4-bit binary numbers A and B, whose values ​​are 1010 and 1011 respectively. The bit-by-bit comparison process is as follows:

[0151] Compare the highest bit: A[3]=1, B[3]=1. If these bits are the same, keep both numbers and continue to compare the next bit.

[0152] Compare the second highest bit: A[2]=0, B[2]=0. If these bits are the same, keep both numbers and continue to compare the next bit.

[0153] Compare the third highest bit: A[1]=1, B[1]=0. If these bits are the same, keep both numbers and continue to compare the next bit.

[0154] Compare the fourth highest bit: A[0]=0, A[0]=1, this bit is different, because B[0]>A[0], so B>A, keep B. At this point, the comparison has been to the lowest bit, and the remaining B is the maximum value.

[0155] As another example, suppose the adder array outputs four 4-bit binary exponent sums, and the values ​​of each number are as follows:

[0156] A=1010(decimal 10)

[0157] B=1001(decimal 9)

[0158] C = 1100 (decimal 12)

[0159] D=0111(decimal 7)

[0160] First, start comparing from the highest bit. If the highest bit of a number is 0, exclude the number. If the highest bit is 1, keep the number. After this step, the following numbers are retained: A, B, C.

[0161] Continue to compare the second highest bit: if the second highest bit is 0, exclude it, if it is 1, keep it, then this step only leaves C. At this point, although the comparison has not reached the lowest bit, there is only one number left, so the number C that is retained is the maximum value.

[0162] In the circuit of this embodiment, the exponent sum array, the subtraction counter and the shift register shift the mantissa product according to the maximum exponent output by the maximum value finding module. Figure 8 and Fig. 9 , the operation strategy of implementing the exponent sum alignment and mantissa product shift in this embodiment is as follows:

[0163] The subtraction counter decrements the maximum exponent by 1 in each cycle and sends it to the exponent sum array.

[0164] The index and array matches the maximum index at the current moment with the index and index stored in itself in each cycle. If the match is successful, a corresponding pairing flag is generated and sent to the shift register.

[0165] The shift register is used to shift the exponent and the corresponding mantissa product of each row in each cycle, and when any pairing flag is received in each cycle, the shift operation of the mantissa product of the corresponding row is stopped.

[0166] When the preset maximum number of cycles is reached, the shifting of all mantissa products is completed.

[0167] Example 2

[0168] Based on the embodiment scheme, this embodiment further provides a CIM chip, which integrates the SRAM-based floating-point multiplication and accumulation fast operation circuit as in embodiment 1. The CIM chip has a storage mode and a calculation mode; in the storage mode, the CIM chip is used as a memory. In the calculation mode, the CIM chip is used to implement multiplication and accumulation operations between multiple groups of multi-bit floating-point operands and multi-bit floating-point weights.

[0169] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0170] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A floating-point multiplication and accumulation fast calculation circuit based on SRAM, characterized in that: It is designed based on an SRAM array and its peripheral circuits, and is used to implement multiplication and accumulation operations between multiple groups of multi-bit floating-point operands and multi-bit floating-point weights; the SRAM array in the floating-point multiplication and accumulation fast operation circuit is divided into three parts by column, namely, an exponent sum array, a weight exponent array, and a weight mantissa array; The floating-point multiplication-accumulation fast operation circuit also includes: an exponent input module, a mantissa input module, an adder array, a maximum value search module, a subtraction counter, a shift register, an adder tree and a standardization module; Each row in the weight exponent array is used to pre-store the exponent part of the weight bit by bit; the exponent input module is used to input the exponent part of the operand to each row in the adder array; the adder array is used to read the stored value of the weight exponent array and calculate the exponent sum of the weight and the operand; the mantissa input module is used to input the mantissa part of the operand to each row in the weight mantissa array; each row in the weight mantissa array is used to pre-store the mantissa part of the weight bit by bit, and use its own logical operation function to perform multiplication operation on the weight and the mantissa part of the operand to obtain the mantissa product; The maximum value search module is used to first obtain the calculation results of the exponential sum of each row output by the adder array, and determine the maximum exponent while writing the exponential sum back to the exponential sum array bit by bit; then determine the bit difference of the exponent sum calculated in each row relative to the maximum exponent in combination with the subtraction counter and the exponential sum array, and shift the mantissa product calculated in the corresponding row according to the bit difference by the shift register; The adder tree is used to add the mantissa products of each row after the shift is completed to obtain the mantissa sum; finally, the standardization module generates a corresponding multiplication-accumulation operation result according to the maximum exponent and the mantissa sum.

2. The SRAM-based floating-point multiplication-accumulation fast operation circuit according to claim 1, characterized in that: It uses a pipeline strategy to complete the multiplication and accumulation tasks of floating-point numbers. The process is as follows: S1: Initial stage: In the first cycle, the exponential input module, the weight exponential array and the adder array are used to complete the input and addition of the exponential parts of each operand and the weight in the first round of operation tasks to obtain the exponential sum; The maximum value finding module reads the exponent and calculation result of each row in the adder array bit by bit in the order from low to high; S2: Operation phase: In the second cycle, the mantissa input module and the weight mantissa array are used to complete the input and multiplication of the mantissa parts of each operand and weight in the first round of calculation tasks to obtain each mantissa product; The maximum value finding module writes back the calculation result of the read exponent sum to the exponent sum array, and determines the maximum exponent while writing back; then, the maximum exponent is decremented by the subtraction counter and compared with each exponent sum in the exponent sum array, and after each comparison, the shift register is used to shift the exponent sum corresponding to the mantissa product that is smaller than the maximum exponent; Then, the adder tree adds the mantissa products of each shifted row to obtain the mantissa sum; finally, the standardization module generates a corresponding multiplication-accumulation operation result according to the maximum exponent and the mantissa sum; At the same time, in the second cycle, the exponential operation array is also used to complete the input and addition of the exponential parts of each operand and weight in the second round of operation tasks, and the maximum value search module reads the calculation results of the exponential sum of each row in the adder array bit by bit in order from low to high; S3: Cycle phase: According to the same logic, in each subsequent cycle, the multiplication and accumulation results of the previous round are calculated and output, and the addition and caching of the exponential part in the back shift round operation are completed; By analogy, the processing and output of the N-1th round of multiplication and accumulation operations can be achieved in the Nth cycle.

3. The SRAM-based floating-point multiplication-accumulation fast operation circuit according to claim 1, characterized in that: The maximum value search module includes a plurality of ping-pong units and a plurality of comparison units corresponding to the number of rows of the SRAM array; each ping-pong unit includes a register 1 and a register 2; In the previous cycle, the ping-pong unit is used to read the exponential sum calculated by the adder array in order from low to high and store it in register one; and write each bit of data in register one into register two bit by bit, and the data written in register two is restored to the exponential sum arranged from high to low; In the next cycle, the ping-pong unit writes back the data in register 2 to the corresponding row in the index and array, and synchronously determines the maximum index during the writing back process; The ping-pong unit also performs the exponentiation and reading in the next round of calculations and updates register one; The comparison unit is used to compare the exponents of each row after writing back with the operation result to determine the maximum exponent.

4. The SRAM-based floating-point multiplication-accumulation fast operation circuit according to claim 3, characterized in that: The method by which the maximum value finding module determines the maximum exponent in the process of writing back the exponent sum of each row is: (1) The exponent sum calculated by the adder array is written bit by bit from register 2 to the exponent sum array in order from high to low; (2) When writing each bit of the exponent sum, determine the current value and make the following decisions: A. If the values ​​of the current positions of the sum of the exponents in different rows include both 1 and 0, the numbers with the current position being 1 are retained, and the numbers with the current position being 0 are removed; B. If the current positions of the sum of the exponents in different rows are all 1 or all 0, keep the numbers on all rows; (3) According to the strategy in the previous step, if there is only one number left or the lowest bit of the exponent sum has been written, the number finally retained is the maximum exponent.

5. The SRAM-based floating-point multiplication-accumulation fast operation circuit according to claim 1, characterized in that: The operation strategy of the index sum array, the subtraction counter and the shift register to shift the mantissa product according to the maximum exponent output by the maximum value finding module is as follows: The subtraction counter performs a subtraction operation on the maximum exponent by 1 in each cycle and then sends the subtraction operation to the exponent sum array; The index sum array matches the maximum index at the current moment with the index sum stored in itself in each cycle, and if the match is successful, a corresponding pairing flag is generated and sent to the shift register; The shift register is used to shift the exponent and the corresponding mantissa product of each row in each cycle, and stop the shift operation of the mantissa product of the corresponding row when any pairing flag is received in each cycle; When the preset maximum number of cycles is reached, the shifting of all mantissa products is completed.

6. The SRAM-based floating-point multiplication-accumulation fast operation circuit according to claim 1, characterized in that: The weight mantissa array is composed of a plurality of 8T-SRAM units; each 8T-SRAM unit includes two PMOS tubes P1 to P2 and six NMOS tubes N1 to N6; the circuit connection relationship is: P1, P2, N1, and N2 are anti-phase cross-coupled to form a group of storage nodes Q and QB; N3 serves as a transmission tube between Q and the bit line BL, and N4 serves as a transmission tube between QB and the bit line BLB. The gates of N3 and N4 are connected to the word line WL; the gate of N6 is connected to QB, the source of N6 is grounded, and the drain of N6 is connected to the drain of N5; the gate of N5 is connected to the computing word line RWL; and the source of N5 is connected to the computing bit line CL.

7. The SRAM-based floating-point multiplication-accumulation fast operation circuit according to claim 6, characterized in that: The P1-P2 and N1-N4 parts of the 8T-SRAM unit constitute a 6T storage unit, and the 6T storage unit in the 8T-SRAM unit is used to implement a data storage function in a storage mode, and to pre-store one of the mantissa parts in the weight in a calculation module; The operation logic of the storage unit cooperating with N5 and N6 to realize the multiplication operation is as follows: (1) The mantissa part of the weight is pre-stored in the storage unit: When Q is high and QB is low, the corresponding bit of the mantissa of the weight is "1"; when Q is low and QB is high, the corresponding bit of the mantissa of the weight is "0"; (2) Precharge the calculation bit line CL to a high level, and then input the mantissa of the operand through the calculation word line RWL: When RWL is high, it means that the corresponding bit of the mantissa of the input operand is "0", and when RWL is low, it means that the corresponding bit of the mantissa of the input operand is "1"; (3) Output the final calculation result of the mantissa product according to the level change of the calculated bit line CL: When CL drops to a low level, it indicates that the product result is "1"; when CL remains in a high level state, it indicates that the product result is "0".

8. The SRAM-based floating-point multiplication-accumulation fast operation circuit according to claim 1, characterized in that: The index and array are composed of multiple 10T-SRAM units; each 10T-SRAM unit includes 2 PMOS tubes PM0-PM1 and 8 NMOS tubes NM0-NM7, and the circuit connection relationship is: The sources of PM0 and PM1 are connected to VDD; the drain of PM0 is connected to the gates of PM1, NM3, NM4 and the drains of NM0 and NM2, and serves as the storage node Q; the drain of PM1 is connected to the gates of PM0, NM2, NM5 and the drains of NM1 and NM3, and serves as the inverting storage node QB; the sources of NM2 and NM3 are grounded; the source of NM0 is connected to the bit line BL; the source of NM1 is connected to the bit line BLB; the gates of NM0 and NM1 are connected to the word line WL; The drain of NM4 and the source of NM5 are connected to the matching bit line TL; the source of NM4 and the drain of NM6 are connected; the drain of NM5 and the source of NM7 are connected; the source of NM6 and the drain of NM7 are connected to the matching bit line ML; the gate of NM6 is connected to the local word line WLL; the gate of NM7 is connected to the local word line WLR.

9. The SRAM-based floating-point multiplication-accumulation fast operation circuit according to claim 8, characterized in that: PM0-PM1 and NM0-NM3 parts in the 10T-SRAM unit constitute a 6T storage unit; the 6T storage unit in the 10T-SRAM unit is used to realize the data storage function in the storage mode, and to store back one bit of the exponent sum in each row in the calculation mode; the remaining 4T parts constitute a matching unit; the matching unit uses one bit of the exponent sum stored back in the 6T storage unit as the target number; uses the corresponding bit of the successively decreasing maximum exponent as the query number, and then outputs the query result of whether the target number matches the query number; The operation logic of the matching unit to achieve data matching is as follows: (1) Write back each bit of the sum of the weight and the exponent of the operand to the 6T storage unit in each 10T-SRAM unit to form the target number: When Q is high and QB is low, it means the target number is "1"; when Q is low and QB is high, it means the target number is "0"; (2) Precharge the matching bit lines TL and ML to a high level; then input the encoded query number to the matching unit through the local word lines WLL and WLR: When WLL is high and WLR is low, it means the query number is "1"; when WLL is low and WLR is high, it means the query number is "0"; (3) Ground the matching bit line TL and determine the matching result based on the level change of the matching bit line ML: When the query number and the target number are the same, a discharge path is formed between ML and TL, and ML drops to a low level, indicating that the two are matched successfully; When the query number and the target number are different, a discharge path cannot be formed between ML and TL, and ML remains at a high level, indicating that the matching between the two has failed.

10. A CIM chip, characterized in that: It integrates a SRAM-based floating-point multiplication-accumulation fast operation circuit as described in any one of claims 1 to 9; the CIM chip has a storage mode and a calculation mode; in the storage mode, the CIM chip is used as a memory; in the calculation mode, the CIM chip is used to implement multiplication-accumulation operations between multiple groups of multi-bit floating-point operands and multi-bit floating-point weights.

Citation Information

Patent Citations

  • Application specific instruction set processor based on transport triggered architecture (TTA)

    CN105573716A

  • Softmax hardware implementation method based on linear segmentation

    CN113377332A

  • 10T-SRAM unit, operational circuit structure based on 10T-SRAM unit and chip

    CN116129966A

  • Multiply-accumulate in-memory calculation circuit of adaptive scanning ADC (Analog to Digital Converter) based on read-write separation SRAM configuration

    CN117056277A

  • Storage and calculation integrated circuit device supporting floating point precision multiplication and addition operation

    CN117539827A

Cited By

  • In-memory computing method, in-memory computing architecture and in-memory computing chip of floating-point number

    CN119248712A

  • Floating point type index comparison circuit based on SRAM (Static Random Access Memory) and chip thereof

    CN120447865A