Dot Product Circuit for Trigonometric Function Calculation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional methods for calculating trigonometric functions in computer systems are inefficient due to complexity, precision issues, and space constraints, particularly when dealing with input arguments expressed in radians, which require additional processing and can lead to errors in denormalized numbers or loss of precision.
Innovation Solution
A modified four-element dot product (Dp4) circuit is used to compute the input argument t = x/π, incorporating a representation of 1/π and adjusting outputs through shifting and sign stages to approximate t within floating-point precision, avoiding errors from bit cancellation and maintaining precision across various input ranges.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If conventional computer instructions are used to calculate trigonometric functions using primitive mathematical operations, then the functions can be computed with basic arithmetic, but the calculation speed is very slow due to the complexity of trigonometric functions
Solution Approach 1:
The patent replaces sequential software-based arithmetic operations with a parallel hardware circuit implementation. The dot product circuit computes trigonometric functions through simultaneous multiplication and addition operations in hardware, eliminating the sequential execution bottleneck of software instructions and achieving significant speed improvement.
Solution Approach 2:
The patent introduces a dot product circuit as an intermediary computational unit that specializes in trigonometric function calculation. This dedicated circuit acts as a mediator between the input arguments and the final trigonometric function outputs, providing optimized computation path that avoids the general-purpose arithmetic overhead.
2Measurement precision
If a look up table is used to compute trigonometric function outputs, then precision can be improved, but a very large look up table is required which consumes excessive chip area
Solution Approach 1:
The patent changes the computational approach from table lookup to active calculation using a dot product circuit. By transforming the static lookup table approach into a dynamic computational circuit, the system achieves high precision outputs without requiring large amounts of stored data, thus reducing chip area consumption.
Solution Approach 2:
The patent uses a mathematical identity (cos(x) = sin(x + π/2)) to compute cosine functions by copying and transforming sine function results. This allows a single dot product circuit to handle both sine and cosine calculations, reducing the need for separate computational resources and minimizing chip area.
3Productivity
If a dedicated circuit is programmed specifically to compute the trigonometric function, then computation speed can be improved, but a large area on the silicon chip is required which may not be available within size constraints
Solution Approach 1:
The patent designs a dot product circuit that can universally compute multiple trigonometric functions (sine, cosine, and their combinations) through a single unified structure. By making the circuit multi-functional, the system achieves fast computation for various trigonometric operations without requiring separate dedicated circuits for each function, thus reducing overall chip area.
Solution Approach 2:
The patent merges the computation of sine and cosine functions into a single dot product circuit by utilizing the mathematical relationship between them. This consolidation combines what would traditionally require separate computational resources into one unified circuit, achieving both speed improvement and area reduction.
4Adaptability or versatility
If input arguments in radians are converted to t = x/π for trigonometric calculation, then the trigonometric function can be computed with standard circuits, but additional processing time is required and precision may be lost
Solution Approach 1:
The patent performs the division by π operation as part of the initial input processing stage, preparing the argument in the required format before the main trigonometric computation. By doing this preliminary transformation early in the pipeline, the system avoids adding extra processing steps later and maintains efficient overall computation time.
5Adaptability or versatility
If input arguments are converted to t = x/π, then standard trigonometric circuits can be used, but errors may occur in denormalized numbers and precision may be lost
Solution Approach 1:
The patent replaces software-based division and normalization handling with a hardware dot product circuit that natively handles the t = x/π transformation. This hardware implementation avoids the precision loss and denormalized number errors that occur in software floating-point arithmetic, maintaining reliability across the full input range.
Data Source
Figure 1
Figure 2A
Figure 2B
AI summary
A circuit is disclosed that uses a four element dot product circuit (DP4) to approximate an argument t = x/pi for an input x. The argument is then input to a trigonometric function such as SinPi() or CosPi(). The DP4 circuit calculates x times a representation of the reciprocal of pi. The bits of the recprical of pi that are used are selected based on the magnitude of the exponent of x. The DP4 circuit includes four multipliers, two intermediate adders, and a final adder. The outputs of the multipliers, intermediate adders, and final adder are adjusted such that the output of the final adder is a value of the argument t that will provide an accurate output when input to the trigonometric function.