Reconfigurable digital in-memory computing device based on multiplexing Booth computing unit and 6T-SRAM (6 T-static random access memory)
By adopting the time-division multiplexing strategy and Booth coding preprocessing of multiplexing Booth computing units and 6T-SRAM in the digital in-memory computing device, combined with the alternating operation of 11T and 28T adder trees, the adder tree area and power consumption are solved It solves the problem of large overhead and achieves high energy efficiency and flexible computing configuration to adapt to the needs of neural networks of different sizes.
Patent Information
- Application Number
- CN202410652406.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-05-24
AI Technical Summary
When existing digital in-memory computing devices face different neural networks, the area and power consumption of the adder tree are large, resulting in inflexible systems. In addition, array utilization is low when applying small-scale neural networks, making it difficult to ensure high throughput at the same time. efficiency and energy efficiency ratio.
A reconfigurable digital in-memory computing device based on multiplexed Booth computing units and 6T-SRAM is used. Through time-division multiplexing strategy and Booth coding preprocessing, the number of parallel computing data groups of the adder tree is reduced, and flexible convolution calculations are designed. Scale, supports 64N×64 (N is maximum 4) parallel operation groups, and reduces area and power consumption through 11T and 28T alternating adder trees.
It achieves higher energy consumption efficiency and flexible computing configuration, reduces the number of computing cycles, adapts to the computing needs of neural networks of different sizes, and improves the energy efficiency ratio and processing efficiency of the system.
Smart Images

