US10831445B1 - Multimodal digital multiplication circuits and methods - Google Patents

Multimodal digital multiplication circuits and methods Download PDF

Info

Publication number
US10831445B1
US10831445B1 US16/137,195 US201816137195A US10831445B1 US 10831445 B1 US10831445 B1 US 10831445B1 US 201816137195 A US201816137195 A US 201816137195A US 10831445 B1 US10831445 B1 US 10831445B1
Authority
US
United States
Prior art keywords
operand
bit
mode
partial product
control signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
US16/137,195
Inventor
Christopher Aaron Clark
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Groq Inc
Original Assignee
Groq Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Groq Inc filed Critical Groq Inc
Priority to US16/137,195 priority Critical patent/US10831445B1/en
Assigned to Groq, Inc. reassignment Groq, Inc. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: CLARK, Christopher Aaron
Priority to US17/060,621 priority patent/US11301212B1/en
Application granted granted Critical
Publication of US10831445B1 publication Critical patent/US10831445B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/52Multiplying; Dividing
    • G06F7/523Multiplying only
    • G06F7/5235Multiplying only using indirect methods, e.g. quarter square method, via logarithmic domain
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/52Multiplying; Dividing
    • G06F7/523Multiplying only
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/52Multiplying; Dividing
    • G06F7/523Multiplying only
    • G06F7/527Multiplying only in serial-parallel fashion, i.e. one operand being entered serially and the other in parallel
    • G06F7/5272Multiplying only in serial-parallel fashion, i.e. one operand being entered serially and the other in parallel with row wise addition of partial products
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/38Indexing scheme relating to groups G06F7/38 - G06F7/575
    • G06F2207/3804Details
    • G06F2207/3808Details concerning the type of numbers or the way they are handled
    • G06F2207/3812Devices capable of handling different types of numbers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/38Indexing scheme relating to groups G06F7/38 - G06F7/575
    • G06F2207/48Indexing scheme relating to groups G06F7/48 - G06F7/575
    • G06F2207/4802Special implementations
    • G06F2207/4818Threshold devices
    • G06F2207/4824Neural networks

