A method and device for realizing sine and cosine function calculation

A technology of sine and cosine functions and implementation methods, which is applied in the direction of calculation, electrical digital data processing, and digital data processing components, etc., and can solve problems such as floating point errors, operand bit width and iteration number errors, and large errors in calculation results. Achieve the effect of optimizing bit width, reducing the number of bits, and efficient calculation

Active Publication Date: 2021-07-13
NAT UNIV OF DEFENSE TECH
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] However, when using the CORDIC algorithm to calculate the sine and cosine functions, errors will occur due to the limited operand bit width and the number of iterations, and the input angle belongs to Z R ε[0,π / 2], when the input angle Z R Approaching to 0 or π / 2, the relative floating point error of the calculation result using the CORDIC algorithm is relatively large, resulting in a large error in the final calculation result

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and device for realizing sine and cosine function calculation
  • A method and device for realizing sine and cosine function calculation
  • A method and device for realizing sine and cosine function calculation

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0053] The present invention will be further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.

[0054] Such as figure 1 As shown, the implementation method of the sine and cosine function calculation in this embodiment, the steps include:

[0055] 1) Angle compression: determine whether the input angle is within the specified range, if so, output the input angle as the target calculation angle, otherwise compress the input angle, and output the compressed output angle as the target calculation angle;

[0056] 2) TCORDIC calculation: calculate the angle Z for the target R Use the TCORDIC algorithm to perform the calculation of the sine or cosine function, and when the difference between the target calculation angle and 0 degrees or π / 2 degrees is less than the specified threshold, the calculation of the sine or cosine function is completed through the Tay...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method and device for realizing calculation of sine and cosine functions. The steps include: 1) judging whether the input angle is within a specified range, if so, outputting the input angle as the target calculation angle, otherwise compressing the input angle, and Output the compressed angle as the target calculation angle output; 2) use the TCORDIC algorithm to perform the calculation of the sine or cosine function on the target calculation angle, and when the difference between the target calculation angle and 0 degrees or π / 2 degrees is less than the specified threshold, The calculation of the sine or cosine function is completed through the Taylor expansion, otherwise the calculation of the sine and cosine function is completed by using the CORDIC algorithm; the device includes an angle compression unit and a TCORDIC calculation unit. The invention can realize the calculation of the sine and cosine functions of any angle, and has the advantages of simple implementation method, low calculation complexity, high calculation efficiency and precision, and the like.

Description

technical field [0001] The invention relates to the technical field of function calculations, in particular to a method and device for realizing sine and cosine function calculations. Background technique [0002] Calculation of sine and cosine functions is an important part of scientific computing and engineering applications. This type of calculation usually requires that the error of the calculation result can be small, and it needs to be applicable to any input angle range. CORDIC (COordinate Rotation DIgital Computer, Coordinate Rotation Digital Computer) is a digital iterative algorithm for calculating a variety of transcendental functions. The CORDIC algorithm can complete the calculation of trigonometric functions through simple addition and shift operations, and the algorithm is regular , the structure is simple, and can be easily implemented on hardware, the expression is as follows: [0003] [0004] where X 0 = K n ,Y 0 =0,Z 0 ∈[0,π / 2], the iteration resu...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F7/548
CPCG06F7/548
Inventor 雷元武朱保周彭元喜刘宗林陈海燕陈胜刚许邦建马胜田甜彭浩徐恩王建之张榜
Owner NAT UNIV OF DEFENSE TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products