Processing unit, method and computer program for multiplying at least two multiplicands
AssigneeRobert Bosch GmbH
InventorSebastian Vogel
Life of this patent
Estimating the term…
Abstract
A processing unit and a method for multiplying at least two multiplicands. The multiplicands are present in an exponential notation, that is, each multiplicand is assigned an exponent and a base. The processing unit is configured to carry out a multiplication of the multiplicands and includes at least one bitshift unit, the bitshift unit shifting a binary number a specified number of places, in particular, to the left; an arithmetic unit, which carries out an addition of two input variables and a subtraction of two input variables; and a storage device. A computer program, which is configured to execute the method, and a machine-readable storage element, in which the computer program is stored, are also described.
Claims18
A processing unit, which is configured to carry out a multiplication of at least two multiplicands, the multiplicands each having a first exponent and a first base, each of the first bases having a second base, a second exponent, and a third exponent, the processing unit comprising:
- at least one bitshift unit, the at least one bitshift unit configured to shift a binary number a specified number of places to the left;
- an arithmetic unit;
- and
- a storage device;
- wherein:
- the arithmetic unit is configured to carrying out a subtraction of the third exponents,
- the at least one bitshift unit is configured to carry out a first shift of a binary number of the first exponent of one of the multiplicands by a number of places of a value of the subtracted third exponents, wherein the at least one bitshift unit carries out the first shift by filling in a plurality of zeros on the right side of a register of the at least one bitshift unit as a function of the value of the subtraction of the third exponents;
- the arithmetic unit configured to carry out an addition of a result of the first shift of the first exponent of the one of the multiplicands,
- a result of the addition being split up into an integer part and a fractional part as a function of a value of a smaller exponent of the third exponents,
- a binary number of the fractional part being fetched out of the storage device, wherein the fractional part is used as an address for fetching the binary value of the fractional part out of the storage device, and
- the at least one bitshift unit configured to carry out a second shift of the binary number of the fractional part by a number of places of a value of the integer part.
A method for multiplying at least two multiplicands in a processing unit, the processing unit including at least one bitshift unit, an arithmetic unit, and a storage device, the multiplicands each having a first exponent and a first base, each of the first bases having a second base, a second exponent, and a third exponent, the method comprising the following steps:
- providing the first exponents of the multiplicands and the third exponents, each of the provided first exponents and the third exponents being quantized;
- subtracting, by the arithmetic unit, the third exponents;
- first shifting of a binary number of the first exponents of one of the multiplicands by a number of places of a value of the subtracted third exponents, wherein the first shifting is carried out by the at least one bitshift unit filling in a plurality of zeros on the right side of a register of the at least one bitshift unit as a function of the value of the subtraction of the third exponents;
- adding, by the arithmetic unit, a result of the first shifting to the first exponent of the one of the multiplicands;
- splitting up a result of the addition into an integer part and a fractional part as a function of a smaller exponent of the third exponents;
- fetching a binary number of the fractional part out of the storage device, wherein the fractional part is used as an address for fetching the binary value of the fractional part out of the storage device;
- and
- second shifting of the binary number of the fractional part by a number of places of a value of the integer part by the at least one bitshift unit.
The method as recited in 6, wherein the provided first exponents and third exponents are each represented by a maximum of 10 bits.
A method for operating a machine learning system, in each instance, a plurality of parameters of the machine learning system and intermediate variables of the machine learning system being stored as multiplicands in a storage device, using an exponential notation, each of the stored multiplicands having a first exponent and a first base, each of the first bases having a second base, a second exponent, and a third exponent, multiplications of at least two of the stored multiplicands being carried out by a processing unit, the processing unit including at least one bitshift unit, an arithmetic unit, and a storage device, performing the following steps:
- providing the first exponents of the at least two multiplicands and the third exponents of the first bases of the at least two of the multiplicands, each of the provided first exponents and the third exponents being quantized;
- subtracting, by the arithmetic unit, the third exponents of the first bases of the at least two of the multiplicands;
- first shifting of a binary number of the first exponents of one of the at least two multiplicands by a number of places of a value of the subtracted third exponents, wherein the first shifting is carried out by the at least one bitshift unit filling in a plurality of zeros on the right side of a register of the at least one bitshift unit as a function of the value of the subtraction of the third exponents;
- adding, by the arithmetic unit, a result of the first shifting to the first exponent of the one of the at least two multiplicands;
- splitting up a result of the addition into an integer part and a fractional part as a function of a smaller exponent of the third exponents of the first bases of the at least two of the multiplicands;
- fetching a binary number of the fractional part out of the storage device, wherein the fractional part is used as an address for fetching the binary value of the fractional part out of the storage device;
- and
- second shifting of the binary number of the fractional part by a number of places of a value of the integer part by the at least one bitshift unit.
A non-transitory machine-readable storage element on which is stored a computer program for multiplying at least two multiplicands in a processing unit, the processing unit including at least one bitshift unit, an arithmetic unit, and a storage device, the multiplicands each having a first exponent and a first base, each of the first bases having a second base, a second exponent, and a third exponent, the computer program, when executed by a computer, causing the computer to perform the following steps:
- providing the first exponents of the multiplicands and the third exponents, each of the provided first exponents and the third exponents being quantized;
- subtracting, by the arithmetic unit, the third exponents;
- first shifting of a binary number of the first exponents of one of the multiplicands by a number of places of a value of the subtracted third exponents, wherein the first shifting is carried out by the at least one bitshift unit filling in a plurality of zeros on the right side of a register of the at least one bitshift unit as a function of the value of the subtraction of the third exponents;
- adding, by the arithmetic unit, a result of the first shifting to the first exponent of the one of the multiplicands;
- splitting up a result of the addition into an integer part and a fractional part as a function of a smaller exponent of the third exponents;
- fetching a binary number of the fractional part out of the storage device, wherein the fractional part is used as an address for fetching the binary value of the fractional part out of the storage device;
- and
- second shifting of the binary number of the fractional part by a number of places of a value of the integer part by the at least one bitshift unit.
A non-transitory machine-readable storage element on which is stored a computer program for operating a machine learning system, in each instance, a plurality of parameters of the machine learning system and intermediate variables of the machine learning system being stored as multiplicands in a storage device, using an exponential notation, each of the stored multiplicands having a first exponent and a first base, each of the first bases having a second base, a second exponent, and a third exponent, the computer program, when executed by a computer, the computer including at least one bitshift unit, an arithmetic unit, and a storage device, causing the computer to perform multiplications of at least two of the stored multiplicands by performing the following steps:
- providing the first exponents of the at least two multiplicands and the third exponents of the first bases of the at least two of the multiplicands, each of the provided first exponents and the third exponents being quantized;
- subtracting, by the arithmetic unit, the third exponents of the first bases of the at least two of the multiplicands;
- first shifting of a binary number of the first exponents of one of the at least two multiplicands by a number of places of a value of the subtracted third exponents, wherein the first shifting is carried out by the at least one bitshift unit filling in a plurality of zeros on the right side of a register of the at least one bitshift unit as a function of the value of the subtraction of the third exponents;
- adding, by the arithmetic unit, a result of the first shifting to the first exponent of the one of the at least two multiplicands;
- splitting up a result of the addition into an integer part and a fractional part as a function of a smaller exponent of the third exponents of the first bases of the at least two of the multiplicands;
- fetching a binary number of the fractional part out of the storage device, wherein the fractional part is used as an address for fetching the binary value of the fractional part out of the storage device;
- and
- second shifting of the binary number of the fractional part by a number of places of a value of the integer part by the at least one bitshift unit.
Dependencies are inferred from the claim text.