Definitions

  • the present disclosure relates to digital circuits, and in particular, to digital multimodal multiplication circuits and methods.
  • Digital circuits process logical signals represented by zeros (0) and ones (1) (i.e., bits).
  • a digital multiplier is an electronic circuit capable of receiving two digital input values and determining a product of the two input values. Performing multiplication digitally can raise a number of challenges. For example, data values being multiplied may be represented digitally in a number of different data types. However, including different multipliers to handle all the different data types a system may need to process would consume circuit area and increase complexity.
  • One particular application where digital multiplication of different data types is particularly useful is machine learning (aka artificial intelligence). Such applications may require particularly small, efficient, and/or accurate multipliers capable of handling multiple different data types to carry out various system functions.
  • Embodiments of the present disclosure pertain to digital circuits with compressed carry.
  • the present disclosure includes a multimodal digital multiplier circuit comprising binary multiplication circuitry to combine digital bits of a first operand and digital bits of a second operand to produce a plurality of partial product outputs, a plurality of controlled inverter circuits configured to selectively invert a first portion of the partial product outputs of the multiplication circuitry based on a mode control signal, and an adder circuit configured to receive a second portion of the outputs of the multiplication circuitry and outputs of the controlled inverter circuits and produce digital bits corresponding to the product of the first and second operands.
  • the mode control signal configures the controlled inverter circuits to invert a first plurality of the first portion of partial product outputs of the multiplication circuitry and not invert a second plurality of the first portion of partial product outputs of the multiplication circuitry
  • the mode control signal configures the controlled inverter circuits to invert the second plurality of the first portion of partial product outputs of the multiplication circuitry and not invert the first plurality of the first portion of partial product outputs of the multiplication circuitry
  • the mode control signal configures the controlled inverter circuits to invert the first and second plurality of the first portion of partial product outputs of the multiplication circuitry
  • the mode control signal configures the controlled inverter circuits to not invert the first and second plurality of the first portion of partial product outputs of the multiplication circuitry.
  • partial product outputs associated with a most significant bit of the first operand are inverted in a first mode
  • partial product outputs associated with a most significant bit of the second operand are inverted in a second mode
  • partial product outputs associated with the most significant bit of the first operand and bits of the second operand excluding the most significant bit of the second operand are inverted in a third mode
  • partial product outputs associated with the most significant bit of the second operand and bits of the first operand excluding the most significant bit of the first operand are inverted in the third mode.
  • the circuit further comprises two controlled inverter circuits configured to selectively invert two constant bit values based on a mode control signal, wherein the adder circuit is configured to receive the selectively inverted constant bit values.
  • the selectively inverted two constant bit values are in the Nth and N+1st partial product bit positions, and wherein in a first mode a value of one is added to the N+1st bit position and a zero value is added to the Nth bit position, in a second mode and a third mode a value of one is added to the Nth bit position and a zero value is added to the N+1st bit position, and in a fourth mode a zero value is added to the Nth bit position and the N+1st bit position.
  • a first plurality of controlled inverter circuits are configured to receive partial products resulting from a most significant bit of the first operand combined with the bits of the second operand excluding the most significant bit of the second operand, a second plurality of controlled inverter circuits are configured to receive partial products resulting from a most significant bit of the second operand combined with the bits of the first operand excluding the most significant bit of the first operand, a first controlled inverter circuit is configured to receive a partial product resulting from the most significant bit of the first operand combined with the most significant bit of the second operand, a second controlled inverter circuit is configured to receive first constant bit value, and a third controlled inverter circuits is configured to receive second constant bit value.
  • the first and second operands are N bit values and the plurality of controlled inverter circuits comprising 2N+2 controlled inverter circuits.
  • the first and second operands are N bit twos complement values.
  • the first operand format is one of a signed integer, an unsigned integer, or a float
  • the second operand format is one of a signed integer, an unsigned integer, or a float
  • the mode control signal is based on the format of both the first operand and second operand.
  • the present disclosure includes a method comprising multiplying, in binary multiplication circuitry, digital bits of a first operand and digital bits of a second operand to produce a plurality of partial product outputs, receiving a first portion of the partial product outputs of the multiplication circuitry in a plurality of controlled inverter circuits, selectively inverting the first portion of the partial product outputs of the multiplication circuitry based on a mode control signal, receiving a second portion of the partial product outputs of the multiplication circuitry and outputs of the controlled inverter circuits in an adder circuit, and adding the second portion of the partial product outputs of the multiplication circuitry and the outputs of the controlled inverter circuits to produce digital bits corresponding to the product of the first and second operands.
  • the techniques described herein are incorporated in a hardware description language program, the hardware description language program comprising sets of instructions, which when executed produce a digital circuit.
  • the hardware description language program may be stored on a non-transitory machine-readable medium, such as a computer memory (e.g., a data storage system).
  • FIG. 1 illustrates a multiplier circuit according to one embodiment.
  • FIG. 2 illustrates an example multiplier circuit according to another embodiment.
  • FIG. 3A illustrates partial products resulting from multiplication of two signed values.
  • FIG. 3B illustrates partial products resulting from multiplication of an unsigned value and a signed value.
  • FIG. 3C illustrates partial products resulting from multiplication of a signed value and an unsigned value.
  • FIG. 3D illustrates partial products resulting from multiplication of an unsigned value and an unsigned value.
  • FIG. 4A illustrates an example controlled inverter circuit according to an embodiment.
  • FIG. 4B illustrates another example controlled inverter circuit according to an embodiment.
  • FIG. 5 illustrates example multiplier circuits according to another embodiment.
  • FIG. 6 illustrates a method of multiplying according to another embodiment.
  • FIG. 7 illustrates an example machine learning processor according to one embodiment.
  • FIG. 1 illustrates a multimodal multiplier circuit 190 according to one embodiment.
  • a multimode multiplier 190 comprises binary multiplication circuitry 110 that receives binary values (values represented by zeros (0) and ones (1)) and generates partial products, an adder 112 , and controlled inverters 111 .
  • Multiplication circuitry 110 may receive inputs 100 and 101 (e.g., x and y, where x is the multiplier and y is the multiplicand).
  • Multiplication circuitry 100 in multiplier 190 generates a plurality of partial products outputs.
  • Embodiments of the present disclosure include controlled inverters 111 (e.g., inverters that either invert an input or do not invert an input based on a control signal) coupled to particular partial product outputs of multiplication circuitry 110 .
  • controlled inverters 111 e.g., inverters that either invert an input or do not invert an input based on a control signal
  • multiple different data formats may be multiplied using the same multiplier by inverting different partial product outputs based on the format of the inputs bits being multiplied.
  • a mode control signal (“mode”) may be used to control the controlled inverters, for example.
  • storage register circuit 100 stores digital bits corresponding to a first operand (e.g., multiplier, x).
  • storage register circuit 101 stores digital bits corresponding to a second operand (e.g., multiplicand, y).
  • Digital bits for x and y are input to multiplication circuitry 110 for multiplying binary bits of the first and second operands (e.g., using logic gates such as AND gates).
  • Multiplication circuitry 110 produces a plurality of partial product outputs.
  • a first portion 115 of the partial product outputs are coupled to controlled inverter circuits 111 .
  • Controlled inverter circuits 111 also receive mode control signals, which configure the controlled inverter circuits to selectively invert digital values received on their inputs.
  • controlled inverter circuits 111 may be configured to selectively invert a first portion of partial product outputs of the multiplication circuitry 110 based on the mode control signal.
  • an adder circuit 112 may be configured to receive a second portion 116 of the outputs of the multiplication circuitry 110 and outputs of the controlled inverter circuits 111 . Adder circuit 112 may sum the partial products to produce a total product output value (“Out”), for example.
  • One feature of the present disclosure is the ability to multiply digital values represented as either or both of signed or unsigned integer values.
  • one input, x may be either signed or unsigned
  • another input, y may be either signed or unsigned. Multiplying combinations of signed and unsigned values may require different circuitry for performing different multiplication algorithms.
  • embodiments of the present disclosure include a mode control signal corresponding to the combination of signed and unsigned values to be multiplied.
  • a mode control signal may encode four (4) different cases (or modes) for multiplying x and y: (y-signed, x-signed), (y-unsigned, x-signed), (y-signed, x-unsigned), and (y-unsigned, x-unsigned).
  • the mode control signal configures the controlled inverter circuits 111 to invert a first plurality of the first portion 115 of partial product outputs of the multiplication circuitry 110 and not invert a second plurality of the first portion 115 of partial product outputs of the multiplication circuitry 110 .
  • the mode control signal configures the controlled inverter circuits 111 to invert the second plurality of the first portion 115 of partial product outputs of the multiplication circuitry 110 and not invert the first plurality of the first portion 115 of partial product outputs of the multiplication circuitry. Additionally, in a third mode corresponding to the operands x and y both being signed values, the mode control signal configures the controlled inverter circuits 111 to invert the first and second plurality of the first portion 115 of partial product outputs of the multiplication circuitry 110 .
  • the mode control signal configures the controlled inverter circuits 111 to not invert any of the first portion 115 of partial product outputs of the multiplication circuitry 110 .
  • FIG. 2 illustrates an example multiplier circuit according to another embodiment.
  • bits for values x and y are stored in register circuits 200 and 201 .
  • Operands x and y may be N bit twos complement values, for example.
  • This example illustrates that the multiplication of bits in a multiplier may be divided up into different groups of partial products.
  • a multiplier circuit may comprise multiplication circuitry 210 for generating one set of partial products, and multiplication circuitry 211 may correspond to circuits for generating partial product outputs associated with a most significant bit of operand y and partial product outputs associated with a most significant bit of operand x, respectively.
  • circuits 211 may be used to generate partial products xNyN ⁇ 1, . . .
  • Mode control generator circuit 204 may set the values of multiple signal lines of mode control signal 221 based on the format of x and y (e.g., signed-signed, signed-unsigned, unsigned-signed, or unsigned-unsigned). Accordingly, in a one mode, partial product outputs associated with a most significant bit of operand x may be inverted, and in another mode, partial product outputs associated with a most significant bit of operand y may be inverted, for example.
  • constants may be selectively coupled to adder 250 and added to the partial products.
  • two controlled inverter circuits are configured to selectively invert two constant bit values based on a mode control signal, and the adder circuit is configured to receive the selectively inverted constant bit values.
  • the selectively inverted (e.g., based on the mode control signal) partial products from controlled inverter circuits 220 , the partial products from multiplication circuitry 210 , and the selectively inverted constants 213 are coupled to adder 250 and summed to produce an output product.
  • the output product may be in the form of a sum and a carry, for example.
  • FIGS. 3A-3D illustrate multiplication of two operands using different modes according to embodiments of the disclosure.
  • y is the multiplicand and x is the multiplier.
  • FIG. 3A illustrates multiplication where y is signed and x is signed.
  • partial product outputs associated with the most significant bit of operand y e.g., y7
  • bits of operand x x0-x6
  • excluding the most significant bit of operand x e.g., x7y7 are inverted (e.g., see the MSB edge of the diagonal).
  • partial product outputs associated with the most significant bit of operand x e.g., x7
  • bits of operand y e.g., y0-y6
  • excluding the most significant bit of operand y e.g., x7y7
  • constant values are added in the 2N+1 bit position, designating a negative number in 2's complement, and in the N+1 st position.
  • controlled inverters may be configured to invert the partial products associated with the most significant bits of x and y, but not the partial product associated with xNyN.
  • a controlled inverter may be used to selectively couple a 1 to the N+1 st bit position (e.g., a controlled inverter with an input value of 0).
  • controlled inverter circuits may be used to selectively couple a 1 to the 2N bit position as illustrated in FIG. 3A , for example, when the circuit is in a signed-signed input mode.
  • the 2N bit is bit 15 (the 16 th bit, where the first bit is the 0 th position) and represents a negative number, ⁇ (2 ⁇ circumflex over ( ) ⁇ 15), for example. Partial products illustrated in FIG. 3A may be added to produce a resulting output product.
  • FIG. 3B illustrates multiplication where y is unsigned and x is signed.
  • FIG. 3B The x and y partial products for the above is shown in FIG. 3B .
  • partial product outputs associated with a most significant bit of operand x e.g., x7
  • other partial products are not inverted.
  • a 1 is added in the 2Nth bit (e.g., 2N position representing a negative number).
  • a second 1 bit is added in the Nth bit position.
  • These inverted partial products associated with the x MSB (here, x7) and the 1 bits at N and 2N may be selectively coupled to an adder using controlled inverter circuits based on a mode control signal, for example. Partial products illustrated in FIG. 3B may be added to produce a resulting output product.
  • FIG. 3C illustrates multiplication where y is signed and x is unsigned.
  • partial product outputs associated with a most significant bit of operand y are inverted and other partial products are not inverted.
  • a 1 is added in the 2Nth bit position (e.g., 2N position representing a negative number).
  • a second 1 bit is added in the Nth bit position.
  • FIG. 3D illustrates partial products resulting from multiplication of an unsigned value and an unsigned value. This case represents the case where none of the partial products are inverted and no constant values are added. Accordingly, the constant 1 values and inversions described above are all turned off, and the partial products may be output directly without inversion.
  • FIG. 3A-D illustrate that a multimodal multiplier may be implemented for x and y operands comprising N bit values using 2N+2 controlled inverter circuits, for example.
  • 2(N ⁇ 1) partial products of the MSBs of x and y are inverted (excluding the product of both MSBs xNyN), and two constant values of 1 may be selectively introduced in bit positions N+1 and 2N as illustrated in FIG. 3A .
  • N partial products of the MSB of x are inverted and two constant values of 1 may be selectively introduced in bit positions N and 2N as illustrated in FIG. 3B .
  • the above described multiplier supports combinations of input formats.
  • the first operand format may be one of a signed integer, an unsigned integer, or a float
  • the second operand format may be one of a signed integer, an unsigned integer, or a float.
  • the mode control signal is based on the format of both the first operand and second operand so that the appropriate mode control signal may be sent to the multiplier to configure the controlled inverter circuits as described above.
  • FIG. 4A illustrates an example controlled inverter circuit according to an embodiment.
  • a controlled inverter is implemented as an XOR logic circuit, where one input is coupled to the partial product to be inverted (e.g., a partial product associated with an MSB as described above, pp_msb) and the other input is coupled to one bit of the mode control signal, for example.
  • the XOR passes the pp_msb unchanged, and when the mode bit is in another state, the XOR inverts the pp_msb.
  • FIG. 4B illustrates another example controlled inverter circuit according to an embodiment.
  • a mode bit is coupled through an inverter to create an inverse mode bit.
  • a partial product to be inverted is coupled to the output through one of two paths.
  • a first path through switch 412 couples the partial product to the output unchanged.
  • a second path through inverter 411 and switch 413 couples the partial product to the output inverted.
  • Mode bit and inverse mode bit are configured so that only one of switches 412 and 413 are closed at any given time. Circuits using the techniques shown in FIGS. 4A and 4B are example means for selectively inverting the partial product outputs from the multiplication circuitry based on a mode control signal.
  • FIG. 5 illustrates example multiplier circuits according to another embodiment.
  • a multiplier includes controlled inverter circuits 510 - 515 configured using a mode control signal (“mode”), which may configure the system into one of four (4) states based on whether the input operands are both signed, signed-unsigned, unsigned-signed, or both unsigned.
  • the input operands may be integer values or significands of floating point values represented in twos complement binary, for example.
  • Floating point values may have the form “significand ⁇ base exponent ,” where the exponents may be added (not shown).
  • a first plurality of controlled inverter circuits 510 are configured to receive partial products resulting from a most significant bit of operand x (xN) combined with the bits of operand y excluding the most significant bit (y0 . . . yN ⁇ 1).
  • a second plurality of controlled inverter circuits 511 are configured to receive partial products resulting from a most significant bit of operand y (yN) combined with the bits of operand x excluding the most significant bit (x0 . . . xN ⁇ 1).
  • Another controlled inverter circuit 512 is configured to receive a partial product resulting from the most significant bit of operand x combined with the most significant bit of operand y (xNyN).
  • a controlled inverter circuit 513 is configured to receive a constant bit value and selectively include a 1 in the Nth bit position to be added with partial products in the Nth bit position (e.g., for unsigned-signed mode and signed-unsigned mode).
  • a controlled inverter circuit 514 is configured to receive a constant bit value and selectively include a 1 in the N+1 bit position to be added with partial products in the N+1 bit position (for signed-signed mode).
  • a controlled inverter circuit 515 is configured to receive a constant bit value and selectively include a 1 in the 2N bit position (for all modes but unsigned-unsigned mode).
  • (N ⁇ 1) 2 partial products may be coupled directly to the input of adder 550 to be combined with the outputs of controlled inverters 510 - 515 to produce a final output product, for example.
  • FIG. 6 illustrates a method of multiplying according to another embodiment.
  • digital bits of first and second operands may be multiplied to produce partial products.
  • the digital bits may be twos complement integers or floating point numbers, for example.
  • the operands format may be combinations of a signed integer and an unsigned integer, or two floats, for example.
  • Multiplication circuitry may comprise logic for combining each digital value to produce a partial product (e.g., logic circuits such as AND gates).
  • a first portion of the partial product outputs of the multiplication circuitry are received in a plurality of controlled inverter circuits.
  • the first portion of the partial product outputs of the multiplication circuitry are selectively inverted based on a mode control signal.
  • some partial products of the first portion are inverted, while in other modes other partial products of the first portion are inverted as illustrated above in FIGS. 3A-D , for example.
  • a second portion of the partial product outputs of the multiplication circuitry and outputs of the controlled inverter circuits are received in an adder circuit.
  • An adder circuit may also receive controlled inverter circuits having inputs coupled to constant values to selectively add a 1 in particular bit positions in different modes, for example.
  • the second portion of the partial product outputs of the multiplication circuitry and the outputs of the controlled inverter circuits are added to produce digital bits corresponding to the product of the first and second operands.
  • the result may comprise a sum and a carry, for example.
  • FIG. 7 illustrates an example machine learning processor according to one embodiment.
  • Machine learning processor 700 (aka, Artificial Intelligence (AI) processor) may include memory and arithmetic units optimized for multiplying and adding input data with weight sets (e.g., trained or being trained) for machine learning applications (e.g., training or inference).
  • machine learning processor 700 includes a vector processor (V ⁇ M) 710 for performing operations on vectors (i.e., one-dimensional arrays of values).
  • V ⁇ M vector processor
  • other elements of the system are arranged symmetrically on either side of the V ⁇ M 710 to optimize processing speed.
  • V ⁇ M 710 is adjacent to memories 711 and 712 , switch matrices (S ⁇ M) 713 and 714 to control routing of data, data format and presentation controllers (NIM) 715 and 716 , and a matrix multiplication unit (M ⁇ M) 717 and 718 .
  • M ⁇ Ms 717 and 718 and V ⁇ M 710 may include circuits as described herein for example.
  • An instruction control unit (ICU) 720 controls the flow of data and execution of operations across blocks 710 - 718 , for example.
  • Machine learning processor 700 includes communications circuits such as chip-to-chip (C2C) circuits 723 - 724 (e.g., for parallel operation of multiple processors 700 ) and an external communication circuit (e.g., PCIe) 721 (e.g., for communication with other computer systems, such as one or more servers).
  • Processor 700 may further include a chip control unit (CCU) 722 to control boot operations, clock resets, and other low level setup operations, for example.
  • CCU chip control unit
  • a hardware description language is a specialized computer language used to describe the structure and behavior of electronic circuits, including digital logic circuits.
  • a hardware description language results in an accurate and formal description of an electronic circuit that allows for the automated analysis and simulation of an electronic circuit.
  • An HDL description may be synthesized into a netlist (e.g., a specification of physical electronic components and how they are connected together), which can then be placed and routed to produce the set of masks used to create an integrated circuit including the elements and functions described herein.
  • a netlist e.g., a specification of physical electronic components and how they are connected together