Figure CN118657181A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of in-memory computing, and in particular to a reconfigurable digital in-memory computing device based on a multiplexed Booth computing unit and a 6T-SRAM. Background Art
[0002] In recent years, with the rapid development and widespread application of artificial intelligence technology, the amount of data that needs to be processed by artificial intelligence-related algorithms is becoming increasingly large. The frequent data movement between the central processing unit and the memory in the traditional von Neumann architecture has generated huge transmission power consumption. At the same time, the mismatch between memory bandwidth and processor performance also limits the computing performance of computing hardware. The Computing-in-Memory (CIM) architecture gives the memory certain computing functions and directly calculates a large amount of data inside the memory, reducing the bus interaction frequency between the memory and the central processing unit, reducing the power consumption of data transmission, and thus greatly improving the energy efficiency of the system. Therefore, it has received widespread attention from industry and academia in recent years.
[0003] In-memory computing technology is divided into analog in-memory computing design and digital in-memory computing design. Analog in-memory computing design can achieve a higher computing speed, and the system performance and energy efficiency are good. However, with the high-precision requirements for computing in large-scale neural network applications and application scenarios with frequent algorithm iterations, the effect of analog in-memory computing is not ideal. Since digital in-memory computing performs operations in the digital domain, its computing accuracy is not affected by PVT (Process, Voltage, Temperature) and noise, and can achieve 100% computing accuracy, which is very suitable for large-scale, high-precision and algorithm-iterative neural network application scenarios. Currently, the proposed digital in-memory computing devices are mostly characterized by high parallel computing. This method brings huge computing power to the architecture, thereby achieving a good energy efficiency ratio. However, it also makes the area and power consumption of the adder tree in the architecture larger, and the storage unit and the computing unit are configured in a 1:1 ratio, which will result in a larger area of the array, resulting in an increase in its static power consumption. In addition, this method makes the architecture inflexible. When facing small-scale neural network applications, the weight values in the array need to be repeatedly refreshed, resulting in a reduced utilization rate of the array. Therefore, how to reduce the area and power consumption of the adder tree in the system while ensuring the high throughput of the system and improving the energy efficiency of the system, and improving the configurability of the system when facing different neural networks, is a key issue that needs to be solved in the design of digital in-memory computing. Summary of the invention
[0004] In order to solve the problems in the prior art, the present invention provides a reconfigurable digital in-memory computing device based on multiplexed Booth computing units and 6T-SRAM.
[0005] The reconfigurable digital in-memory computing device based on multiplexed Booth computing units and 6T-SRAM includes an input encoding module and 64 Booth multiplication in-memory computing processors;
[0006] The input encoding module encodes the external sign flag signal and 64 3-bit continuous data to obtain a control signal for Booth operation;
[0007] The Booth multiplication in-memory calculation processor includes an in-memory calculation array, a bit extension unit, an adder tree unit and an accumulator unit, wherein the in-memory calculation array is composed of 1 row and 64 columns of Booth multiplication in-memory calculation data blocks, each of which includes an SRAM subarray and a Booth calculation unit, and the SRAM subarray is composed of 4 rows and 4 columns of 6T-SRAM units;
[0008] The in-memory computing array has two working modes: storage mode and computing mode. In the storage mode, the in-memory computing array stores externally input weight data, and the weight data is stored in the 6T-SRAM unit of the SRAM subarray.
[0009] In the calculation mode, the Booth calculation unit receives the control signal of the Booth operation and performs calculation according to the weight data stored in the SRAM subarray to obtain 64 intermediate calculation results. The bit extension unit performs a bit extension operation on the 64 intermediate calculation results to obtain 64 6-bit intermediate products. The adder tree unit accumulates the intermediate products to obtain partial sums. The accumulator unit performs shift accumulation on the partial sums and outputs a 20-bit convolution calculation result.
[0010] Furthermore, the 64 3-bit continuous data are continuous 3-bit data of 64 values to be convolution calculated in the same group among the 64*N values to be convolution calculated, and the bit weight of each continuous 3-bit data is the same; the 64*N values to be convolution calculated are all in binary format, where N is an array, 1≤N≤4.
[0011] Furthermore, the specific calculation steps of the accumulator unit are:
[0012] 1) The accumulator unit receives the partial sum output by the adder tree of the current cycle and performs bit extension;
[0013] 2) adding the partial sum after bit expansion to the accumulated value stored in the accumulator; if the accumulated value of the current cycle is the accumulated value obtained by accumulating the partial sums of the previous N cycles, two zeros are added after the value of the accumulated value, and the accumulated value after the two zeros are added to the partial sum after bit expansion, and the result of the addition is stored in the accumulator as a new accumulated value; if the accumulated value of the current cycle is not the accumulated value obtained by accumulating the partial sums of the previous N cycles, the partial sum after bit expansion is added to the accumulated value, and the result of the addition is stored in the accumulator as a new accumulated value;
[0014] 3) Repeat step 1) and step 2) until all the 64*N partial sums are accumulated, and the accumulator finally outputs a 20-bit convolution calculation result.
[0015] Compared with the prior art, the present invention has the following effects:
[0016] (1) The present invention adopts a time-sharing multiplexing strategy, where every four rows of SRAM share one Booth calculation unit, reducing the number of data groups calculated in parallel in each operation cycle, thereby greatly reducing the area and power consumption of the adder tree. At the same time, the present invention performs Booth encoding preprocessing on the 3-bit input calculation data, and then drives the Booth calculation unit and the bit extension unit designed in the architecture to operate the obtained operation signal, so that 3 bits of calculation data can be processed in a single cycle, which greatly reduces the number of cycles required for operation. Therefore, the device can achieve higher energy efficiency.
[0017] (2) The present invention can flexibly configure the scale of convolution calculation according to the scale of the applied neural network, and the system can support 64N×64 parallel operation groups (N is 4 at most) in a single cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is the overall architecture diagram of the in-memory computing design based on multiplexing Booth computing units and 6T SRAM.
[0019] Figure 2 This is a 1Kb in-memory computing array layout diagram.
[0020] Figure 3 This is a schematic diagram of the Booth multiplication in-memory calculation data block circuit.
[0021] Figure 4 This is the circuit diagram of the Booth multiplication encoder.
[0022] Figure 5 It is the operational truth table of Booth multiplication encoding circuit.
[0023] Figure 6This is the circuit diagram of the adder tree with 11T and 28T running alternately.
[0024] Figure 7 This is a schematic diagram of the internal structure of the Booth multiplication in-memory computing processor.
[0025] Figure 8 It is a timing diagram of the reconfigurable convolution computing operation of the in-memory computing device.
[0026] Fig. 9 It is a transient simulation diagram of Booth's multiplication in-memory calculation data block.
[0027] Fig.10 It is a transient simulation diagram of the computing operation of the device. DETAILED DESCRIPTION
[0028] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. The following embodiments will help to further understand the present invention.
[0029] First, some nouns or terms that appear in the description of the present invention are explained as follows:
[0030] The sign flag signal is the basis for determining whether the input data has a sign. In a specific embodiment of the present invention, if the sign flag signal is at a logic level "1", it indicates that the input data is a signed number; if the sign flag signal is at a logic level "0", it indicates that the input data is an unsigned number.
[0031] For example, 64 3-bit consecutive data are as follows: suppose 3 of the values to be convolved are "10110101, 10010011, 11001101", then the 3 3-bit consecutive data are input according to the highest bit weight, which are "101, 100, 110"; if they are input according to the second highest bit weight, they are "110, 010, 001". And each value to be convolved has a maximum of 8 bits.
[0032] The weight data is the weight value to be written into the in-memory calculation array.
[0033] The present invention provides a reconfigurable digital in-memory computing device based on multiplexed Booth computing units and 6T-SRAM. Figure 1The architecture diagram of the entire reconfigurable digital in-memory computing device is shown in Figure 1. The main components of the architecture are: 64 Booth multiplication in-memory computing processors, input encoding module, address decoder and clock control module. Each Booth multiplication in-memory computing processor contains 5 modules, namely: 1Kb in-memory computing array, array read and write drive circuit, bit expansion unit, adder tree circuit and accumulator circuit. The in-memory computing array consists of 64 Booth multiplication in-memory computing data blocks, each of which contains an SRAM subarray with a size of 4 rows × 4 columns and a Booth multiplication computing unit. When the device performs calculations, four rows of SRAM Banks share a Booth multiplication computing unit, and the weight values are read into the Booth multiplication computing unit in a time-sharing manner for calculation. The bit expansion unit performs corresponding expansion operations on the 64 groups of intermediate calculation results output by the Booth multiplication in-memory computing data block according to the control signal output by the input encoding module, and obtains 64 groups of 6-bit intermediate products.
[0034] The adder tree unit sums these intermediate accumulations and sends the partial sums to the accumulator unit for shift accumulation.
[0035] The accumulator unit has a configurable shift period, which enables the reconfiguration of the scale of the convolution operation.
[0036] The read / write driver unit is used to control the read / write operation of the in-memory computing array. The read / write driver unit is responsible for writing the externally input weight value and reading the weight value stored in the in-memory computing array.
[0037] The input encoding module consists of 64 Booth multiplication encoders. In the calculation mode, it encodes 64 groups of 3-bit data of external input according to the Booth encoding principle to obtain the control signal of Booth operation, and drives the Booth multiplication in-memory calculation processor to perform corresponding operations. In the storage mode, the 64 groups of 3-bit data are not enabled for sampling, and the encoding operation of "0" is performed.
[0038] The address decoder is responsible for compiling the external input address signal to obtain the row address signal and the column address signal, so as to perform read weight, write weight or calculation operations on the selected storage unit in the in-memory computing array. The clock control module is responsible for the timing control and working mode switching of the entire reconfigurable digital in-memory computing device.
[0039] In a specific embodiment of the present invention, the Booth multiplication in-memory calculation data block adopts a time-sharing multiplexing method for calculation, each SRAM sub-array is composed of four SRAM Banks, each SRAM Bank is composed of 1 row and 4 columns of 6T-SRAM units, and the four SRAM Banks in a Booth multiplication in-memory calculation data block time-sharing multiplex a Booth calculation unit, and the Booth calculation unit performs multiplication operations.
[0040] In a specific embodiment of the present invention, the address decoder receives an address signal input from the outside, and when the in-memory calculation array is in a storage mode, the address decoder outputs a column address signal to a read-write driver unit, and the read-write driver unit reads or writes the weight data into a corresponding Booth multiplication in-memory calculation data block according to the column address signal; the address decoder outputs a row address signal to a Booth multiplication in-memory calculation data block, and the Booth multiplication in-memory calculation data block stores the weight data written by the read-write driver unit in a corresponding SRAM Bank according to the row address signal, or the Booth multiplication in-memory calculation data block reads the weight data stored in the corresponding SRAM Bank through the read-write driver unit according to the row address signal; when the in-memory calculation array is in a calculation mode, the address decoder outputs a row address signal to a Booth multiplication in-memory calculation data block, and the Booth multiplication in-memory calculation data block reads the weight data in 64 SRAM Banks on the row address according to the row address signal, and each SRAM Bank stores 4-bit weight data;
[0041] The clock control module receives an external enable signal, outputs a state transition control signal to the address decoder, and outputs a read-write drive signal to the read-write drive unit. The address decoder determines the working mode of the internal computing array at the current moment according to the state transition control signal, and performs corresponding decoding operations; the read-write drive unit determines whether to read out weight data or write weight data at the current moment according to the read-write drive signal.
[0042] In a specific embodiment of the present invention, the input encoding module includes 64 Booth multiplication encoders, inputs a sign flag signal and 64 3-bit continuous data, and outputs 64 Booth operation control signals to 64 Booth calculation units; the 64 3-bit continuous data are 3-bit continuous data of any 64 data of all the data to be convolutionally calculated; the control signal of the Booth operation includes a shift enable signal SHIFT, a clear enable signal ZERO, a reverse enable signal INV and a triple multiplication enable signal TRIPLE.
[0043] When the sign flag signal is 1, if the input 3-bit data is 001 or 010, the shift enable signal SHIFT, the clear enable signal ZERO, the inverse enable signal INV and the triple multiplication enable signal TRIPLE are all 0; if the input 3-bit data is 011, the shift enable signal SHIFT is 1, the clear enable signal ZERO, the inverse enable signal INV and the triple multiplication enable signal TRIPL are all 0; if the input 3-bit data is 100, the clear enable signal ZERO and the triple multiplication enable signal TRIPLE are all 0, the shift enable signal SHIFT and the inverse enable signal INV are all 1; if the input 3-bit data is 101 or 110, the inverse enable signal INV is 1, the shift enable signal SHIFT, the clear enable signal ZERO and the triple multiplication enable signal TRIPLE are all 0; if the input 3-bit data is 000 or 111, the clear enable signal ZERO is 1.
[0044] When the sign flag signal is 0, if the input 3-bit data is 000 or 001, the clear enable signal ZERO is 1; if the input 3-bit data is 010 or 011, the shift enable signal SHIFT, the clear enable signal ZERO, the reverse enable signal INV and the triple multiplication enable signal TRIPLE are all 0; if the input 3-bit data is 100 or 101, the shift enable signal SHIFT is 1, the clear enable signal ZERO, the reverse enable signal INV and the triple multiplication enable signal TRIPL are all 0; if the input 3-bit data is 110 or 111, the shift enable signal SHIFT, the clear enable signal ZERO and the reverse enable signal INV are all 0, and the triple multiplication enable signal TRIPL is 1.
[0045] As a preferred solution of the present invention, the Booth multiplication in-memory calculation data block adopts a time-sharing multiplexing strategy, referring to Figure 2 As shown in the figure, it is the layout diagram of the 1Kb in-memory computing array in the device, which is arranged in a specification of 4 rows × 64 columns × 4 bits, and each column is a group of Booth multiplication in-memory computing data blocks. When the device is in storage mode, the selected SRAM Bank (SRAM group, the size is 1 row × 4 columns) is read or written by selecting the row select signal WL and the column select signal CSL at the same time. When the device is in computing mode, the column select signal CSL is all low, and the word line WL is turned on to select one of the rows to input 64 4-bit weight values into the BMCC (Booth computing unit) for Booth operation.
[0046] As a preferred embodiment of the present invention, the Booth computing unit (BMCC) circuit is as follows: Figure 3As shown. The Booth calculation unit can work in two modes: storage mode and calculation mode. In storage mode, the dual to single converter (DTSC) in the Booth calculation unit is not enabled, and the weight value on the bit line cannot be sampled. At this time, the input encoding module performs the encoding zero operation, so the clear enable signal ZERO input to the Booth calculation unit is "1", so the output Q[4:0] of the Booth multiplication memory calculation data block is always low; in calculation mode, DTSC is enabled, and one of the 64 SRAM sub-arrays turns on the word lines WL[3]-WL[0], and reads the 4-bit weight value stored in one row of the SRAM sub-array into the BMCC. After DTSC sampling, the weight value is input into the 5-bit shifter through the bus GBL[3:0]. The shifter determines whether to shift GBL[3:0] left by one bit according to the value of the shift enable signal. If the shift enable signal SHIFT=1, the weight value is shifted left by one bit, and the lowest bit is filled with "0". If the shift enable signal SHIFT = 0, the weight value is bit-extended according to the value of the sign flag SIGN. When the sign flag SIGN = 1, the sign bit is extended, and when the sign flag SIGN = 0, zero extension is performed. Then the shifter sends the processed 5-bit data to one end of the XOR gate unit, and the other end of the XOR gate unit is input as the reverse enable signal INV. From the XOR logic expression, we can get A⊕INV=A'·INV+A·INV'. When INV=1, A⊕INV=A'; when INV=0, A⊕INV=A. Therefore, the XOR gate unit inverts the 5-bit data according to the value of the reverse enable signal INV, and finally outputs Q[4:0].
[0047] As a preferred solution of the present invention, the Booth multiplication encoder is constructed based on the principle of Booth encoding. Figure 4 and Figure 5 , which are the circuit structure diagram and operation truth table of the Booth multiplication encoder respectively. The design adds a "0" at the end of the n-bit input INPUT, and then inputs the INPUT into the encoding circuit step by step from MSB (Most Significant Bit) to LSB (Least Significant Bit) with a bit width of 3 bits each time. The encoding circuit encodes the following control signals according to the value of the input data and the sign flag SIGN (sign flag signal): reverse enable signal INV, shift enable signal SHIFT, clear enable signal ZERO, and triple multiplication enable signal TRIPLE. These signals are combined to drive the Booth calculation unit and the bit expansion unit to perform corresponding operations, thereby outputting the correct partial product. As Figure 5As shown, when the sign flag SIGN=1, the system performs Booth multiplication, and the encoding circuit performs Booth encoding on the input data according to the Booth encoding principle. It can be seen that if the clear enable signal ZERO=1, the multiplier (weight value) is cleared regardless of the values of the other three control signals. If the clear enable signal ZERO=0, if only the shift enable signal SHIFT=1, the multiplier is doubled; if only the reverse enable signal INV=1, the multiplier is complemented; if the shift enable signal SHIFT and the reverse enable signal INV are both 1, the multiplier is first doubled and then the complement code is taken; if the shift enable signal SHIFT and the reverse enable signal INV are both 0, no operation is performed on the multiplier. When the sign flag SIGN=0, the system performs arithmetic multiplication, and the encoding module performs arithmetic encoding only according to the upper two bits of the 3-bit input. When the two upper data bits are "00", the multiplier is cleared; when the two upper data bits are "01", the multiplier is not operated; when the two upper data bits are "10", the multiplier is doubled; when the two upper data bits are "11", the multiplier is tripled.
[0048] The Booth multiplication encoder is constructed based on the principle of Booth encoding. The principle of Booth encoding is: for the multiplication of an m-bit signed number x and an n-bit signed number y, the binary complement of the n-bit signed number y can be expressed as:
[0049]
[0050] From the above expression, it can be inferred that by encoding the continuous three bits of data y (i.e. y i-1 ,y i , 2y i+1 ), the following five partial products can be obtained: 0, x, -x, 2x and -2x. Then, according to the bit weight of the current processing bit, the obtained partial product is shifted to the left by i bits (i is an even number). Finally, all partial products are summed to obtain the product of x and y. Similarly, when the digital in-memory computing device performs calculations, the input data is shifted to the right by two bits each time from high to low bits according to a 3-bit width, and the data is gradually sent to the Booth multiplication encoder for encoding. The encoded control signal drives the Booth multiplication in-memory computing processor to perform calculations with the weight values stored inside it. The partial sum generated by the high-weight data will be shifted to the left by two bits each time. Through repeated iterations of multiple cycles, a pipelined Booth multiplication operation is realized.
[0051] As a preferred solution of the present invention, the adder circuit adopts a hybrid parallel adder tree in which 11-tube full adders and 28-tube full adders are operated alternately. Compared with the proposed parallel adder tree structure in which 14-tube full adders and 28-tube full adders are mixed, the 14-tube full adder is replaced by an 11-tube full adder, which further reduces the area and power consumption of the adder tree. Figure 6 As shown in the figure, compared with the traditional 28-tube full adder and 14-tube full adder, the 11-tube full adder simplifies part of the calculation logic, making it not only smaller in area, but also has the advantages of low latency and low power consumption, which is very suitable for the design of high energy efficiency adder tree. However, the 11-tube full adder also has the disadvantage of threshold loss. If all 11-tube full adders are used to build a parallel adder tree, in the case of multi-stage cascade of adder units, the output voltage of the subsequent adder unit may have a large threshold loss, resulting in incorrect calculation results. Therefore, the parallel adder tree is finally realized by alternating the operation of 11-tube full adders and 28-tube full adders. The hybrid adder tree not only uses two full adders to alternately realize the adder unit in the horizontal direction, but also uses an alternating method to realize the progression within the adder tree in the vertical direction, which fully reduces the area and power consumption of the adder tree and improves the energy efficiency of the in-memory computing architecture.
[0052] Reference Figure 7 As shown in the figure, it is a schematic diagram of the internal structure of the entire Booth multiplication in-memory calculation processor (BM-CIM Macro). The working process of BM-CIM Macro is as follows: the weights in the device are divided into four groups, and the weight values stored in the same row of the SRAM subarray of the in-memory calculation array are the same weight set. When the device performs a convolution calculation operation, one of the rows of the SRAM subarray is turned on to send a set of weight sets to the Booth multiplication calculation unit (BMCC) for Booth operation. The BMCC outputs the 64 groups of intermediate calculation results after the operation to the bit extension unit for bit extension operation, and outputs 64 groups of 6-bit intermediate products to the adder tree unit. Since the number of parallel operation groups in the device is reduced due to time-sharing multiplexing, the circuit scale of the adder tree unit is reduced. It only needs to go through 6 levels of step-by-step accumulation to output the 12-bit partial sum PSUM to the accumulator unit. The accumulator unit captures the partial sum PSUM and performs bit extension on it. "If the partial sum PSUM is a signed number, its sign bit (highest bit) is extended. If the partial sum PSUM is an unsigned number, it is zero-extended." At the same time, the number of operation groups configured in the device determines whether to shift the accumulated SUM value two bits to the left, and then add the two processed addends. After multiple cycle iterations, a 20-bit convolution calculation result R is obtained through clock sampling.
[0053] The accumulator unit needs to complete three operations: (1) Sample the partial sum PSUM output by the adder tree unit in the current cycle and perform bit expansion on the partial sum PSUM; (2) Shift the accumulated value SUM obtained in the previous N cycles to the left by two bits (1≤N≤4), where N can be configured according to the scale of the applied convolutional neural network; (3) Add the partial sum PSUM after bit expansion to the accumulated value SUM after shifting to obtain a new accumulated value SUM and temporarily store it in the accumulator unit. (4) Repeat the above operations (1)-(3) through several cycles, and finally sample and output the convolution operation and output R. Therefore, relying on the characteristics of the accumulator's dynamic configuration shift cycle, when performing a convolution operation, the device can adjust the number of operation groups according to the scale of the applied convolutional neural network, thereby realizing a reconfigurable convolution operation.
[0054] As a solution of the present invention, the reconfigurable convolution operation timing is as follows: Figure 8 As shown, for large-scale networks, the device may need to process four different sets of weights at the same time. In this case, the device will input calculation data with the same bit weight in four consecutive clock cycles. These four sets of calculation data are calculated with four sets of weight sets in turn to generate four sets of 12-bit partial sum outputs. The bit weights of these partial sums are also the same. Since the bit weights are the same, the accumulator does not need to shift in these four cycles. It simply accumulates these partial sums. When the bit weight of the input data changes in the fifth clock cycle, the accumulator will activate the shift signal, shift the previously accumulated result two bits to the left, and add it to the new partial sum. Therefore, in the case of large-scale networks, the accumulator shifts once every four clock cycles. In contrast, for small-scale convolutional neural networks, the system may only need to process one set of weights. At this time, the bit weight of the input data will change after each clock cycle, so the accumulator will perform a shift operation after each clock cycle to adapt to the rapidly changing data bit weights. In summary, the architecture can flexibly adjust the number of groups of convolution calculations in order to efficiently process convolutional neural networks of different sizes from small to large, thereby optimizing computing resources and improving processing efficiency.
[0055] Reference Fig. 9As shown in the figure, it is a transient simulation waveform diagram when the Booth multiplication in-memory calculation data block (BMCDB) performs calculation operation. Before the calculation operation is performed, 4 sets of weight values are pre-stored in the SRAM sub-array (4×4), which are 0111, 0111, 1000 and 0001. Then, in four consecutive operation cycles, the 4 sets of weight values are sent to the BMCDB for calculation in turn, and the input data in the four cycles are 110, 110, 111 and 010 respectively. The Booth encoding result of 110 in the first cycle and the second cycle is "-x", so 0111 is complemented and the sign bit is extended to obtain the 6-bit intermediate product 111001. The Booth encoding result of 111 in the third cycle is "0", so the intermediate product output is cleared to 000000. The Booth encoding result of 010 in the fourth cycle is "x", so the intermediate product is the sign bit extension of 0001, that is, 000001.
[0056] like Fig.10 As shown in the figure, it is a transient simulation waveform diagram when the device performs convolution operation. During the test, all input data IN is 4 bits (that is, the data actually used for convolution operation is 4 bits, and the data input to the input encoding module is the continuous 3 bits of the 4 bits, and the insufficient data is supplemented by 0), the number of convolution calculation groups is 64×64 groups, and the input data is input 2 bits into the architecture for operation in each operation cycle starting from the MSB. The input with bit weight IN<3:2> is sequentially input into the architecture in four consecutive operation cycles, and the corresponding partial sum is calculated through multiplication and accumulation operation. When the input bit weight changes to IN<1:0> in the fifth cycle, the partial sum generated by IN<3:2> is shifted two bits to the left and accumulated with the partial sum generated by IN<1:0>. Finally, after nine operation cycles, the final 20-bit convolution calculation result R is output. It can be seen from the waveform that the calculation valid signal ACTIVE is set to "1" at 517ns, and the sign flag SIGN is valid. At this time, the system starts to perform multiplication and accumulation operation based on Booth coding. During the calculation process, multiple groups of intermediate products P and partial sums PSUM are continuously flipped. After 8 operation cycles, all 4-bit IN inputs are completed, and the shift accumulator sets the calculation completion signal DONE to "1", enabling the trigger in the accumulator to sample the final calculation result, and outputs the 20-bit convolution calculation result R at 535ns.
Claims
1. A reconfigurable digital in-memory computing device based on multiplexed Booth computing units and 6T-SRAM, characterized in that: Includes 1 input encoding module and 64 Booth multiplication in-memory computing processors; The input encoding module obtains a control signal for Booth operation from an external sign flag signal and 64 3-bit continuous data; The Booth multiplication in-memory calculation processor includes an in-memory calculation array, a bit extension unit, an adder tree unit and an accumulator unit, wherein the in-memory calculation array is composed of 1 row and 64 columns of Booth multiplication in-memory calculation data blocks, each of which includes an SRAM subarray and a Booth calculation unit, and the SRAM subarray is composed of 4 rows and 4 columns of 6T-SRAM units; The in-memory computing array has two working modes: storage mode and computing mode. In the storage mode, the in-memory computing array stores externally input weight data, and the weight data is stored in the 6T-SRAM unit of the SRAM subarray. In the calculation mode, the Booth calculation unit receives the control signal of the Booth operation and performs calculation according to the weight data stored in the SRAM subarray to obtain 64 intermediate calculation results. The bit extension unit performs a bit extension operation on the 64 intermediate calculation results to obtain 64 6-bit intermediate products. The adder tree unit accumulates the intermediate products to obtain partial sums. The accumulator unit performs shift accumulation on the partial sums and outputs a 20-bit convolution calculation result.
2. The device according to claim 1, characterized in that The Booth multiplication in-memory calculation data block adopts a time-sharing multiplexing method for calculation. Each SRAM subarray is composed of four SRAM Banks, and each SRAM Bank is composed of 1 row and 4 columns of 6T-SRAM units. The four SRAM Banks in a Booth multiplication in-memory calculation data block time-sharingly multiplex a Booth calculation unit, and the Booth calculation unit performs multiplication operations.
3. The device according to claim 2, characterized in that The Booth multiplication in-memory computing processor also includes a read-write driver unit, which is used to control the read and write operations of the in-memory computing array.
4. The device according to claim 3, characterized in that The device also includes an address decoder and a clock control module; The address decoder receives an externally input address signal. When the in-memory calculation array is in a storage mode, the address decoder outputs a column address signal to a read / write driver unit, and the read / write driver unit reads or writes the weight data into a corresponding Booth multiplication in-memory calculation data block according to the column address signal; the address decoder outputs a row address signal to a Booth multiplication in-memory calculation data block, and the Booth multiplication in-memory calculation data block stores the weight data written by the read / write driver unit in a corresponding SRAM Bank according to the row address signal, or the Booth multiplication in-memory calculation data block reads the weight data stored in the corresponding SRAM Bank through the read / write driver unit according to the row address signal; when the in-memory calculation array is in a calculation mode, the address decoder outputs a row address signal to a Booth multiplication in-memory calculation data block, and the Booth multiplication in-memory calculation data block reads the weight data in 64 SRAM Banks on the row address according to the row address signal, and each SRAM Bank stores 4-bit weight data; The clock control module receives an external input enable signal, outputs a state conversion control signal to the address decoder, and outputs a read-write drive signal to the read-write drive unit. The address decoder determines the working mode of the internal computing array at the current moment according to the state conversion control signal, and performs corresponding decoding operations; The read / write drive unit determines whether to read out the weight data or write the weight data at the current moment according to the read / write drive signal.
5. The device according to claim 1, characterized in that The 64 3-bit continuous data are continuous 3-bit data of 64 values to be convolution calculated in the same group among the 64*N values to be convolution calculated, and the bit weight of each continuous 3-bit data is the same; the 64*N values to be convolution calculated are all in binary format, where N is an array, 1≤N≤4.
6. The device according to claim 1, characterized in that The input encoding module includes 64 Booth multiplication encoders, inputs a sign flag signal and 64 3-bit continuous data, and outputs 64 Booth operation control signals to 64 Booth calculation units; The control signals of the Booth operation include a shift enable signal SHIFT, a clear enable signal ZERO, an inversion enable signal INV and a triple multiplication enable signal TRIPLE.
7. The device according to claim 6, characterized in that When the sign flag signal is 1, if the input 3-bit data is 001 or 010, the shift enable signal SHIFT, the clear enable signal ZERO, the inverse enable signal INV and the triple multiplication enable signal TRIPLE are all 0; if the input 3-bit data is 011, the shift enable signal SHIFT is 1, the clear enable signal ZERO, the inverse enable signal INV and the triple multiplication enable signal TRIPL are all 0; if the input 3-bit data is 100, the clear enable signal ZERO and the triple multiplication enable signal TRIPLE are all 0, the shift enable signal SHIFT and the inverse enable signal INV are all 1; if the input 3-bit data is 101 or 110, the inverse enable signal INV is 1, the shift enable signal SHIFT, the clear enable signal ZERO and the triple multiplication enable signal TRIPLE are all 0; if the input 3-bit data is 000 or 111, the clear enable signal ZERO is 1.
8. The device according to claim 7, characterized in that When the sign flag signal is 0, if the input 3-bit data is 000 or 001, the clear enable signal ZERO is 1; if the input 3-bit data is 010 or 011, the shift enable signal SHIFT, the clear enable signal ZERO, the reverse enable signal INV and the triple multiplication enable signal TRIPLE are all 0; if the input 3-bit data is 100 or 101, the shift enable signal SHIFT is 1, the clear enable signal ZERO, the reverse enable signal INV and the triple multiplication enable signal TRIPL are all 0; if the input 3-bit data is 110 or 111, the shift enable signal SHIFT, the clear enable signal ZERO and the reverse enable signal INV are all 0, and the triple multiplication enable signal TRIPL is 1.
9. The device according to claim 5, characterized in that The specific calculation steps of the accumulator unit are: 1) The accumulator unit receives the partial sum output by the adder tree in the current clock cycle and performs bit extension; 2) adding the partial sum after bit expansion to the accumulated value stored in the accumulator, and if the accumulated value in the current clock cycle is the accumulated value obtained by accumulating the partial sums of the previous N clock cycles, two zeros are added after the value of the accumulated value, and the accumulated value after the two zeros are added to the partial sum after bit expansion, and the result of the addition is stored in the accumulator as a new accumulated value; If the accumulated value in the current clock cycle is not the accumulated value obtained by accumulating the partial sums of the previous N clock cycles, the partial sum after bit extension is added to the accumulated value, and the result of the addition is stored in the accumulator as a new accumulated value; 3) Repeat step 1) and step 2) until all the 64*N partial sums are accumulated, and the accumulator finally outputs a 20-bit convolution calculation result.
Citation Information
Patent Citations
Computing system and method based on sram in-memory computing array
CN114063975A
In-memory computing circuit based on reusable Booth multiplication unit
CN116959517A
Semiconductor device performing operational processing
US20100179976A1
Cited By
Mixed domain multiply-accumulate calculation circuit based on bit rotation input
CN119598937A
Memory device and memory operation method
TWI907264B
