Binary floating point multiplication device in memory and operation method thereof
By designing a floating-point decoder, exponential adder and multiplication circuit in the memory, a single-step floating-point multiplication is realized, which solves the problems of high power consumption and low efficiency caused by data transmission and storage in floating-point multiplication operations, and improves calculation efficiency. Efficiency and speed.
Patent Information
- Application Number
- CN202410203898.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-11-02
- Filing Date
- 2024-02-23
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-02-23
AI Technical Summary
In the existing technology, floating-point multiplication operations require multiple data transmissions and intermediate result storage, resulting in high computing power consumption and low computing efficiency, and easily triggering a Van Newman-type bottleneck.
Design an in-memory binary floating-point multiplication device, including a floating-point decoder, an exponential adder, an in-memory multiplication circuit and an encoder. It completes floating-point multiplication through a single step operation and avoids intermediate data being stored in the ALU, memory unit and temporary transfer between registers.
It significantly reduces power consumption, avoids bus line congestion, improves computing speed and saves computing time, and is suitable for floating point calculations of different precisions.
Smart Images

Figure CN118245017B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an in-memory binary floating-point multiplication device having two binary floating-point operands. In particular, in order to achieve a single-step floating-point multiplication operation to improve operation efficiency and save operation power, the in-memory binary floating-point multiplication device of the present invention comprises: (1) two binary floating-point decoders for converting the exponent bits of two input floating-point operands into the most significant bits (MSBs) of two p-bit significands; p-1 / b p-1 ; (2) multiple memory arrays for storing 2 n (1) a carry multiplication table for performing multiplication operations on the significand; (2) an adder circuit for performing addition operations on the exponent; and (3) a binary floating-point encoder for converting the 2p-bit product digital number generated by the multiplication of two p-bit significands into a standard binary (p-1)-bit significand digital number in accordance with the IEEE754 format for subsequent operations or storage. Background Art
[0002] like Figure 1 In the modern Von Neumann computing architecture shown, a central processing unit (CPU) 10 performs logic operations based on instructions and data from a main memory 11. The CPU 10 includes a main memory 11, an arithmetic and logic unit (ALU) 12, an input / output device 13, and a program control unit 14. Before the computation process, the CPU 10 is set by the program control unit 14 to point to the initial address code of the initial instruction stored in the main memory 11. Thereafter, the ALU 12 processes the digital data according to the sequential instructions of the main memory 11 accessed by the clock-synchronized address pointer in the program control unit 14. Generally speaking, the digital logic operations of the CPU 10 are executed synchronously and driven by a set of sequential instructions that are pre-written and stored in the memory.
[0003] In digital electronic computer systems based on the Van Neumann arithmetic architecture, all numbers are represented in binary format. For example, an integer I is represented in m-bit binary format as follows:
[0004] I=b m-1 2m-1 +b m-2 2 m-2 +…+b12 1 +b0=(b m-1 b m-2 …b1b0)b,
[0005] Among them, b i =[0,1], i=0,…,(m-1), and the symbol b represents that the integer I is represented in binary format.
[0006] In a circuit processor, arithmetic operations such as multiplication, addition, subtraction and division of binary numbers require the manipulation of binary codes of multiple operands to obtain the correct binary representation of the final value. The manipulation of the binary codes of the operands includes feeding the binary codes of the operands into different combinatorial logic gates and placing the binary code data of the operands in the correct locations in the registers and memory cells of the IC processor chip. Therefore, the more operation steps there are to move the binary codes in and out of different memory cells, registers and combinatorial logic gates through the connected bus lines, the more computing power is consumed. In particular, when the computing processor operates at the bit-level of the code string with a fixed bandwidth bus, as the number of operation steps increases, the power consumption caused by the charging and discharging of the capacitors of the connected bus lines, logic gates, registers and memories will increase significantly, and the power consumption can be expressed by the mathematical formula P~f×C×V DD 2 , where f represents the step cycle of each process time period, C represents the total relevant charge and discharge capacitance value during the entire operation, and V DDstands for high supply voltage. For example, the multiplication of two integers (represented by two n-bit binary codes) is usually performed using the so-called multiply-accumulate (MA) procedure: initially, each single bit of an n-bit operand is multiplied (AND operation) with another n-bit operand to obtain n n-bit binary codes stored in a register; each n-bit binary code is shifted to the correct position of n rows of 2n-bit registers; in each row of 2n-bit registers, the empty bit registers are filled with zeros; for the n 2n-bit code strings in the register, (n-1) steps of addition operation are performed to obtain the multiplied 2n-bit binary code string. Therefore, the processing power of the processor is increased because the transmission of intermediate data and instruction codes is mainly a lengthy step of bit-level operations using a fixed-bandwidth bus (currently in 8-bit, 16-bit, 32-bit, 64-bit format). More computational operations also mean that the fixed-bandwidth bus must be used more frequently to transfer intermediate data and instruction codes. The heavy flow of moving data and instruction codes in and out of different memory cells, logic gates, and registers, like pipeline processing, can also cause processor bus congestion. The so-called Van Newman bottleneck caused by bus congestion due to heavy data flow is the main cause of computing process slowdowns.
[0007] From the perspective of software programming, the desired single-step operation (completed in a single clock cycle) can simplify the processor's operation algorithm and program instructions. Furthermore, the single-step multiplication operation can reduce the storage memory space for intermediate data and additional instruction codes, thereby reducing the chip memory area of the IC processor chip.
[0008] In the patent document of Chinese Patent Application Publication No. 113918119A (the contents of the above patent are hereby quoted as a part of the contents of this specification), a multiple digit binary multiplication device in a memory includes a memory array for storing 2 nThe invention provides a binary floating-point multiplication device in memory having two binary floating-point operands. In particular, in the binary floating-point multiplication device in memory of the invention, the multi-digit binary multiplication device in memory disclosed in the above patent document (China Patent Application Publication No. 113918119A) is used to perform a significand multiplication operation, and the binary floating-point multiplication device in memory of the invention further includes two binary floating-point decoders and an exponent addition circuit to achieve a single-step floating-point multiplication operation. To enhance computing efficiency and save computing power, the in-memory binary floating-point multiplication device of the present invention can achieve a single-step floating-point multiplication operation (completed within a single clock cycle) to completely eliminate multiple data transmissions between the multiplication unit, temporary data storage and memory unit in the existing circuit processor. Summary of the invention
[0009] In view of the problems in the prior art, the present application provides an in-memory binary floating-point multiplication device and an operation method thereof.
[0010] In order to solve the above technical problems, this application provides the following technical solutions:
[0011] In a first aspect, the present application provides an in-memory floating-point multiplication device for performing a multiplication operation on a multiplicand and a multiplier to generate a first product value, wherein the multiplicand, the multiplier and the first product value are all binary floating-point numbers in accordance with the IEEE 754 format and all include a sign bit, a q-bit exponent and a (p-1)-bit significand, the device comprising:
[0012] an exclusive OR gate device, for receiving the sign bits of the multiplicand and the multiplier to generate the sign bit of the first product value;
[0013] a decoder circuit for generating a first prefix bit according to the q-bit exponent of the multiplicand and a second prefix bit according to the q-bit exponent of the multiplier, wherein the first prefix bit and the (p-1)-bit significand of the multiplicand form a first p-bit significand, and the second prefix bit and the (p-1)-bit significand of the multiplier form a second p-bit significand;
[0014] an exponent adder circuit for adding the q-bit exponents of the multiplicand and the multiplier to generate a (q+1)-bit temporary exponent;
[0015] an in-memory binary multiplication circuit for performing a multiplication operation on the first p-bit effective number and the second p-bit effective number to generate a 2p-bit second product value; and
[0016] An encoder circuit is configured to (1) distinguish a target bit position from the most significant p bits of the 2p-bit second product value and convert the target bit position into a shift distance z, and (2) calculate a shift distance z according to the (q+1)-bit temporary index and a value (2-2 q-1 -z), computing a q-bit exponent of the first product value and (3) shifting the 2p-bit second product value left by z bit positions to produce a (p-1)-bit significand of the first product value;
[0017] wherein the target bit position comprises a non-zero value and is closest to the most significant bit position of the 2p-bit second product value; and
[0018] Among them, 0<=z<=(p-1) and (p+q)>=8.
[0019] In a first aspect, the present application provides a method for operating an in-memory floating-point multiplication device, wherein the in-memory floating-point multiplication device performs a multiplication operation on a multiplicand and a multiplier to generate a first product value, wherein the in-memory floating-point multiplication device comprises an in-memory binary multiplication circuit and an encoder circuit, wherein the multiplicand, the multiplier and the first product value are all binary floating-point numbers conforming to the IEEE 754 format and all comprise a sign bit, a q-bit exponent and a (p-1)-bit significand, and the method comprises:
[0020] Performing an exclusive OR operation on the sign bits of the multiplicand and the multiplier to obtain the sign bit of the first product value;
[0021] According to the q-bit exponent of the multiplicand and the q-bit exponent of the multiplier, a first pre-position bit and a second pre-position bit are obtained respectively, so that the first pre-position bit and the (p-1)-bit significant number of the multiplicand form a first p-bit significant number, and the second pre-position bit and the (p-1)-bit significant number of the multiplier form a second p-bit significant number;
[0022] Adding the q-bit exponents of the multiplicand and the multiplier to obtain a (q+1)-bit temporary exponent;
[0023] Using the binary multiplication circuit in the memory, multiply the first p-bit effective number and the second p-bit effective number to generate a 2p-bit second product value;
[0024] Using the encoder circuit, a target bit position is discerned from the most significant p bits of the 2p-bit second product value to convert the target bit position into a shift distance z;
[0025] The encoder circuit is used to generate a (q+1)-bit temporary index and a value (2-2 q-1 -z), calculating the q-bit exponent of the first product value; and
[0026] Using the encoder circuit, shifting the 2p-bit second product value left by z bit positions to generate a (p-1)-bit significand of the first product value;
[0027] wherein the target bit position comprises a non-zero value and is closest to the most significant bit position of the 2p-bit second product value; and
[0028] Among them, 0<=z<=(p-1) and (p+q)>=8.
[0029] The in-memory binary floating-point multiplication device 20 of the present invention performs a single-step floating-point multiplication operation of two carry floating-point numbers without storing and transmitting intermediate data between the ALU, memory unit and register, thereby significantly reducing power consumption. Also, because the present invention performs a single-step floating-point multiplication operation in the memory unit (through in-memory processing / computing), there is no need to move intermediate data in and out of the memory unit, so it can avoid occupying bus line hardware (which may cause bus line congestion or the so-called Van Newman bottleneck in the electronic computer), thereby improving the operation rate and saving operation power and time. By using a read-only memory (ROM) array to (1) store an n-bit to n-bit multiplication table ( Figure 7-8 ) and (2) converting the identified leading non-zero bit position z into binary format, and by using a specific adder to manipulate the output data of the multiplication table and the q-bit exponents of the multiplicand and the multiplier, the present invention improves the field of "in-memory processing / operation". In particular, no matter what kind of precision floating point number the electronic computer system is, the ROM array storing the n-bit by n-bit multiplication table remains reasonably small, so that a small silicon area and a sufficiently high processing speed can be appropriately maintained. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 A Van Neumann-type computing architecture of a conventional CPU is shown.
[0032] Figure 2 A schematic diagram of an in-memory binary floating point multiplication device 20 for implementing a two-binary floating point multiplication operation according to the present invention.
[0033] Figure 3 A schematic diagram of a signed multiplication circuit 200 for implementing a sign operation of two binary floating point multiplication operations according to the present invention.
[0034] Figure 4a -b is a schematic diagram of floating point decoders 210a and 210b respectively implementing the generation of the MSB of a significand from the exponent bits of a floating point number according to the present invention.
[0035] Figure 5 A schematic diagram of a carry-chained exponential adder circuit for implementing exponential addition of two binary floating-point numbers according to the present invention.
[0036] Figure 6 according to Figure 7 The n-bit to n-bit multiplication table shows the memory used to output the product code of two n-bit input codes. n Schematic diagram of a carry permanent digital perceptron (PDP) multiplier unit 600 .
[0037] Figure 7 Displays a 2n-bit binary product code of a multiplication table stored in a memory with two n-bit input binary operands 2 n Carry PDP multiplier unit 600.
[0038] Figure 8 According to an embodiment of the present invention for single precision floating point multiplication operation, an 8-bit binary product code of a multiplication table is shown, which is stored in a memory with two 4-bit (n=4) input binary operands. n Carry PDP multiplier unit 600.
[0039] Fig. 9 According to an embodiment of the single precision floating point multiplication operation of the present invention, a 6-bit number 2 in a memory for implementing a significant digit multiplication operation of two floating point operands is shown. 4 Schematic diagram of carry multiplier circuit 250A.
[0040] Fig.10 According to an embodiment of the single-precision floating-point multiplication of the present invention, it is shown that Fig. 9 Schematic diagram of a carry-chain binary adder BA 920(j) for generating the j-th polynomial binary code (7 digits to 4 bits), where j=0,1,2,3,4,5.
[0041] Fig.11 According to an embodiment of the single-precision floating-point multiplication operation of the present invention, it is shown Fig. 9 Schematic diagram of a carry chain polynomial binary adder PBA 930(i) for performing addition operation on the above six polynomial binary codes, where i=0,1,2,3,4.
[0042] Fig.12 According to the present invention, a schematic diagram of a floating point encoder circuit 270 is shown, wherein the circuit 270 is used to convert a floating point product number into a standard IEEE 754 format to facilitate subsequent data operations.
[0043] Fig.13 According to an embodiment of the present invention for single precision floating point multiplication, a schematic diagram of a floating point encoder circuit 270A is shown, wherein the circuit 270A is used to convert floating point product numbers into a standard IEEE 754 format.
[0044] Fig.14 According to an embodiment of the single-precision floating-point multiplication operation of the present invention, a coding table for different numbers z of left shift positions of a 24-bit significant number is illustrated.
[0045] Fig.15 A schematic diagram of the barrel shifter 1340 is shown according to an embodiment of the present invention for single precision floating point multiplication.
[0046] Fig.16 A schematic diagram of the addition / subtraction circuit 1330 is shown according to an embodiment of the single-precision floating-point multiplication of the present invention.
[0047] Reference numerals:
[0048] 10 CPU
[0049] 11 Main Memory
[0050] 12 Arithmetic and Logic Unit
[0051] 13 Output / Input Devices
[0052] 14 Program control unit
[0053] 20 In-memory binary floating-point multiplication device
[0054] 21, 22 Data register
[0055] 23 Output register
[0056] 25, 26, 201, 211a, 211b, 218, 221, 222, 228, 231 nodes
[0057] 232, 241, 251, 261, 605, 921,,, nodes
[0058] 200 Sign multiplication circuit
[0059] 210a, 210b "Binary Multiplication" nodes
[0060] 212a, 212b Reverse
[0061] 217, 227 "Symbol" node
[0062] 218, 228 "Index" node
[0063] 219, 229 Binary Multiplication Node
[0064] 220, 230, 260 registers
[0065] 240 Exponential Addition Circuit
[0066] 250 Binary multiplication circuit in memory
[0067] 250A 6-digit number in memory 2 4 Carry multiplier circuit
[0068] 270 Floating point encoder circuit
[0069] 270A Single Precision Floating Point Encoder
[0070] 271 Connection Nodes
[0071] 271e Node for outputting exponent bits
[0072] 271s Node that outputs valid digits
[0073] 600 Memory 2 n Carry PDP Multiplier Unit
[0074] 620 CROM Array
[0075] 621 Matching Line
[0076] 630 Matching Detector Unit
[0077] 631 Word Line
[0078] 640 RROM array
[0079] 910 PDP Multiplier Cell Array
[0080] 910(0)~(35) Memory 2 4 Carry PDP Multiplier Unit
[0081] 920(j), 920(0)~(5) Binary adder
[0082] 930(i), 930(0)~(4) Polynomial Binary Adder
[0083] 1210, 1310 Leading Zero Detector
[0084] 1220, 1320 position shift encoder
[0085] 1230, 1330 Addition / Subtraction Circuits
[0086] 1240, 1340 barrel shifter
[0087] 1501 Transmission Gate
[0088] 1610 Binary Addition Circuit
[0089] 1620 Binary Subtraction Circuit
[0090] 1611, 1612, 1613, 1621, 1623, 1622 logic gate circuit elements DETAILED DESCRIPTION
[0091] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0092] The following detailed description is for illustrative purposes only and is not intended to be limiting. It should be understood that other embodiments may be used and that various modifications or changes may be made to the structure, all of which shall fall within the scope of the claims of the present invention. Furthermore, it should be understood that the grammar and terminology used in this specification are for illustrative purposes only and shall not be considered limiting. Those familiar with the art shall understand that the embodiments of the methods and schematic diagrams in this specification are for illustrative purposes only and are not intended to be limiting. Those familiar with the art who understand the spirit of the present invention as a result of the disclosure of this specification may use other embodiments, all of which shall fall within the scope of the claims of the present invention. For clarity and convenience of description, in the following examples and embodiments, circuit elements with the same functions use the same reference symbols.
[0093] According to the IEEE 754 binary floating point format code, a binary floating point number A is represented by a sign bit sa, a q-bit exponent ea, and a p-bit significand a as follows:
[0094]
[0095] Where ea=(ea q-1 2q-1 +ea q-2 2 q-2 +…+ea12 1 +ea02 0 )-2 q-1 +1, and
[0096]
[0097] Among them, the binary numbers sa and ea i and a j =[0,1]; i = 0, 1, ..., (q-1) and j = 0, 1, ..., (p-1); the symbol f represents the floating point format.
[0098] Please note that because the exponent ea i (where i = 0, 1, ..., (q-1)) is decoded to represent a subnormal floating point number (all ea i =0) p-1 = 0) and represents a normal floating point number (with any non-zero ea i ) is a binary value (a p-1 =1), usually when a floating point number is stored or transmitted, the most significant bit (MSB) of the significand is not included. p-1 , therefore, the total number of bits used to store and transmit the floating point number remains (p+q) bits. For example, in a computer system, floating point 8 uses 8 bits (p+q=8) to store a floating point number, half-precision floating point uses 16 bits (p+q=16) to store a floating point number, single-precision floating point uses 32 bits (p+q=32) to store a floating point number, double-precision floating point uses 64 bits (p+q=64) to store a floating point number, quadruple-precision floating point uses 128 bits (p+q=128) to store a floating point number, octuple-precision floating point uses 256 bits (p+q=256) to store a floating point number, and so on. Before performing binary arithmetic operations, the floating point decoder in the computing hardware is used to extract the exponent bits (ea0,…,ea q-1 )bDecode the MSB of the valid number a p-1 The binary value of .
[0099] The format of the binary floating point number A is the same as above. The binary floating point number B is represented by a sign bit sb, a q-bit exponent eb, and a p-bit significand b as follows:
[0100]
[0101] Where eb=(eb q-1 2 q-1 +eb q-2 2 q-2 +…+eb12 1 +eb02 0 )-2 q-1 +1, and
[0102]
[0103] Among them, the binary numbers sb and eb i and b j = [0, 1]; i = 0, 1, ..., (q-1) and j = 0, 1, ..., (p-1); the symbol f represents the floating point format. Therefore, the floating point number M is the product of A and B, which is expressed as follows:
[0104]
[0105] as well as
[0106]
[0107] Comparing the above two equations for the floating point number M, we can obtain the symbol sm=(sa+sb), the exponent em=(ea+eb) of M, and the binary multiplication of the two p-bit significant digits of A and B as follows: (m 2p-1 ,…,m p ,m p-1 ,…,m0)b=(a p-1 ,a p-2 ,…,a1,a0)b×(b p-1 ,b p-2 ,…,b1,b0)b
[0108] Based on the above equations of sign, exponent and significand related to the floating-point multiplication operation of two floating-point operands, the inventors have designed a binary floating-point multiplication device 20 in the memory of the present invention that can achieve a single-step floating-point multiplication operation, such as Figure 2 shown. Figure 2 In the example, the two floating point numbers A=(sa,ea) stored in the data registers 21 and 22 are respectively q-1 ,..,ea o ,a p-2 ,..,a0) and B=(sb,eb q-1 ,..eb0,b p-2,…,b0), is input to a sign multiplication circuit 200 through the “sign” nodes 217 and 227, is input to an exponential adder circuit 240 through the “exponent” nodes 218 and 228, and is input to an exponential adder circuit 240 through the “binary multiplication” nodes 219 and 229 together with the outputs (a1,b2) of the floating-point decoders 210a and 210b. p-1 and b p-1 ) are inputted together into a binary multiplication circuit 250 in a memory. Therefore, the output voltage signals of the exponential adder circuit 240 and the binary multiplication circuit 250 in the memory are transmitted to the floating point encoder circuit 270 to convert the final code into a standard IEEE 754 floating point format code. The voltage signal generated by the floating point encoder circuit 270 at the connection node 271 (including the node 271e for outputting the exponent bit and the node 271s for outputting the significand bit) is stored in the (p+q)-bit output register R 23 together with the "sign" voltage signal generated by the sign multiplication circuit 200 at the output node 201. Please note that the existence of the registers 220, 230 and 260 in the device 20 is only used to illustrate the voltage signals of the intermediate data between the connection nodes. In actual implementation, the above-mentioned registers can be removed.
[0109] The in-memory binary floating-point multiplication device 20 of the present invention performs a single-step floating-point multiplication operation of two carry floating-point numbers without storing and transmitting intermediate data between the ALU, memory unit and register, thereby significantly reducing power consumption. Also, because the present invention performs a single-step floating-point multiplication operation in the memory unit (through in-memory processing / computing), there is no need to move intermediate data in and out of the memory unit, so it can avoid occupying bus line hardware (which may cause bus line congestion or the so-called Van Newman bottleneck in the electronic computer), thereby improving the operation rate and saving operation power and time. By using a read-only memory (ROM) array to (1) store an n-bit to n-bit multiplication table ( Figure 7-8 ) and (2) converting the identified leading non-zero bit position z into binary format, and by using a specific adder to manipulate the output data of the multiplication table and the q-bit exponents of the multiplicand and the multiplier, the present invention improves the field of "in-memory processing / operation". In particular, no matter what kind of precision floating point number the electronic computer system is, the ROM array storing the n-bit by n-bit multiplication table remains reasonably small, so that a small silicon area and a sufficiently high processing speed can be appropriately maintained.
[0110] Figure 2 In the memory binary floating-point multiplication device 20, the sign multiplication circuit 200 is based on Figure 3The voltage signals on nodes 217, 227 and 201 on the XOR gate circuit perform the following four logic operations (sa=0, sb=0, sm=0), (sa=0, sb=1, sm=1), (sa=1, sb=0, sm=1) and (sa=1, sb=1, sm=0). Figure 4a-4b According to the present invention, it is shown that the MSB (a p-1 and b p-1 ) is a schematic diagram of floating point decoders 210a and 210b for decoding digital values of ). Figure 4a The floating point decoder circuit 210a and Figure 4b The floating point decoder circuit 210b has the same circuit configuration as the circuit 210a, which includes a P-type metal oxide semiconductor field effect transistor (MOSFET) device EP, an N-type MOSFET device EN (for enabling operation), q N-type MOSFET devices (Mea q-1 ,…,Mea1,Mea0) and an inverter 212a; wherein q N-type MOSFET devices (Mea q-1 ,…,Mea1,Mea0) are connected to q nodes (ea q-1 ,..,ea1,ea0)218. When a low logic voltage signal V SS When the circuit 210a is disabled at node 25, the EP device will be turned on to charge the node 211a to a high logic voltage signal V DD , and the EN device will be turned off to disconnect from the ground voltage. When a high logic voltage signal V DD When the circuit 210a is enabled at node 25, the EP device is turned off, making the node 211a and the high logic voltage signal V DD When the circuit 210a is enabled, if a high logic voltage signal V DD At any node (ea q-1 ,..,ea1,ea0)218, will turn on a corresponding N-type MOSFET device (Mea q-1 ,…,Mea1,Mea0) to discharge the node 211a to the ground voltage through the EN device, so that the output a of the inverter 212a p-1 Flip to high logic voltage signal V DD (Logical value 1). Otherwise, output a p-1 Will maintain a low logic voltage signal V SS (Logic value 0), this is because the low logic voltage signal V SS On all nodes (eaq-1 ,..,ea1,ea0)218, all N-type MOSFET devices (Mea q-1 ,…,Mea1,Mea0), so that the node 211a is disconnected from the ground voltage. The operation mode of the floating-point decoder circuit 210b for processing the floating-point number B is the same as that of the floating-point decoder circuit 210a for processing the floating-point number A, and the operation of the floating-point decoder circuits 210a and 210b is equivalent to an OR gate device with q inputs. The floating-point decoder circuits 210a and 210b are only used as embodiments, not as limitations of the present invention. In actual implementation, the floating-point decoder circuits 210a and 210b can be replaced by an OR gate device with q inputs or other equivalent logic elements.
[0111] The present invention utilizes an existing carry chain exponent adder circuit 240 to perform the two exponents (ea) of the floating point numbers A and B. q-1 ,...,ea1,ea0)b and (ea q-1 ,…,ea1,ea0)b, and the carry chain exponent adder circuit 240 includes (q-1) full adders (one OR gate, two XOR gates and two AND gates) 24f and a half adder (one OR gate and one AND gate) 24h, and the half adder 24h is used to generate the least significant bit (LSB), such as Figure 5 shown.
[0112] Please refer to the patent document of China Patent Application Publication No. 113918119A, the multi-digit 2 in the memory n The carry multiplication device includes a memory array to store 2 n The carry multiplication table is used to reduce the number of intermediate steps in the multiplication of two p-bit binary operands. n The carry multiplication device can be used to perform binary significand multiplication operations. The p-bit by p-bit binary significand multiplication operation is converted into a (p / n) digit by (p / n) digit multiplication operation and each digit of each significand is represented by a unique n-bit binary code. The above (p / n) digit by (p / n) digit multiplication operation can be (p / n) 2 It is realized by multiplication of digits by digits and addition of ((p / n)-1) polynomials. n The carry PDP multiplier unit 600 generates a voltage output signal of a 2n-bit binary product code of a digit-to-digit multiplication operation, and the 2 nThe carry PDP multiplier unit 600 includes a content read only memory (CROM) array 620, a match detector unit 630, and a response read only memory (RROM) array 640. Figure 6 Reference Figure 7 Multiplication table, the sum is equal to 2 2n The 2n-bit operator code ( Figure 7 A in the multiplication table i and B j ) is hardwired to 2 of the CROM array 620 2n In a row CROM cell (not shown), where 0<=i, j<=((p / n)-1); Figure 7 The total in the multiplication table is equal to 2 2n The 2n-bit product code is hardwired into the 2 2n The Enb signal on the node 605 can enable the match detector unit 630, and the match detector unit 630 is used to respectively sense the voltage potentials on the plurality of match lines 621 to find a matched match line, and then activate one of the plurality of word lines 631 corresponding to the matched match line. Basically, the memory 2 n The carry PDP multiplier unit 600 operates as follows: compare the 2 hardwired n A 2n-bit operand symbol and a first n-bit digit and a second n-bit digit, wherein the first n-bit digit is selected from the p-bit significant digit (a) stored in the register 220. p-1 ,a p-2 ,…,a0) and the second n-bit number is selected from the p-bit valid number (b p-1 ,b p-2 ,…,b0); When a row of 2n-bit operands stored in the CROM array 620 matches the first n-bit word and a second n-bit word, the match detector unit 630 activates one of the multiple word lines 631 corresponding to the matched match line to output the 2n-bit word hardwired in the RROM array 640. 2n One of the 2n-bit product codes is used as the 2n-bit output code.
[0113] In one embodiment, the 32-bit single-precision floating point format includes a 24-bit significand (p=8 and q=24). Fig. 9 As shown, 2 4 The carry (hexadecimal format with n=4) is used to represent a digit, so the two hexadecimal operands each have 24 / 4=6 digits to perform multiplication, and finally a 48-bit product code (m47 …m1m0). 6-digit number in memory 2 4 The carry multiplier circuit 250A includes 36 memory cells. 4 Carry PDP multiplier unit 910 (0) to (35) (derived from Figure 6 900), 6 binary adders BA 920(0)-(5) and 5 polynomial binary adders PBA 930(0)-(4). The 6-digit multiplication operation can be performed using an array 910 with 36 PDP multiplier units (each PDP multiplier unit stores Figure 8 4-bit multiplication table) to perform 36=6x6 digit-to-digit multiplication operations simultaneously and in parallel, using 6 carry-chain binary adders ( Fig.10 BA 920 (j)) generates six groups of 7-digit polynomial binary codes and uses 5 carry-chain polynomial binary adders ( Fig.11 PBA930(i)) performs five addition operations on the above six groups of 7-digit polynomial binary codes; where i = 0 to 4 and j = 0 to 5. Binary adder BA 920(j) receives polynomial (A5*B j X 5+j +A4*B j X 4 +j +A3*B j X 3+j +A2*B j X 2+j +A1*B j X 1+j +A0*B j X 0+j ) to generate 7 4-bit polynomial binary codes (7*4=28 bits in total), where X=2 4 and j = 0 to 5. The carry chain binary adder BA 920(j) includes five 4-bit adders and four half adders. Fig.10 Output node 921 of binary adder BA 920(j): The 4-bit binary code of the least significant digit output by binary adder BA 920(j) is directly output from PDP multiplier unit 910(0+6*j) (A o *B j )'s least significant 4-bit binary code; binary adder BA920(j) adds (A k+1 *B j ) and (A k *B j) are added to obtain the 20-bit binary code of the middle digits (the 2nd to 6th digits), where k = 0, 1, 2, 3, 4; the binary adder BA 920 (j) adds the carry bit of the 6th digit and (A5*B j ) to obtain the 4-bit binary code of the 7th digit. In short, the operation of the first binary addition device BA 920 (0) is equivalent to mathematically adding the 8-bit first coefficient of the first polynomial of degree 5 (i.e., A5*B0 x 5 +A4*B0X 4 +A3*B0 X 3 +A2*B0 X 2 +A1*B0X 1 +A0*B0X 0 ) is converted to the 4-digit second coefficient of the second polynomial of degree 6 (i.e. C6 X 6 +C5X 5 +C4X 4 +C3X 3 +C2X 2 +C1X 1 +C0X 0 ); The operation of the second binary addition device BA 920 (1) is equivalent to mathematically adding the 8-bit first coefficient of the first polynomial of degree 6 (ie A5*B1X 6 +A4*B1X 5 +A3*B1X 4 +A2*B1X 3 +A1*B1X 2 +A0*B1 X 1 ) is converted to the 4-digit second coefficient of the second polynomial of degree 7 (i.e., C 13 X 7 +C 12 X 6 +C 11 X 5 +C 10 X 4 +C9X 3 +C8X 2 +C7X 1 ); ...; The operation of the sixth binary addition device BA 920 (5) is equivalent to mathematically adding the 8-bit first coefficient of the first polynomial of degree 10 (i.e. A5*B5X 10 +A4*B5X 9 +A3*B5X 8 +A2*B5X 7 +A1*B5X 6 +A0*B5X 5) is converted to the 4-digit second coefficient of the second polynomial of degree 11 (i.e., C 41 X 11 +C 40 X 10 +C 39 X 9 +C 38 X 8 +C 37 X 7 +C 36 X 6 +C 35 X 5 ), where X = 2 4 The six binary addition devices BA 920 (0) to (5) simultaneously generate a total of six groups of 7-digit polynomial codes or a total of 42 4-bit second coefficients C0 to C 41 , in order to perform subsequent polynomial addition.
[0114] Fig.11 A schematic diagram showing a carry chain polynomial binary adder PBA 930(i), where i = 0, 1, 2, 3, 4. Fig.11 The carry chain polynomial binary adder PBA 930(i) includes a (6×4)-bit adder and four half adders. When i=0, the most significant 24-bit output node of the 0th group of 7-digit polynomial code (from BA 920(0)) and the 28-bit output node of the 1st group of 7-digit polynomial code (from BA 920(1)) are connected to the input nodes (pl i ) 27 (pl i ) 26 …(pl i )4) and ((pl i+1 ) 27 (pl i+1 ) 26 …(pl i+1 )1(pl i+1 )0); when i=1-4, the most significant 24-bit output node of the 7-digit polynomial code (from PBA 930(i-1)) and the 28-bit output node of the i+1th group of 7-digit polynomial code (from BA920(i+1)) are connected to the input node ((pl i ) 27 (pl i ) 26 …(pl i )4) and ((pl i+1 ) 27 (pl i+1 ) 26 …(pli+1 )1(pl i+1 )0). PBA 930(i) at output node ((pa i ) 27 (pa i ) 26 …(pa i )1(pa i )0)Output the voltage signal of the i-th polynomial addition. Fig. 9 In the node (m 47 m 46 The voltage signal generated by multiplying two effective numbers on the output node (m1m0) includes: 47 ~m 20 ) outputs the most significant 28 bits (voltage signal from PBA 930(4)) and outputs the most significant 28 bits (voltage signal from PBA 930(4)) at the output node (m 19 ~m0) outputs the least significant 20 bits, and at the output node (m 19 The least significant 20 bits of the output on the output node (m 19 ~m 16 ) outputs the least significant 4-bit voltage signal of PBA 930(3) at the output node (m 15 ~m 12 ) outputs the least significant 4-bit voltage signal of PBA 930(2) at the output node (m 11 The least significant 4-bit voltage signal of PBA 930(1) is outputted on output nodes (m7-m8), the least significant 4-bit voltage signal of PBA 930(0) is outputted on output nodes (m7-m4), and the least significant 4-bit voltage signal of BA 920(0) is outputted on output nodes (m3-m0). The operation of the polynomial adders PBA 930(0)-(4) is equivalent to mathematically aligning and adding all terms of the same degree in the second polynomial with a degree between 6 and 11 to obtain a plurality of 4-bit third coefficients of a third polynomial with a degree of 11. The number of terms in the third polynomial is 12.
[0115] In order to convert the floating point format of the product value output by the binary multiplication circuit 250 in the memory, the floating point number M is represented in the "2p-bit significand" format as follows:
[0116] as well as
[0117] em+1=ea+eb+1=(ea q-1 2 q-1 +…+ea02 0 )-2 q-1 +1+(eb q-1 2 q-1 +…+eb020 )-2 q-1 +1+1=(ea q-1 +eb q-1 -1)2 q-1 +(ea q-2 +eb q-2 )2 q-2 +…+(ea1+eb1+1)2 1 +(ea0+eb0)2 0 -2 q-1 +1.
[0118] The exponent em is expressed in "(q+1) bits" format as follows:
[0119] (em q em q-1 em q-2 ...em1em0)b=(0ea q-1 ea q-2 …ea1ea0)b+(0eb q-1 eb q-2 …eb1eb0)b+(00…10)b-(01…00)b=(es q es q-1 …es1es0)b+(00…10)b-(01…00)b,
[0120] Among them, (em q em q-1 …em1em0)b is the result of the binary addition / subtraction operation of the above equation, and (es q es q-1 …es1es0)b is Figure 2 Exponential adder circuit 240 converts (ea q-1 ea q-2 …ea1ea0)b and (eb q-1 eb q-2 …eb1eb0)b is the result of binary addition.
[0121] At the same time, according to the IEEE 754 floating point format, the effective number (m 2p-1 …m p m p-1 ...m0)b is shifted left to get the first leading non-zero bit, until all the exponent bits (em q-1 em q-2 …em1em0)b are all equal to 0 (representing a subnormal floating point number) until (that is, the number of bit positions shifted left is equal to the maximum value p). z represents the number of bit positions shifted left (relative to the MSB m above). 2p-1The shift distance) is expressed in (q+1)-bit format as follows:
[0122] z=z t-1 2 t-1 +…+z02 0 ∶=(0…z t-1 ...z0)b, where 0<=z<=(p-1) and t=roundup(log2p). Therefore, the final exponent bits are represented in the "(q+1) bit" format as follows:
[0123] (em q em q-1 em q-2 …em1em0)b
[0124] =(es q es q-1 …es1es0)b+(00…10)b-(01…z t-1 ...z0)b
[0125] Fig.12 A schematic diagram of the floating point encoder circuit 270 is shown. Fig.12 , the addition / subtraction circuit 1230 is at the input node (es q es q-1 …es1es0) receives the exponential voltage signal to perform the numerical equation (ea+eb+2-2 q-1 -z) addition and subtraction operations. And, at the same time, transmit the node (m 2p-1 …m p m p-1 ...m0) is sent to a leading zero detector (LZD) 1210 to detect the first non-zero bit from the most significant p bits of the 2p-bit product value generated by circuit 250, and to a barrel shifter 1240 to shift the 2p-bit significand. In the most significant p bits of the 2p-bit product value, LZD 1210 shifts the first non-zero bit from the MSB m 2p-1 The first non-zero bit is detected to turn on the corresponding word line in the position shift encoder 1220, thereby outputting a voltage signal of the corresponding binary code shifted left by z bit positions. Fig.12 In, if m 2p-1 =1(or voltage signal V DD ), LZD 1210 turns on the word line of the first column in position shift encoder 1220 to output a voltage signal of binary code (0…0)b, and transmits it to 2p-bit barrel shifter 1240 to convert the 2p-bit product value (m 2p-1 …m p m p-1…m0)b is shifted left by 0 bit positions (z=0) and sent to the addition / subtraction circuit 1230 to perform addition and subtraction operations on the above numerical equations; if m 2p-1 =0 (or voltage signal V SS ) and m 2p-2 =1(or voltage signal V DD ), LZD 1210 turns on the word line of the second column in position shift encoder 1220 to output a voltage signal of binary code (0…1)b, which is then sent to 2p-bit barrel shifter 1240 to shift the 2p-bit product value to the left by 1 bit position (z=1), and to addition / subtraction circuit 1230 to perform addition and subtraction operations of the above numerical equations. Basically, position shift encoder 1220 receives the voltage signal from LZD 1210 and converts the left shift position number z into a binary code expression. Addition / subtraction circuit 1230 at node (em q-1 em q-2 …em1em0) outputs an exponential voltage signal and the barrel shifter 1240 at the node (r p-2 …r1r0) outputs a floating-point product signal that complies with the standard IEEE 754 binary floating-point format. q+1 and em q The output exponential voltage signals are flags for underflow and overflow respectively.
[0126] In an embodiment of a 32-bit (q=8 and p=24) single precision floating point encoder 270A, Fig. 9 6-digit number in memory 2 4 Carry multiplier circuit 250A generates a 48-bit product significand (m 47 …m 24 m 23 The output node of the 1340 (m0)b is connected to the input node of the barrel shifter 1340, where the most significant 24 bits (m 47 …m 24 The output node of )b is also connected to the input node of LZD 1310; the exponent adder 240 adds ea and eb to obtain a 9-bit exponent (es8es7…es1es0)b, and transmits it to the input node of the addition / subtraction circuit 1330, as shown in FIG. Fig.13 LZD 1310 includes multiple NAND gates, which are used to generate the most significant 24 bits (m 47 …m 24 )b, detection relative to MSB (m 47 ). If LZD 1310 detects the first leading non-zero position, it outputs a voltage signal V DD(or logic value 1), otherwise, if it is not detected, a voltage signal V SS (or logic value 0). All output signals of the LZD 1310 are transmitted to the position shift encoder 1320. The position shift encoder 1320 includes a ROM array having a corresponding plurality of word lines connected to the output nodes of the LZD 1310. Fig.14 For example, different left shift position numbers z correspond to different predefined binary codes, which are pre-stored in a plurality of ROM cells of the ROM array 1320. The predefined binary code (z4z3z2z1z0)b represents z=z4 2 4 +z3 2 3 +z2 2 2 +z12 1 +z0 2 0 When the voltage signal V at the first leading non-zero position detected above DD When applied to the corresponding word line of the ROM array 1320, the predefined binary code z (= (z4z3z2z1z0)b) on the bit line node of the ROM array 1320 is simultaneously transmitted to Fig.15 The barrel shifter 1340 and Fig.16 The input node of the addition / subtraction circuit 1330. Fig.15 The schematic diagram of the 48-column left-shift barrel shifter 1340 is shown, which is decoded by a 5-bit input code z (= (z4z3z2z1z0)b) in binary format. The barrel shifter 1340 includes a transmission gate (TG) array, including a plurality of transmission gates 1501, with related circuit connections, which can transfer the input node (m 47 …m 24 m 23 …m0) is shifted left by z bit positions to the output node (r 22 r 21 …r1r0) output. The connection configuration of the left shift position is as follows: (z4z3z2z1z0) are the corresponding control nodes of the five rows of transmission gates, forming a circuit connection of 16 columns or 0 columns to the left through the control node z4, forming a circuit connection of 8 columns or 0 columns to the left through the control node z3, forming a circuit connection of 4 columns or 0 columns to the left through the control node z2, forming a circuit connection of 2 columns or 0 columns to the left through the control node z1, and forming a circuit connection of 1 column or 0 columns to the left through the control node z0; therefore, there are a total of 5 series multi-stages. Apply a voltage signal V to any control node (z4z3z2z1z0) DD(or logic value 1) turns on the transmission gate of the corresponding row, causing the voltage signals provided to the multiple input nodes to be transmitted to the multiple output nodes corresponding to the left-shifted columns; a voltage signal V is applied to any control node (z4z3z2z1z0) SS (or logic value 0) turns on the transmission gate of the corresponding row, causing the voltage signals provided to the multiple input nodes to be transmitted to the output nodes of the same column (no left shift). The output node (r 22 r 21 The voltage signal on ..r1r0) represents a digital voltage signal of the (p-1)-bit significant digit of a single-precision floating-point number conforming to the standard IEEE 754 floating-point digital format (p=24).
[0127] Fig.16 according to Fig.13 The embodiment of the single precision floating point encoder 270A shows a schematic diagram of the addition / subtraction circuit 1330. The binary addition circuit 1610 includes logic gate circuit elements 1611, 1612 and 1613 to perform a binary addition operation of (es8es7es6es5es4es3es2es1es0)b+(000000010)b. The 10-bit output node (including the carry bit node Cb) of the binary addition circuit 1610 is connected to the input node of the subtraction circuit 1620. The binary subtraction circuit 1620 includes logic gate circuit elements 1621, 1623 and 1622 to subtract (00100z4z3z2z1z0)b from the output value of the addition circuit 1610. The voltage signals on the output nodes (em7em6em5em4em3em2em1em0) represent digital voltage signals with 8-bit (q=8) exponents of single-precision floating-point numbers that conform to the standard IEEE754 floating-point digital format. Please note that the output voltage signals V DD (logical value 1) represents the underflow and overflow of single-precision floating-point numbers respectively.
[0128] Please note that the above-mentioned barrel shifter 1240 / 1340, exponent adder circuit 240, binary addition circuit 1610 and binary subtraction circuit 1620 are only provided as examples, and are not limitations of the present invention. In actual implementation, the above-mentioned barrel shifter 1240 / 1340 can be implemented by other types of barrel shifters, such as a crossbar barrel shifter and a barrel shifter implemented by connecting multiple parallel multiplexers in series; the exponent adder circuit 240 and the binary addition circuit 1610 can be implemented by other types of binary addition circuits, such as a carry save adder or a look ahead adder; the binary subtraction circuit 1620 can be implemented by other types of binary subtraction circuits, which also falls within the scope of the present invention. Please note that the above-mentioned CROM array 620, RROM array 640 and ROM array 1220 / 1320 are only provided as examples and are not limitations of the present invention. In actual implementation, the above-mentioned CROM array 620, RROM array 640 and ROM array 1220 / 1320 can be implemented by other types of memory arrays or equivalent logic elements, which also falls within the scope of the present invention.
[0129] The preferred embodiments provided above are only used to illustrate the present invention, and are not intended to limit the present invention to a specific type or exemplary embodiment. Therefore, this specification should be regarded as illustrative rather than restrictive. The preferred embodiments provided above are intended to effectively illustrate the gist of the present invention and its best mode of implementation, so that those skilled in the art can understand the various embodiments and various changes of the present invention to adapt to specific uses or implementation purposes. The scope of the present invention is defined by the claims and their equivalents, in which all terms are intended to have the broadest reasonable meaning unless otherwise specifically indicated. Therefore, "the present invention" and similar terms do not limit the scope of the claims to a specific embodiment, and any reference to a specific preferred embodiment of the present invention does not mean to limit the present invention, and no such limitation will be inferred. The present invention is defined only by the scope and spirit of the claims. The abstract of the present invention is provided in accordance with the requirements of the law so that searchers can quickly confirm the subject matter of this technical disclosure from any patent approved by this specification, and is not used to interpret or limit the scope and meaning of the claims. Any advantages and benefits may not apply to all embodiments of the present invention. It should be understood that various modifications or changes can be made by the industry, all of which should fall within the scope of the present invention defined by the claims. Furthermore, all elements and components in this specification are not intended to be dedicated to the public, regardless of whether the claims list these elements and components.
Claims
1. A floating-point multiplication device in memory, characterized in that: The device is used for performing a multiplication operation on a multiplicand and a multiplier to generate a first product value, wherein the multiplicand, the multiplier and the first product value are all binary floating point numbers in accordance with the IEEE 754 format and all include a sign bit, a q-bit exponent and a (p-1)-bit significand, the device comprising: an exclusive OR gate device, for receiving the sign bits of the multiplicand and the multiplier to generate the sign bit of the first product value; a decoder circuit for generating a first prefix bit according to the q-bit exponent of the multiplicand and a second prefix bit according to the q-bit exponent of the multiplier, wherein the first prefix bit and the (p-1)-bit significand of the multiplicand form a first p-bit significand, and the second prefix bit and the (p-1)-bit significand of the multiplier form a second p-bit significand; an exponent adder circuit for adding the q-bit exponents of the multiplicand and the multiplier to generate a (q+1)-bit temporary exponent; an in-memory binary multiplication circuit for performing a multiplication operation on the first p-bit effective number and the second p-bit effective number to generate a 2p-bit second product value; and An encoder circuit is configured to (1) distinguish a target bit position from the most significant p bits of the 2p-bit second product value and convert the target bit position into a shift distance z, and (2) calculate a shift distance z according to the (q+1)-bit temporary index and a value (2-2 q-1 -z), computing a q-bit exponent of the first product value and (3) shifting the 2p-bit second product value left by z bit positions to produce a (p-1)-bit significand of the first product value; wherein the target bit position comprises a non-zero value and is closest to the most significant bit position of the 2p-bit second product value; and Among them, 0<=z<=(p-1) and (p+q)>=8.
2. The device according to claim 1, characterized in that The decoder circuit comprises: a first OR gate device for receiving the binary bits of the q-bit exponent of the multiplicand to generate the first prefix bit; and A second OR gate device is used to receive the binary bits of the q-bit exponent of the multiplier to generate the second prefix bit.
3. The device according to claim 1, characterized in that The exponential adder circuit is implemented by a carry chain adder circuit, and the carry chain adder circuit includes (q-1) full adders and one half adder.
4. The device according to claim 1, characterized in that The encoder circuit comprises: a detection circuit having p output terminals for distinguishing the target bit position relative to the most significant bit position of the 2p-bit second product value to generate an enable bit and (p-1) invalid bits on the p output terminals; a first read-only memory ROM array, receiving the activation bit and the (p-1) inactive bits, and outputting the shift distance z in a binary format; a calculation circuit for adding 2 to the (q+1)-bit temporary exponent to generate a (q+1)-bit sum, and subtracting a value (2 q-1 + z) to obtain the q-bit index of the first product value; as well as A barrel shifter is used to shift the 2p-bit second product value left by the z bit positions to generate a (p-1)-bit significand of the first product value.
5. The device according to claim 4, characterized in that The first ROM array comprises: A plurality of ROM cells are arranged in a circuit configuration having rows and columns for pre-storing a plurality of pre-defined binary codes; p word lines, respectively connected to p output terminals of the detection circuit; as well as t bit lines coupled to the calculation circuit and the barrel shifter; When one of the p word lines is activated by the activation bit, a corresponding row of ROM cells is turned on to output the shift distance z on the t bit lines in a t-bit binary format, where t=roundup(log2p).
6. The device according to claim 4, characterized in that The detection circuit comprises: (p-2) series-connected logic blocks, wherein the (p-2) series-connected logic blocks operate according to the order of the logic blocks, starting from a first logic block (1) and proceeding sequentially to the next logic block thereof until a last logic block (p-2) is completed, wherein the first logic block (1) is activated by the inverted value of the most significant bit of the 2p-bit second product value, and checks the (2p-2)th bit value of the 2p-bit second product value to generate a control bit and provide a first data to the (p-2)th output terminal among the p output terminals, wherein a logic block (i) is activated by the control bit of the previous logic block (i-1), and checks the (2p-1-i)th bit value of the 2p-bit second product value to generate a control bit and provide a second data to the (p-1-i)th output terminal among the p output terminals; as well as a logic element, which is activated by the control bit of the last logic block (p-2) and checks the p-th bit value of the 2p-bit second product value to provide a third data to the 0-th output terminal among the p output terminals; The most significant bit of the 2p-bit second product value is provided to the (p-1)th output terminal among the p output terminals, and the data provided to the p output terminals form the activation bit and the (p-1)th invalid bit.
7. The device according to claim 6, characterized in that Each of the (p-2) serially connected logic blocks comprises: a first AND gate device having a first non-inverting input terminal, a second non-inverting input terminal and a first output terminal, wherein the first output terminal is coupled to the first ROM array; a second AND gate device having a third non-inverting input terminal, an inverting input terminal and a second output terminal; The second non-inverting input terminal and the inverting input terminal of the logic block (i) receive the (2p-1-i)th bit of the 2p-bit second product value, and the first non-inverting input terminal and the third non-inverting input terminal of the logic block (i) are coupled to the second output terminal of the previous logic block (i-1).
8. The device according to claim 6, characterized in that The logic element is implemented by a third AND gate device.
9. The device according to claim 4, characterized in that The barrel shifter includes 2p input terminals, 2p output terminals, and t serial multiplexer stages, wherein the 2p input terminals receive the 2p-bit second product value and correspond to the 2p output terminals, wherein the t serial multiplexer stages are used to shift the 2p-bit second product value to the left by z bit positions to generate a 2p-bit shifted product value at the 2p output terminals, wherein the p-th to (2p-2)-th bits of the 2p-bit shifted product value generated at the (p-1) output terminal among the 2p output terminals are output as the (p-1)-bit significant number of the first product value, wherein t=roundup(log2p).
10. The device according to claim 1, characterized in that The binary multiplication circuit in the memory comprises: k 2 The memory multiplier units are connected in parallel, each of which includes a second ROM array and a third ROM array, and compares 2 n 2n-bit operand symbols and a first n-bit number and a second n-bit number to output 2 n One of the 2n-bit response symbols is used as a 2n-bit product code, wherein the first n-bit number and the second n-bit number are selected from the first p-bit significant number and the second p-bit significant number, respectively, and the 2 n A 2n-bit operand symbol is hardwired into the second ROM array and the 2 n A 2n-bit response symbol is hardwired into the third ROM array, where the k 2 All 2n-bit product codes output by the parallel memory multiplier units form k 2 n Carry the first polynomial multiple 2n first coefficients, and each 2 n The 2n-bit first coefficient of the carry first polynomial is a multiplication operation of a corresponding digit of the first p-bit significand and the second p-bit significand, wherein the first p-bit significand and the second p-bit significand both have 2 n k digits of carry and k = p / n; k parallel binary adder circuits are used to parallelize the k binary adders. n The 2n first coefficients of the first polynomial are converted into k 2 n Carrying a plurality of n-digit second coefficients of the second polynomial; as well as (k-1) polynomial adder circuits are arranged in order, and the k 2 are sequentially added in order from low to high order. n The n-bit second coefficients of the second polynomial are added so that the k 2 n Align and add the terms of the same degree in the second polynomial to produce a 2 n Carry a plurality of n-digit third coefficients of the third polynomial; The n-bit third coefficient constitutes the 2p-bit second product value, and k and n are integers greater than 0.
11. The device according to claim 10, characterized in that Each of the k parallel binary adder circuits includes (k-1) n-bit adders and n half adders, forming a carry chain configuration.
12. The device according to claim 10, characterized in that Each of the (k-1) polynomial adder circuits includes a (k×n)-bit adder and n half adders, forming a carry chain configuration.
13. The device according to claim 10, characterized in that 2 n 2n-bit operand symbols and the 2 n The 2n-bit response symbols define an n-bit by n-bit multiplication table.
14. A method of operating a floating-point multiplication device in a memory, characterized in that: The in-memory floating-point multiplication device performs a multiplication operation on a multiplicand and a multiplier to generate a first product value, the in-memory floating-point multiplication device comprises an in-memory binary multiplication circuit and an encoder circuit, wherein the multiplicand, the multiplier and the first product value are all binary floating-point numbers conforming to the IEEE 754 format and all comprise a sign bit, a q-bit exponent and a (p-1)-bit significand, the method comprising: Performing an exclusive OR operation on the sign bits of the multiplicand and the multiplier to obtain the sign bit of the first product value; According to the q-bit exponent of the multiplicand and the q-bit exponent of the multiplier, a first pre-position bit and a second pre-position bit are obtained respectively, so that the first pre-position bit and the (p-1)-bit significant number of the multiplicand form a first p-bit significant number, and the second pre-position bit and the (p-1)-bit significant number of the multiplier form a second p-bit significant number; Adding the q-bit exponents of the multiplicand and the multiplier to obtain a (q+1)-bit temporary exponent; Using the binary multiplication circuit in the memory, multiply the first p-bit effective number and the second p-bit effective number to generate a 2p-bit second product value; Using the encoder circuit, a target bit position is discerned from the most significant p bits of the 2p-bit second product value to convert the target bit position into a shift distance z; The encoder circuit is used to generate a (q+1)-bit temporary index and a value (2-2 q-1 -z), calculating the q-bit exponent of the first product value; and Using the encoder circuit, shifting the 2p-bit second product value left by z bit positions to generate a (p-1)-bit significand of the first product value; wherein the target bit position comprises a non-zero value and is closest to the most significant bit position of the 2p-bit second product value; and Among them, 0<=z<=(p-1) and (p+q)>=8.
15. The method according to claim 14, characterized in that The steps of respectively obtaining the first pre-position and the second pre-position include: Performing an OR operation on the binary bits of the q-bit exponent of the multiplicand to obtain the first leading bit; and An OR operation is performed on the binary bits of the q-bit exponent of the multiplier to obtain the second prefix bit.
16. The method according to claim 14, characterized in that The distinguishing step comprises: Using (p-2) logic blocks and a logic element connected in series, the target bit position is distinguished relative to the most significant bit position of the 2p-bit second product value to obtain an active bit and (p-1) invalid bits; Applying the enable bit and the (p-1) invalid bits to p word lines of a first ROM array; as well as When the activation bit activates one of the p word lines, a corresponding row of ROM cells is turned on to output the shift distance z in a binary format via t bit lines of the first ROM array; wherein the encoder circuit comprises the (p-2) logic blocks, the logic elements and the first ROM array; as well as The first ROM array includes a plurality of ROM cells arranged in a circuit configuration of rows and columns for pre-storing a plurality of pre-defined binary codes.
17. The method according to claim 14, characterized in that The step of shifting leftwards comprises: Receiving the 2p-bit second product value at 2p input terminals of a barrel shifter, wherein the barrel shifter comprises 2p input terminals and t multiplexer stages connected in series; Using the t serially connected multiplexer stages, the 2p-bit second product value is shifted left by the z bit positions to generate a 2p-bit shifted product value at a (p-1) output terminal among the 2p output terminals; as well as Outputting the p-th to (2p-2)-th bits of the 2p-bit shift product value as the (p-1)-bit significant number of the first product value through the (p-1)-bit output terminal of the 2p-bit output terminals; wherein the 2p input terminals correspond to the 2p output terminals; and The encoder circuit includes the barrel shifter and t=roundup(log2p).
18. The method of claim 14, wherein: The calculation step comprises: Adding the (q+1)-bit temporary index to 2 yields a (q+1)-bit sum; and Subtract a value (2 q-1 +z) to obtain the q-bit index of the first product value.
19. The method of claim 14, wherein: The multiplication operation step comprises: k 2 Each of the in-memory multiplier units connected in parallel compares 2 n 2n-bit operand symbols and a first n-bit number and a second n-bit number to output 2 n One of the 2n-bit response symbols is used as a 2n-bit product code, wherein the first n-bit number and the second n-bit number are selected from the first p-bit significant number and the second p-bit significant number, respectively, and the 2 n The 2n-bit operand symbols are hardwired into a second ROM array and the 2 n The k bits of the response symbols are hardwired into a third ROM array, where the 2 All 2n-bit product codes output by the parallel memory multiplier units form k 2 n Carry the first polynomial multiple 2n first coefficients, and each 2 n The 2n-bit first coefficient of the carry first polynomial is a multiplication operation of a corresponding digit of the first p-bit significand and the second p-bit significand, wherein the first p-bit significand and the second p-bit significand both have 2 n k digits of carry and k = p / n; Each binary adder circuit of k parallel binary adder circuits adds the k binary adder circuits in parallel. n The 2n first coefficients of the first polynomial are converted into k 2 n Carrying a plurality of n-digit second coefficients of the second polynomial; as well as Arrange (k-1) polynomial adder circuits in order, and sequentially add the k 2 n The n-bit second coefficients of the second polynomial are added so that the k 2 n Align and add the terms of the same degree in the second polynomial to produce a 2 n Carry a plurality of n-digit third coefficients of the third polynomial; Wherein, the binary multiplication circuit in the memory includes the k 2 The k parallel in-memory multiplier units, the k parallel binary adder circuits and the (k-1) polynomial adder circuits; wherein the n-bit third coefficient constitutes the 2p-bit second product value, and k and n are integers greater than 0; and Among them, each of the k 2 The in-memory multiplier unit includes a second ROM array and a third ROM array.
20. The method of claim 19, wherein: 2 n 2n-bit operand symbols and the 2 n The 2n-bit response symbols define an n-bit by n-bit multiplication table.
Citation Information
Patent Citations
MULTIPLE-DIGIT BINARY IN-MEMORY MULTIPLIER DEVICES and operating methods
CN113918119A
Methods and apparatus for list transfers using dma transfers in a multi-processor system
CN101099141A
Mode-based multiply-add processor for denormal operands
CN101438233A
Split-path fused multiply-accumulate operation using first and second sub-operations
CN105849690A
A microprocessor and a method thereof
CN106293610A
Cited By
Dot product operation circuit element
CN121071278A
Dot product operation circuit element
CN121071278B