Abstract

Embodiments of the present disclosure pertain to multimodal digital multiplier circuits and methods. In one embodiment, partial product outputs of digital multiplication circuits are selectively inverted based on a mode control signal. The mode control signal may be set based on a format of the operands input to the multiplier. Example embodiments of the disclosure may multiply combinations of signed and unsigned input operands using different modes.

Description

BACKGROUND
The present disclosure relates to digital circuits, and in particular, to digital multimodal multiplication circuits and methods.
Digital circuits process logical signals represented by zeros (0) and ones (1) (i.e., bits). A digital multiplier is an electronic circuit capable of receiving two digital input values and determining a product of the two input values. Performing multiplication digitally can raise a number of challenges. For example, data values being multiplied may be represented digitally in a number of different data types. However, including different multipliers to handle all the different data types a system may need to process would consume circuit area and increase complexity.
One particular application where digital multiplication of different data types is particularly useful is machine learning (aka artificial intelligence). Such applications may require particularly small, efficient, and/or accurate multipliers capable of handling multiple different data types to carry out various system functions.
SUMMARY
Embodiments of the present disclosure pertain to digital circuits with compressed carry. In one embodiment, the present disclosure includes a multimodal digital multiplier circuit comprising binary multiplication circuitry to combine digital bits of a first operand and digital bits of a second operand to produce a plurality of partial product outputs, a plurality of controlled inverter circuits configured to selectively invert a first portion of the partial product outputs of the multiplication circuitry based on a mode control signal, and an adder circuit configured to receive a second portion of the outputs of the multiplication circuitry and outputs of the controlled inverter circuits and produce digital bits corresponding to the product of the first and second operands.
In one embodiment, in a first mode corresponding to the first operand being an unsigned value and the second operand being a signed value, the mode control signal configures the controlled inverter circuits to invert a first plurality of the first portion of partial product outputs of the multiplication circuitry and not invert a second plurality of the first portion of partial product outputs of the multiplication circuitry
In one embodiment, in a second mode corresponding to the first operand being a signed value and the second operand being an unsigned value, the mode control signal configures the controlled inverter circuits to invert the second plurality of the first portion of partial product outputs of the multiplication circuitry and not invert the first plurality of the first portion of partial product outputs of the multiplication circuitry
In one embodiment, in a third mode corresponding to the first and second operands being signed values, the mode control signal configures the controlled inverter circuits to invert the first and second plurality of the first portion of partial product outputs of the multiplication circuitry
In one embodiment, in a fourth mode corresponding to the first and second operands being unsigned values, the mode control signal configures the controlled inverter circuits to not invert the first and second plurality of the first portion of partial product outputs of the multiplication circuitry.
In one embodiment, partial product outputs associated with a most significant bit of the first operand are inverted in a first mode, and partial product outputs associated with a most significant bit of the second operand are inverted in a second mode.
In one embodiment, partial product outputs associated with the most significant bit of the first operand and bits of the second operand excluding the most significant bit of the second operand are inverted in a third mode, and partial product outputs associated with the most significant bit of the second operand and bits of the first operand excluding the most significant bit of the first operand are inverted in the third mode.
In one embodiment, the circuit further comprises two controlled inverter circuits configured to selectively invert two constant bit values based on a mode control signal, wherein the adder circuit is configured to receive the selectively inverted constant bit values.
In one embodiment, the selectively inverted two constant bit values are in the Nth and N+1st partial product bit positions, and wherein in a first mode a value of one is added to the N+1st bit position and a zero value is added to the Nth bit position, in a second mode and a third mode a value of one is added to the Nth bit position and a zero value is added to the N+1st bit position, and in a fourth mode a zero value is added to the Nth bit position and the N+1st bit position.
In one embodiment, a first plurality of controlled inverter circuits are configured to receive partial products resulting from a most significant bit of the first operand combined with the bits of the second operand excluding the most significant bit of the second operand, a second plurality of controlled inverter circuits are configured to receive partial products resulting from a most significant bit of the second operand combined with the bits of the first operand excluding the most significant bit of the first operand, a first controlled inverter circuit is configured to receive a partial product resulting from the most significant bit of the first operand combined with the most significant bit of the second operand, a second controlled inverter circuit is configured to receive first constant bit value, and a third controlled inverter circuits is configured to receive second constant bit value.
In one embodiment, the first and second operands are N bit values and the plurality of controlled inverter circuits comprising 2N+2 controlled inverter circuits.
In one embodiment, the first and second operands are N bit twos complement values.
In one embodiment, the first operand format is one of a signed integer, an unsigned integer, or a float, and wherein the second operand format is one of a signed integer, an unsigned integer, or a float, and wherein the mode control signal is based on the format of both the first operand and second operand.
In another embodiment, the present disclosure includes a method comprising multiplying, in binary multiplication circuitry, digital bits of a first operand and digital bits of a second operand to produce a plurality of partial product outputs, receiving a first portion of the partial product outputs of the multiplication circuitry in a plurality of controlled inverter circuits, selectively inverting the first portion of the partial product outputs of the multiplication circuitry based on a mode control signal, receiving a second portion of the partial product outputs of the multiplication circuitry and outputs of the controlled inverter circuits in an adder circuit, and adding the second portion of the partial product outputs of the multiplication circuitry and the outputs of the controlled inverter circuits to produce digital bits corresponding to the product of the first and second operands.
In another embodiment, the techniques described herein are incorporated in a hardware description language program, the hardware description language program comprising sets of instructions, which when executed produce a digital circuit. The hardware description language program may be stored on a non-transitory machine-readable medium, such as a computer memory (e.g., a data storage system).
The following detailed description and accompanying drawings provide a better understanding of the nature and advantages of the present disclosure.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 illustrates a multiplier circuit according to one embodiment.
FIG. 2 illustrates an example multiplier circuit according to another embodiment.
FIG. 3A illustrates partial products resulting from multiplication of two signed values.
FIG. 3B illustrates partial products resulting from multiplication of an unsigned value and a signed value.
FIG. 3C illustrates partial products resulting from multiplication of a signed value and an unsigned value.
FIG. 3D illustrates partial products resulting from multiplication of an unsigned value and an unsigned value.
FIG. 4A illustrates an example controlled inverter circuit according to an embodiment.
FIG. 4B illustrates another example controlled inverter circuit according to an embodiment.
FIG. 5 illustrates example multiplier circuits according to another embodiment.
FIG. 6 illustrates a method of multiplying according to another embodiment.
FIG. 7 illustrates an example machine learning processor according to one embodiment.
DETAILED DESCRIPTION
In the following description, for purposes of explanation, numerous examples and specific details are set forth in order to provide a thorough understanding of the present disclosure. Such examples and details are not to be construed as unduly limiting the elements of the claims or the claimed subject matter as a whole. It will be evident to one skilled in the art, based on the language of the different claims, that the claimed subject matter may include some or all of the features in these examples, alone or in combination, and may further include equivalent modifications of the features and techniques described herein.
Features and advantages of the present disclosure include a multimodal multiplier circuit capable of multiplying different data formats. For example, FIG. 1 illustrates a multimodal multiplier circuit 190 according to one embodiment. In some applications, it may be desirable to multiply data in different formats using the same multiplier circuitry. In this example, a multimode multiplier 190 comprises binary multiplication circuitry 110 that receives binary values (values represented by zeros (0) and ones (1)) and generates partial products, an adder 112, and controlled inverters 111. Multiplication circuitry 110 may receive inputs 100 and 101 (e.g., x and y, where x is the multiplier and y is the multiplicand). Multiplication circuitry 100 in multiplier 190 generates a plurality of partial products outputs. Embodiments of the present disclosure include controlled inverters 111 (e.g., inverters that either invert an input or do not invert an input based on a control signal) coupled to particular partial product outputs of multiplication circuitry 110. Advantageously, multiple different data formats may be multiplied using the same multiplier by inverting different partial product outputs based on the format of the inputs bits being multiplied. A mode control signal (“mode”) may be used to control the controlled inverters, for example.
Referring again to FIG. 1, storage register circuit 100 stores digital bits corresponding to a first operand (e.g., multiplier, x). Similarly, storage register circuit 101 stores digital bits corresponding to a second operand (e.g., multiplicand, y). Digital bits for x and y are input to multiplication circuitry 110 for multiplying binary bits of the first and second operands (e.g., using logic gates such as AND gates). Multiplication circuitry 110 produces a plurality of partial product outputs. A first portion 115 of the partial product outputs are coupled to controlled inverter circuits 111. Controlled inverter circuits 111 also receive mode control signals, which configure the controlled inverter circuits to selectively invert digital values received on their inputs. For example, when a mode control signal coupled to a particular controlled inverter is in a first logic state, the controlled inverter may invert a digital value, and when the mode control signal is in a second logic state, the controlled inverter may not invert the digital signal (i.e., the signal passes through unchanged). Accordingly, controlled inverter circuits 111 may be configured to selectively invert a first portion of partial product outputs of the multiplication circuitry 110 based on the mode control signal. Finally, an adder circuit 112 may be configured to receive a second portion 116 of the outputs of the multiplication circuitry 110 and outputs of the controlled inverter circuits 111. Adder circuit 112 may sum the partial products to produce a total product output value (“Out”), for example.
One feature of the present disclosure is the ability to multiply digital values represented as either or both of signed or unsigned integer values. For example, one input, x, may be either signed or unsigned, and another input, y, may be either signed or unsigned. Multiplying combinations of signed and unsigned values may require different circuitry for performing different multiplication algorithms. Advantageously, embodiments of the present disclosure include a mode control signal corresponding to the combination of signed and unsigned values to be multiplied. For example, a mode control signal may encode four (4) different cases (or modes) for multiplying x and y: (y-signed, x-signed), (y-unsigned, x-signed), (y-signed, x-unsigned), and (y-unsigned, x-unsigned). Accordingly, in a first mode corresponding to the operand y being an unsigned value and operand x being a signed value, the mode control signal configures the controlled inverter circuits 111 to invert a first plurality of the first portion 115 of partial product outputs of the multiplication circuitry 110 and not invert a second plurality of the first portion 115 of partial product outputs of the multiplication circuitry 110. In a second mode corresponding to operand y being a signed value and operand x being an unsigned value, the mode control signal configures the controlled inverter circuits 111 to invert the second plurality of the first portion 115 of partial product outputs of the multiplication circuitry 110 and not invert the first plurality of the first portion 115 of partial product outputs of the multiplication circuitry. Additionally, in a third mode corresponding to the operands x and y both being signed values, the mode control signal configures the controlled inverter circuits 111 to invert the first and second plurality of the first portion 115 of partial product outputs of the multiplication circuitry 110. Finally, in a fourth mode corresponding to the operands x and y both being unsigned, the mode control signal configures the controlled inverter circuits 111 to not invert any of the first portion 115 of partial product outputs of the multiplication circuitry 110.
FIG. 2 illustrates an example multiplier circuit according to another embodiment. In this example, bits for values x and y are stored in register circuits 200 and 201. Operands x and y may be N bit twos complement values, for example. This example illustrates that the multiplication of bits in a multiplier may be divided up into different groups of partial products. For example, a multiplier circuit may comprise multiplication circuitry 210 for generating one set of partial products, and multiplication circuitry 211 may correspond to circuits for generating partial product outputs associated with a most significant bit of operand y and partial product outputs associated with a most significant bit of operand x, respectively. For instance, circuits 211 may be used to generate partial products xNyN−1, . . . xNy0, xN−1yN, . . . x0yN, and xNyN. The partial products for the most significant bits of x and y are coupled through a controlled inverter circuits 220, which are configured to either invert or not invert each partial product based on mode control signal 221 from mode control generator circuit 204, for example. Mode control generator circuit 204 may set the values of multiple signal lines of mode control signal 221 based on the format of x and y (e.g., signed-signed, signed-unsigned, unsigned-signed, or unsigned-unsigned). Accordingly, in a one mode, partial product outputs associated with a most significant bit of operand x may be inverted, and in another mode, partial product outputs associated with a most significant bit of operand y may be inverted, for example.
Furthermore, this example illustrates that constants may be selectively coupled to adder 250 and added to the partial products. For example, a plurality of constants 213 (e.g., bits=1) in a plurality of different bit positions may be coupled through controlled inverter circuits 222 to adder 250 and added together with the partial products. In one embodiment described in more detail below, two controlled inverter circuits are configured to selectively invert two constant bit values based on a mode control signal, and the adder circuit is configured to receive the selectively inverted constant bit values.
Finally, in the example in FIG. 2, the selectively inverted (e.g., based on the mode control signal) partial products from controlled inverter circuits 220, the partial products from multiplication circuitry 210, and the selectively inverted constants 213 are coupled to adder 250 and summed to produce an output product. In some embodiments, the output product may be in the form of a sum and a carry, for example.
FIGS. 3A-3D illustrate multiplication of two operands using different modes according to embodiments of the disclosure. In these examples, y is the multiplicand and x is the multiplier. FIG. 3A illustrates multiplication where y is signed and x is signed. Here, partial product outputs associated with the most significant bit of operand y (e.g., y7) and bits of operand x (x0-x6), excluding the most significant bit of operand x (e.g., x7y7) are inverted (e.g., see the MSB edge of the diagonal). Additionally, partial product outputs associated with the most significant bit of operand x (e.g., x7) and bits of operand y (e.g., y0-y6), excluding the most significant bit of operand y (e.g., x7y7) are inverted (e.g., see the last row of partial products). Additionally, in this multiplication, constant values are added in the 2N+1 bit position, designating a negative number in 2's complement, and in the N+1st position. However, the other partial products are not inverted in this multiplication. Accordingly, controlled inverters may be configured to invert the partial products associated with the most significant bits of x and y, but not the partial product associated with xNyN. Additionally, a controlled inverter may be used to selectively couple a 1 to the N+1st bit position (e.g., a controlled inverter with an input value of 0). Additionally, controlled inverter circuits may be used to selectively couple a 1 to the 2N bit position as illustrated in FIG. 3A, for example, when the circuit is in a signed-signed input mode. Here, the 2N bit is bit 15 (the 16th bit, where the first bit is the 0th position) and represents a negative number, −(2{circumflex over ( )}15), for example. Partial products illustrated in FIG. 3A may be added to produce a resulting output product.
FIG. 3B illustrates multiplication where y is unsigned and x is signed. A twos complement multiplication may be factored to produce the following:
xy=\sum_{i=0}{circumflex over ( )}{n−2}(\sum_{j=0}{circumflex over ( )}{n−1}(x_i y_j2{circumflex over ( )}(i+j)))−2{circumflex over ( )}(n−1)x_(n−1)\sum_{j=0}{circumflex over ( )}{n−1}(2{umlaut over ( )}j y_j); or
i = 0 n - 2 j = 0 n - 1 x i y j 2 i + J - 2 n - 1 x n - 1 j = 0 n - 1 2 j y j .
The x and y partial products for the above is shown in FIG. 3B. In this example, partial product outputs associated with a most significant bit of operand x (e.g., x7) are inverted and other partial products are not inverted. Similar to above, a 1 is added in the 2Nth bit (e.g., 2N position representing a negative number). Here, a second 1 bit is added in the Nth bit position. These inverted partial products associated with the x MSB (here, x7) and the 1 bits at N and 2N may be selectively coupled to an adder using controlled inverter circuits based on a mode control signal, for example. Partial products illustrated in FIG. 3B may be added to produce a resulting output product.
FIG. 3C illustrates multiplication where y is signed and x is unsigned. A twos complement multiplication may be factored to produce the following:
xy=\sum_{i=0}{circumflex over ( )}{n−1}(\sum_{j=0}{circumflex over ( )}{n−2}(x_i y_j2{circumflex over ( )}(i+j)))−2{circumflex over ( )}(n−1)y_(n−1)\sum_{i=0}{circumflex over ( )}{n−1}(2{circumflex over ( )}i x_i); or
i = 0 n - 1 j = 0 n - 2 x i y j 2 i + J - 2 n - 1 y n - 1 i = 0 n - 1 2 i x i .
The x and y partial products for the above is shown in FIG. 3C. In this example, partial product outputs associated with a most significant bit of operand y (e.g., y7) are inverted and other partial products are not inverted. Similar to above, a 1 is added in the 2Nth bit position (e.g., 2N position representing a negative number). Here, a second 1 bit is added in the Nth bit position. These inverted partial products associated with the y MSB (here, y7) and the 1 bits added at N and 2N may be selectively coupled to an adder using controlled inverter circuits based on a mode control signal, for example.
FIG. 3D illustrates partial products resulting from multiplication of an unsigned value and an unsigned value. This case represents the case where none of the partial products are inverted and no constant values are added. Accordingly, the constant 1 values and inversions described above are all turned off, and the partial products may be output directly without inversion.
FIG. 3A-D illustrate that a multimodal multiplier may be implemented for x and y operands comprising N bit values using 2N+2 controlled inverter circuits, for example. When multiplying signed-signed operands, 2(N−1) partial products of the MSBs of x and y are inverted (excluding the product of both MSBs xNyN), and two constant values of 1 may be selectively introduced in bit positions N+1 and 2N as illustrated in FIG. 3A. When multiplying y-unsigned and x-signed operands, N partial products of the MSB of x are inverted and two constant values of 1 may be selectively introduced in bit positions N and 2N as illustrated in FIG. 3B. Alternatively, when multiplying y-signed and x-unsigned operands, N partial products of the MSB of y are inverted and two constant values of 1 may be selectively introduced in bit positions N and 2N as illustrated in FIG. 3C. Finally, when multiplying y-unsigned and x-unsigned operands, the partial products are not inverted and no constants are added as illustrated in FIG. 3D. Advantageously, the above described multiplier supports combinations of input formats. For example, the first operand format may be one of a signed integer, an unsigned integer, or a float, and the second operand format may be one of a signed integer, an unsigned integer, or a float. The mode control signal is based on the format of both the first operand and second operand so that the appropriate mode control signal may be sent to the multiplier to configure the controlled inverter circuits as described above.
FIG. 4A illustrates an example controlled inverter circuit according to an embodiment. In this example, a controlled inverter is implemented as an XOR logic circuit, where one input is coupled to the partial product to be inverted (e.g., a partial product associated with an MSB as described above, pp_msb) and the other input is coupled to one bit of the mode control signal, for example. When the mode bit is in one state, the XOR passes the pp_msb unchanged, and when the mode bit is in another state, the XOR inverts the pp_msb.
FIG. 4B illustrates another example controlled inverter circuit according to an embodiment. In this example, a mode bit is coupled through an inverter to create an inverse mode bit. A partial product to be inverted is coupled to the output through one of two paths. A first path through switch 412 couples the partial product to the output unchanged. A second path through inverter 411 and switch 413 couples the partial product to the output inverted. Mode bit and inverse mode bit are configured so that only one of switches 412 and 413 are closed at any given time. Circuits using the techniques shown in FIGS. 4A and 4B are example means for selectively inverting the partial product outputs from the multiplication circuitry based on a mode control signal.
FIG. 5 illustrates example multiplier circuits according to another embodiment. In this example, a multiplier includes controlled inverter circuits 510-515 configured using a mode control signal (“mode”), which may configure the system into one of four (4) states based on whether the input operands are both signed, signed-unsigned, unsigned-signed, or both unsigned. The input operands may be integer values or significands of floating point values represented in twos complement binary, for example. Floating point values may have the form “significand×baseexponent,” where the exponents may be added (not shown). A first plurality of controlled inverter circuits 510 are configured to receive partial products resulting from a most significant bit of operand x (xN) combined with the bits of operand y excluding the most significant bit (y0 . . . yN−1). Similarly, a second plurality of controlled inverter circuits 511 are configured to receive partial products resulting from a most significant bit of operand y (yN) combined with the bits of operand x excluding the most significant bit (x0 . . . xN−1). Another controlled inverter circuit 512 is configured to receive a partial product resulting from the most significant bit of operand x combined with the most significant bit of operand y (xNyN). Further, a controlled inverter circuit 513 is configured to receive a constant bit value and selectively include a 1 in the Nth bit position to be added with partial products in the Nth bit position (e.g., for unsigned-signed mode and signed-unsigned mode). Similarly, a controlled inverter circuit 514 is configured to receive a constant bit value and selectively include a 1 in the N+1 bit position to be added with partial products in the N+1 bit position (for signed-signed mode). Additionally, a controlled inverter circuit 515 is configured to receive a constant bit value and selectively include a 1 in the 2N bit position (for all modes but unsigned-unsigned mode). Finally, (N−1)2 partial products may be coupled directly to the input of adder 550 to be combined with the outputs of controlled inverters 510-515 to produce a final output product, for example.
FIG. 6 illustrates a method of multiplying according to another embodiment. At 601, digital bits of first and second operands may be multiplied to produce partial products. The digital bits may be twos complement integers or floating point numbers, for example. The operands format may be combinations of a signed integer and an unsigned integer, or two floats, for example. Multiplication circuitry may comprise logic for combining each digital value to produce a partial product (e.g., logic circuits such as AND gates). At 602, a first portion of the partial product outputs of the multiplication circuitry are received in a plurality of controlled inverter circuits. At 603, the first portion of the partial product outputs of the multiplication circuitry are selectively inverted based on a mode control signal. For example, in different modes, some partial products of the first portion are inverted, while in other modes other partial products of the first portion are inverted as illustrated above in FIGS. 3A-D, for example. At 604, a second portion of the partial product outputs of the multiplication circuitry and outputs of the controlled inverter circuits are received in an adder circuit. An adder circuit may also receive controlled inverter circuits having inputs coupled to constant values to selectively add a 1 in particular bit positions in different modes, for example. At 605, the second portion of the partial product outputs of the multiplication circuitry and the outputs of the controlled inverter circuits are added to produce digital bits corresponding to the product of the first and second operands. In one embodiment, the result may comprise a sum and a carry, for example.
FIG. 7 illustrates an example machine learning processor according to one embodiment. Machine learning processor 700 (aka, Artificial Intelligence (AI) processor) may include memory and arithmetic units optimized for multiplying and adding input data with weight sets (e.g., trained or being trained) for machine learning applications (e.g., training or inference). For example, machine learning processor 700 includes a vector processor (V×M) 710 for performing operations on vectors (i.e., one-dimensional arrays of values). In this example, other elements of the system are arranged symmetrically on either side of the V×M 710 to optimize processing speed. For example, V×M 710 is adjacent to memories 711 and 712, switch matrices (S×M) 713 and 714 to control routing of data, data format and presentation controllers (NIM) 715 and 716, and a matrix multiplication unit (M×M) 717 and 718. M× Ms 717 and 718 and V×M 710 may include circuits as described herein for example. An instruction control unit (ICU) 720 controls the flow of data and execution of operations across blocks 710-718, for example. Machine learning processor 700 includes communications circuits such as chip-to-chip (C2C) circuits 723-724 (e.g., for parallel operation of multiple processors 700) and an external communication circuit (e.g., PCIe) 721 (e.g., for communication with other computer systems, such as one or more servers). Processor 700 may further include a chip control unit (CCU) 722 to control boot operations, clock resets, and other low level setup operations, for example.
The above specification provides illustrative and example descriptions of various embodiments. While the present disclosure illustrates various techniques and embodiments as physical circuitry (e.g., on an integrated circuit), it is to be understood that such techniques and innovations may also be embodied in a hardware description language program such as VHDL or Verilog as is understood by those skilled in the art. A hardware description language (HDL) is a specialized computer language used to describe the structure and behavior of electronic circuits, including digital logic circuits. A hardware description language results in an accurate and formal description of an electronic circuit that allows for the automated analysis and simulation of an electronic circuit. An HDL description may be synthesized into a netlist (e.g., a specification of physical electronic components and how they are connected together), which can then be placed and routed to produce the set of masks used to create an integrated circuit including the elements and functions described herein.
The above examples should not be deemed to be the only embodiments, and are presented to illustrate the flexibility and advantages of the particular embodiments as defined by the following claims. Based on the above disclosure and the following claims, other arrangements, embodiments, implementations and equivalents may be employed without departing from the scope of the present disclosure as defined by the claims.

