# US 2018/0321910 A1 · Implementation of floating-point trigonometric functions in an integrated circuit device

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2018/0321910 A1
- Document ID: US20180321910A1
- Status: Published application
- Kind: A1
- Application number: 15/633,792
- Filed: 2017-06-27
- Published: 2018-11-08
- Earliest claimed: 2017-05-05
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Martin Langhammer; Bogdan Pasca
- Web page: https://patentgrep.com/patent/US20180321910A1

## CPC

- G06F 7/499: Denomination or exception handling, e.g. rounding or overflow
- G06F 5/012: {in floating-point computations}
- G06F 7/483: Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers {(G06F7/4806, G06F7/4824, G06F7/49, G06F7/491, G06F7/544 take precedence)}
- G06F 7/50: Adding; Subtracting (G06F7/483 - G06F7/491, G06F7/544 - G06F7/556 take precedence)
- G06F 7/523: Multiplying only
- G06F 7/548: Trigonometric functions; Co-ordinate transformations
- G06F 2101/04: Trigonometric functions
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present embodiments relate to integrated circuits with circuitry that implements floating-point trigonometric functions. The circuitry may include an approximation circuit that generates an approximation of the output of the trigonometric functions, a storage circuit that stores predetermined output values of the trigonometric functions, and a selector circuit that selects between different possible output values based on a control signal from a control circuit. In some embodiments, the circuitry may include a mapping circuit and a restoration circuit. The mapping circuit may map an input value from an original quadrant of the trigonometric circle to a predetermined input interval, and the restoration circuit may map the output value selected by the selection circuit back to the original quadrant of the trigonometric circle. If desired, the circuitry may be implemented in specialized processing blocks.

## Claims

### Claim 1

Circuitry for computing a trigonometric function of a first floating-point number, comprising:
an approximation circuit that receives the first floating-point number at an input port and comprises:
an extraction circuit coupled to the input port that generates first and second fixed-point numbers and a second floating-point number based on the first floating-point number,
first and second storage circuits coupled to the extraction circuit that both store predetermined floating-point numbers of output values of the trigonometric function and output third and fourth floating-point numbers of the predetermined floating-point numbers based on the first and second fixed-point numbers, respectively, and
arithmetic circuitry coupled to the extraction circuit and the first and second storage circuits that performs floating-point arithmetic operations on the second, third, and fourth floating-point numbers to generate a fifth floating-point number as an approximation of the trigonometric function of the first floating-point number.

### Claim 2 (depends on 1)

The circuitry of claim 1, further comprising:
a third storage circuit that stores additional predetermined floating-point numbers of additional output values of the trigonometric function and outputs a sixth floating-point number of the additional predetermined floating-point numbers based on the first floating-point number; and
a selection circuit coupled to the third storage circuit and the approximation circuit that selects the trigonometric function of the first floating-point number among the first, fifth, and sixth floating-point numbers based on a control signal.

### Claim 3 (depends on 2)

The circuitry of claim 2, further comprising:
a control circuit that receives the first floating-point number and generates the control signal such that the control signal directs the selection circuit to select the first floating-point number when the first floating-point number lies in a first interval, the fifth floating-point number when the first floating-point number lies in a second interval, and the sixth floating-point number when the first floating-point number lies in a third interval, wherein the first, second, and third intervals are disjoint.

### Claim 4 (depends on 2)

The circuitry of claim 2, wherein the third storage circuit stores additional predetermined floating-point numbers of additional output values of the trigonometric function for a predetermined input interval and wherein a read address that is based on the first floating-point number retrieves the sixth floating-point number from the third storage circuit during a read access operation when the first floating-point number lies in the predetermined input interval.

### Claim 5 (depends on 1)

The circuitry of claim 1, wherein the first floating-point number has a mantissa and an exponent, and wherein the extraction circuit further comprises:
a right shift circuit that shift a first number of bits of the mantissa by a second number of bits to the right to generate the first and second fixed-point numbers, wherein the second number of bits is based on the exponent.

### Claim 6 (depends on 1)

The circuitry of claim 1, wherein the first floating-point number has a mantissa and an exponent, and wherein the extraction circuit further comprises:
a third storage circuit that provides a mask based on a first number of bits of the exponent;
a mask application circuit that applies the mask from the third storage circuit to the mantissa to generate a sixth floating-point number; and
a floating-point subtractor that subtracts an additional predetermined floating-point number from the sixth floating-point number to generate the second floating-point number.

### Claim 7 (depends on 1)

The circuitry of claim 1, wherein the arithmetic circuitry further comprises:
a first floating-point arithmetic circuit that generates a numerator of the fifth floating-point number based on a floating-point addition of the second, third, and fourth floating-point numbers; and
a second floating-point arithmetic circuit that generates a denominator of the fifth floating-point number based on a floating-point addition of the second and third floating-point numbers, a floating-point multiplication with the fourth floating-point number, and a floating-point subtraction from one.

### Claim 8 (depends on 7)

The circuitry of claim 7, wherein the arithmetic circuitry further comprises:
a mantissa inversion circuit coupled to the second floating-point arithmetic circuit that generates a reciprocal of the denominator of the fifth floating-point number; and
a floating-point multiplier circuit that multiplies the numerator of the fifth floating-point number from the first floating-point arithmetic circuit with the reciprocal of the denominator of the fifth floating-point number from the mantissa inversion circuit to generate the fifth floating-point number.

### Claim 9 (depends on 8)

The circuitry of claim 8, wherein the mantissa inversion circuit performs a piecewise polynomial approximation.

### Claim 10