Claims (20)

What is claimed is:
1. A multimodal digital multiplier circuit comprising:
a binary multiplication circuitry configured to combine bits of a first operand and bits of a second operand to produce a plurality of partial product outputs;
a plurality of controlled inverter circuits configured to selectively invert a first portion of the partial product outputs and a plurality of constant bit values based on a plurality of bits of a mode control signal to generate a plurality of outputs by:
combining a first corresponding bit of the mode control signal and one or more corresponding bits of the first portion of the partial product outputs to selectively modify the one or more corresponding bits, and
selectively inverting a corresponding constant bit value based on a second corresponding bit of the mode control signal,
the second corresponding bit being different than at least one other bit of the mode control signal for at least one mode of the multiplier circuit; and
an adder circuit configured to produce bits corresponding to a product of the first and second operands by adding a second portion of the partial product outputs and the outputs of the controlled inverter circuits.
2. The multimodal digital multiplier circuit of claim 1, wherein:
in a first mode corresponding to the first operand being an unsigned value and the second operand being a signed value, the mode control signal configures the controlled inverter circuits to invert a first plurality of the first portion of the partial product outputs and not invert a second plurality of the first portion of the partial product outputs;
in a second mode corresponding to the first operand being a signed value and the second operand being an unsigned value, the mode control signal configures the controlled inverter circuits to invert the second plurality of the first portion of the partial product outputs and not invert the first plurality of the first portion of the partial product outputs;
in a third mode corresponding to the first and second operands being signed values, the mode control signal configures the controlled inverter circuits to invert the first and second plurality of the first portion of the partial product outputs; and
in a fourth mode corresponding to the first and second operands being unsigned values, the mode control signal configures the controlled inverter circuits to not invert the first and second plurality of the first portion of the partial product outputs.
3. The multimodal digital multiplier circuit of claim 1, wherein:
two or more of the partial product outputs associated with a most significant bit of the first operand are inverted in a first mode, and
two or more of the partial product outputs associated with a most significant bit of the second operand are inverted in a second mode.
4. The multimodal digital multiplier circuit of claim 3, wherein the two or more of the partial product outputs associated with the most significant bit of the first operand and bits of the second operand excluding the most significant bit of the second operand are inverted in a third mode, and the two or more of the partial product outputs associated with the most significant bit of the second operand and bits of the first operand excluding the most significant bit of the first operand are inverted in the third mode.
5. The multimodal digital multiplier circuit of claim 1, wherein two of the controlled inverter circuits are configured to selectively invert two of the constant bit values based on the mode control signal, wherein the adder circuit is configured to receive the two selectively inverted constant bit values.
6. The multimodal digital multiplier circuit of claim 5, wherein the first and second operands are N-bit values, wherein the two selectively inverted constant bit values are in bit positions corresponding to Nth and N+1st bit positions of a partial product output of the binary multiplication circuit, and wherein in a first mode a value of one is added to the N+1st bit position and a zero value is added to the Nth bit position, in a second mode and a third mode a value of one is added to the Nth bit position and a zero value is added to the N+1st bit position, and in a fourth mode a zero value is added to the Nth bit position and the N+1st bit position.
7. The multimodal digital multiplier circuit of claim 1, wherein:
a first plurality of the controlled inverter circuits are configured to receive partial products resulting from a most significant bit of the first operand combined with bits of the second operand excluding a most significant bit of the second operand,
a second plurality of the controlled inverter circuits are configured to receive partial products resulting from the most significant bit of the second operand combined with bits of the first operand excluding the most significant bit of the first operand,
a first of the controlled inverter circuits is configured to receive a partial product resulting from the most significant bit of the first operand combined with the most significant bit of the second operand,
a second of the controlled inverter circuits is configured to receive a first of the constant bit values, and
a third of the controlled inverter circuits is configured to receive a second of the constant bit values.
8. The multimodal digital multiplier circuit of claim 1, wherein the first and second operands are N bit values and the plurality of controlled inverter circuits comprising 2N+2 controlled inverter circuits.
9. The multimodal digital multiplier circuit of claim 1, wherein the first and second operands are N bit twos complement values.
10. The multimodal digital multiplier circuit of claim 1, wherein a format of the first operand is one of a signed integer, an unsigned integer, or a float, and wherein a format of the second operand is one of a signed integer, an unsigned integer, or a float, and wherein the mode control signal is based on the formats of both the first and second operands.
11. A method comprising:
multiplying, in binary multiplication circuitry, bits of a first operand and bits of a second operand to produce a plurality of partial product outputs;
selectively inverting, in a plurality of controlled inverter circuits, a first portion of the partial product outputs and a plurality of constant bit values based on a plurality of bits of a mode control signal to generate a plurality of outputs by:
combining a first corresponding bit of the mode control signal and one or more corresponding bits of the first portion of the partial product outputs to selectively modify the one or more corresponding bits, and
selectively inverting a corresponding constant bit value based on a second corresponding bit of the mode control signal,
the second corresponding bit of the mode control signal being different than at least one other bit of the mode control signal for at least one mode of the multiplier circuit; and
adding, in an adder circuit, a second portion of the partial product outputs and the outputs of the controlled inverter circuits to produce bits corresponding to a product of the first and second operands.
12. The method of claim 11, wherein:
in a first mode corresponding to the first operand being an unsigned value and the second operand being a signed value, the mode control signal configures the controlled inverter circuits to invert a first plurality of the first portion of the partial product outputs and not invert a second plurality of the first portion of the partial product outputs;
in a second mode corresponding to the first operand being a signed value and the second operand being an unsigned value, the mode control signal configures the controlled inverter circuits to invert the second plurality of the first portion of the partial product outputs and not invert the first plurality of the first portion of the partial product outputs;
in a third mode corresponding to the first and second operands being signed values, the mode control signal configures the controlled inverter circuits to invert the first and second plurality of the first portion of the partial product outputs; and
in a fourth mode corresponding to the first and second operands being unsigned values, the mode control signal configures the controlled inverter circuits to not invert the first and second plurality of the first portion of the partial product outputs.
13. The method of claim 11, wherein:
two or more of the partial product outputs associated with a most significant bit of the first operand are inverted in a first mode, and
two or more of the partial product outputs associated with a most significant bit of the second operand are inverted in a second mode.
14. The method of claim 13, wherein the two or more of the partial product outputs associated with the most significant bit of the first operand and bits of the second operand excluding the most significant bit of the second operand are inverted in a third mode, and the two or more of the partial product outputs associated with the most significant bit of the second operand and bits of the first operand excluding the most significant bit of the first operand are inverted in the third mode.
15. The method of claim 11 further comprising:
selectively inverting, in two of the controlled inverter circuits, two of the constant bit values based on the mode control signal; and
receiving the two selectively inverted constant bit values in the adder circuit.
16. The method of claim 15, wherein the first and second operands are N-bit values, wherein the two selectively inverted constant bit values are in bit positions corresponding to Nth and N+1st bit positions of a partial product output of the binary multiplication circuit, and wherein in a first mode a value of one is added to the N+1st bit position and a zero value is added to the Nth bit position, in a second mode and a third mode a value of one is added to the Nth bit position and a zero value is added to the N+1st bit position, and in a fourth mode a zero value is added to the Nth bit position and the N+1st bit position.
17. The method of claim 11, wherein the first and second operands are N bit values and the plurality of controlled inverter circuits comprising 2N+2 controlled inverter circuits.
18. The method of claim 11, wherein the first and second operands are N bit twos complement values.
19. The method of claim 11, wherein a format of the first operand is one of a signed integer, an unsigned integer, or a float, and wherein a format of the second operand is one of a signed integer, an unsigned integer, or a float, and wherein the mode control signal is based on the formats of both the first and second operands.
20. A non-transitory machine-readable medium storing a hardware description language program, the hardware description language program comprising sets of instructions, which when executed producing a digital circuit comprising:
a binary multiplication circuitry configured to combine bits of a first operand and bits of a second operand to produce a plurality of partial product outputs;
a plurality of controlled inverter circuits configured to selectively invert a first portion of the partial product outputs and a plurality of constant bit values based on a plurality of bits of a mode control signal to generate a plurality of outputs by:
combining a first corresponding bit of the mode control signal and one or more corresponding bits of the first portion of the partial product outputs to selectively modify the one or more corresponding bits, and
selectively inverting a corresponding constant bit value based on a second corresponding bit of the mode control signal,
the second corresponding bit being different than at least one other bit of the mode control signal for at least one mode of the multiplier circuit; and
an adder circuit configured to produce bits corresponding to a product of the first and second operands by adding a second portion of the partial product outputs and the outputs of the controlled inverter circuits.
US16/137,195 2018-09-20 2018-09-20 Multimodal digital multiplication circuits and methods Active US10831445B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/137,195 US10831445B1 (en) 2018-09-20 2018-09-20 Multimodal digital multiplication circuits and methods
US17/060,621 US11301212B1 (en) 2018-09-20 2020-10-01 Multimodal digital multiplication circuits and methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US16/137,195 US10831445B1 (en) 2018-09-20 2018-09-20 Multimodal digital multiplication circuits and methods

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/060,621 Continuation US11301212B1 (en) 2018-09-20 2020-10-01 Multimodal digital multiplication circuits and methods

Publications (1)

Publication Number Publication Date
US10831445B1 true US10831445B1 (en) 2020-11-10

Family

ID=73051881

Family Applications (2)

Application Number Title Priority Date Filing Date
US16/137,195 Active US10831445B1 (en) 2018-09-20 2018-09-20 Multimodal digital multiplication circuits and methods
US17/060,621 Active US11301212B1 (en) 2018-09-20 2020-10-01 Multimodal digital multiplication circuits and methods

Family Applications After (1)

Application Number Title Priority Date Filing Date
US17/060,621 Active US11301212B1 (en) 2018-09-20 2020-10-01 Multimodal digital multiplication circuits and methods

Country Status (1)

Country Link
US (2) US10831445B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220129244A1 (en) * 2019-08-08 2022-04-28 Achronix Semiconductor Corporation Multiple Mode Arithmetic Circuit

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3795880A (en) * 1972-06-19 1974-03-05 Ibm Partial product array multiplier
US4791601A (en) * 1985-07-23 1988-12-13 Kabushiki Kaisha Toshiba Parallel multiplier with a modified booth algorithm
US5038315A (en) * 1989-05-15 1991-08-06 At&T Bell Laboratories Multiplier circuit
US5121352A (en) * 1990-02-06 1992-06-09 Micron Technology, Inc. Multiplier-accumulator circuit array operable in multiple modes
US6111435A (en) * 1999-06-30 2000-08-29 Intel Corporation Low power multiplexer with shared, clocked transistor
US6366944B1 (en) * 1999-01-15 2002-04-02 Razak Hossain Method and apparatus for performing signed/unsigned multiplication
US20040010536A1 (en) * 2002-07-11 2004-01-15 International Business Machines Corporation Apparatus for multiplication of data in two's complement and unsigned magnitude formats
US20040024804A1 (en) * 2000-02-21 2004-02-05 Zeng Richard B. Linear summation multiplier array implementation for both signed and unsigned multiplication

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3795880A (en) * 1972-06-19 1974-03-05 Ibm Partial product array multiplier
US4791601A (en) * 1985-07-23 1988-12-13 Kabushiki Kaisha Toshiba Parallel multiplier with a modified booth algorithm
US5038315A (en) * 1989-05-15 1991-08-06 At&T Bell Laboratories Multiplier circuit
US5121352A (en) * 1990-02-06 1992-06-09 Micron Technology, Inc. Multiplier-accumulator circuit array operable in multiple modes
US6366944B1 (en) * 1999-01-15 2002-04-02 Razak Hossain Method and apparatus for performing signed/unsigned multiplication
US6111435A (en) * 1999-06-30 2000-08-29 Intel Corporation Low power multiplexer with shared, clocked transistor
US20040024804A1 (en) * 2000-02-21 2004-02-05 Zeng Richard B. Linear summation multiplier array implementation for both signed and unsigned multiplication
US20040010536A1 (en) * 2002-07-11 2004-01-15 International Business Machines Corporation Apparatus for multiplication of data in two's complement and unsigned magnitude formats

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Hatamian et al.: A 70-MHz 8-bit X 8-bit Parallel Pipelined Multiplier in 2.5-um CMOS; IEEE Journal of Solid-State Circuits, vol. SC-21, No. 4, Aug. 1986; 9 pages.
O. A. Pfänder, R. Hacker, H.-J. Pfleiderer, "A Multiplier-Based Concept for Reconfigurable Multiplier Arrays", Int. Conf on Field Programmable Logic and its Applications, pp. 938-942, 2004 (Year: 2004). *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220129244A1 (en) * 2019-08-08 2022-04-28 Achronix Semiconductor Corporation Multiple Mode Arithmetic Circuit
US11650792B2 (en) * 2019-08-08 2023-05-16 Achronix Semiconductor Corporation Multiple mode arithmetic circuit