A method for computing a trigonometric function of a first floating-point number in an integrated circuit, comprising:
receiving the first floating-point number at an input port of an approximation circuit;
using an extraction circuit in the approximation circuit to generate first and second fixed-point numbers and a second floating-point number based on the first floating-point number;
retrieving from first and second storage circuits in the approximation circuit, that both store predetermined floating-point numbers of output values of the trigonometric function, third and fourth floating-point numbers of the predetermined floating-point numbers based on the first and second fixed-point numbers, respectively; and
using arithmetic circuitry in the approximation circuit to perform floating-point arithmetic operations on the second, third, and fourth floating-point numbers to generate a fifth floating-point number as an approximation of the trigonometric function of the first floating-point number.

### Claim 11 (depends on 10)

The method of claim 10, further comprising:
retrieving from a third storage circuit, that stores additional predetermined floating-point numbers of additional output values of the trigonometric function, a sixth floating-point number of the additional predetermined floating-point numbers based on the first floating-point number;
using a control circuit that receives the first floating-point number to generate a control signal such that the control signal has a first value when the first floating-point number lies in a first interval, a second value when the first floating-point number lies in a second interval, and a third value when the first floating-point number lies in a third interval, wherein the first, second, and third intervals are disjoint; and
using the control signal to direct a selection circuit coupled to the third storage circuit and the approximation circuit to selects the trigonometric function of the first floating-point number among the first, fifth, and sixth floating-point numbers.

### Claim 12 (depends on 11)

The method of claim 11, wherein retrieving the sixth floating-point number further comprises:
generating a read address that is based on the first floating-point number; and
using the read address to perform a read access operation of the third storage circuit when the first floating-point number lies in a predetermined input interval.

### Claim 13 (depends on 10)

The method of claim 10, wherein the first floating-point number has a mantissa and an exponent, and wherein using the extraction circuit in the approximation circuit to generate the first and second fixed-point numbers and the second floating-point number further comprises:
using a right shift circuit to shift a first number of bits of the mantissa by a second number of bits to the right to generate the first and second fixed-point numbers, wherein the second number of bits is based on the exponent;
retrieving a mask from a third storage circuit using a third number of bits of the exponent;
applying the mask from the third storage circuit to the mantissa to generate a sixth floating-point number; and
subtracting an additional predetermined floating-point number from the sixth floating-point number to generate the second floating-point number.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
using arithmetic circuitry in the approximation circuit to generate the fifth floating-point number by performing floating-point arithmetic operations of the second, third, and fourth floating-point numbers.

### Claim 15 (depends on 14)

The method of claim 14, wherein performing floating-point arithmetic operations of the second, third, and fourth floating-point numbers further comprises:
generating a numerator of the fifth floating-point number based on a floating-point addition of the second, third, and fourth floating-point numbers;
generating a denominator of the fifth floating-point number based on a floating-point addition of the second and third floating-point numbers, a floating-point multiplication with the fourth floating-point number, and a floating-point subtraction from one;
generating a reciprocal of the denominator of the fifth floating-point number; and
multiplying the numerator of the fifth floating-point number with the reciprocal of the denominator of the fifth floating-point number to generate the fifth floating-point number.

### Claim 16

A non-transitory machine-readable storage medium encoded with instructions for configuring circuitry to compute a trigonometric function of a first floating-point number, wherein the circuitry comprises a first storage circuit, an approximation circuit, and a selection circuit coupled to the storage circuit and the approximation circuit, and wherein the approximation circuit comprises an extraction circuit, second and third storage circuits, and arithmetic circuitry, the instructions comprising:
instructions to configure the extraction circuit to generate first and second fixed-point numbers and a second floating-point number based on the first floating-point number;
instructions to configure the second and third storage circuits, that both store predetermined floating-point numbers of output values of the trigonometric function, to output third and fourth floating-point numbers of the predetermined floating-point numbers based on the first and second fixed-point numbers, respectively; and
instructions to configure the arithmetic circuitry to perform floating-point arithmetic operations on the second, third, and fourth floating-point numbers to generate a fifth floating-point number as an approximation of the trigonometric function of the first floating-point number.

### Claim 17 (depends on 16)

The non-transitory machine-readable storage medium of claim 16, further comprising:
instructions to configure the first storage circuit that stores additional predetermined floating-point numbers of additional output values of the trigonometric function to output a sixth floating-point number of the additional predetermined floating-point numbers based on the first floating-point number; and
instructions to configure the selection circuit to select the trigonometric function of the first floating-point number among the first, fifth, and sixth floating-point numbers based on a control signal.

### Claim 18 (depends on 16)

The non-transitory machine-readable storage medium of claim 16, further comprising:
instructions to generate the instructions of claim 16.

### Claim 19 (depends on 16)

The non-transitory machine-readable storage medium of claim 16, wherein the arithmetic circuitry comprises first and second floating-point arithmetic circuits, further comprising:
instructions to configure the first floating-point arithmetic circuit to generates a numerator of the fifth floating-point number based on a floating-point addition of the second, third, and fourth floating-point numbers; and
instruction to configure the second floating-point arithmetic circuit to generate a denominator of the fifth floating-point number based on a floating-point addition of the second and third floating-point numbers, a floating-point multiplication with the fourth floating-point number, and a floating-point subtraction from one.

### Claim 20 (depends on 19)

The non-transitory machine-readable storage medium of claim 19, wherein the arithmetic circuitry further comprises a mantissa inversion circuit and a floating-point multiplier circuit, further comprising:
instructions to configure the mantissa inversion circuit to generate a reciprocal of the denominator of the fifth floating-point number; and
instructions to configure the floating-point multiplier circuit to multiply the numerator of the fifth floating-point number from the first floating-point arithmetic circuit with the reciprocal of the denominator of the fifth floating-point number from the mantissa inversion to generate the fifth floating-point number.