Also Published As

Publication number Publication date
US11301212B1 (en) 2022-04-12

Similar Documents

Publication Publication Date Title
EP3552090B1 (en) Block floating point for neural network implementations
CN107832082B (en) Device and method for executing artificial neural network forward operation
US6349318B1 (en) Arithmetic processor for finite field and module integer arithmetic operations
US10776078B1 (en) Multimodal multiplier systems and methods
US5280439A (en) Apparatus for determining booth recoder input control signals
US9372665B2 (en) Method and apparatus for multiplying binary operands
US10853037B1 (en) Digital circuit with compressed carry
JPH0447849B2 (en)
JP2020507844A (en) Apparatus and method for processing input operand values
US11301212B1 (en) Multimodal digital multiplication circuits and methods
KR20210103552A (en) Hardware module for converting numbers
TW202109281A (en) Signed multiword multiplier
US20220244911A1 (en) Digital circuitry for normalization functions
EP4275113A1 (en) Numerical precision in digital multiplier circuitry
KR100607586B1 (en) A concurrent support vector machine processor
US20220075598A1 (en) Systems and Methods for Numerical Precision in Digital Multiplier Circuitry
JP3336986B2 (en) Signal processor and multiply-accumulate unit with rounding function used therefor
Khan VHDL Implementation and Performance Analysis of two Division Algorithms
Varma et al. Design a low-latency novel fpga based signed multiplier for communication applications
JP3198868B2 (en) Multiplication processing unit
Almeida Design and evaluation of approximate arithmetic units for machine learning
Shirol et al. Design and Implementation of Adders and Multiplier in FPGA Using ChipScope: A Performance
Liddicoat et al. FPGA-based artificial neural network using CORDIC modules
CN108734282A (en) Intensive digital arithmetical circuit for fixed point machine learning utilizes
Saurav et al. VLSI Architecture of Exponential Block for Non-Linear SVM Classification

Legal Events

Date Code Title Description
FEPP Fee payment procedure

Free format text: ENTITY STATUS SET TO UNDISCOUNTED (ORIGINAL EVENT CODE: BIG.); ENTITY STATUS OF PATENT OWNER: SMALL ENTITY

FEPP Fee payment procedure

Free format text: ENTITY STATUS SET TO SMALL (ORIGINAL EVENT CODE: SMAL); ENTITY STATUS OF PATENT OWNER: SMALL ENTITY

STCF Information on status: patent grant

Free format text: PATENTED CASE

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 4TH YR, SMALL ENTITY (ORIGINAL EVENT CODE: M2551); ENTITY STATUS OF PATENT OWNER: SMALL ENTITY

Year of fee payment: 4