Trigonometric function calculation circuit structure and calculation chip

By using a circuit structure based on interval judgment and sign correction, and leveraging the symmetry of trigonometric functions, the problem of insufficient storage resources in traditional trigonometric function calculation methods is solved, achieving efficient trigonometric function calculation, saving storage space, and improving system performance.

CN224035885UActive Publication Date: 2026-03-24NINGBO FOTILE KITCHEN WARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Traditional methods for calculating trigonometric functions require a large amount of storage resources, which limits system performance, especially in complex motor control systems where they cannot meet real-time calculation requirements.

Method used

A combined circuit structure consisting of an interval judgment unit, an address index unit, a storage unit, and a sign correction unit is adopted. By utilizing the symmetry of trigonometric functions, the trigonometric function values ​​are divided into several intervals. Only some values ​​are stored, and the other values ​​are obtained by changing the sign. Combined with hardware circuit design, efficient calculation is achieved.

Benefits of technology

It significantly saves storage space, ensures computing performance and real-time performance, reduces storage requirements, and improves the overall performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN224035885U_ABST
    Figure CN224035885U_ABST
Patent Text Reader

Abstract

The utility model relates to a trigonometric function calculation circuit structure and a calculation chip. The trigonometric function calculation circuit structure comprises an interval judgment unit, an address index unit, a storage unit and a symbol correction unit, the interval judgment unit comprises a comparator circuit module, and the comparator circuit module is used for outputting an interval signal based on a comparison result of the to-be-calculated data and a preset comparison value; the address index unit comprises a subtractor circuit module; the subtractor circuit module is used for calculating a storage address signal corresponding to the to-be-calculated data based on the interval signal; the storage unit is used for storing a plurality of preset function values; and the symbol correction unit is used for performing symbol correction on a preset function value based on the received interval signal and outputting a trigonometric function value corresponding to the to-be-calculated data. In the embodiment of the invention, only part of trigonometric function values are stored, and the rest part is obtained by carrying out symbol change based on symmetry, so that the storage space is remarkably saved, and meanwhile, through efficient design of a hardware circuit, the calculation performance and the real-time performance are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of electronic circuits, in particular to a trigonometric function calculation circuit structure and a calculation chip. BACKGROUND

[0002] In vector control of a permanent magnet synchronous motor, coordinate transformation is a core link for realizing high-performance control, and calculation of trigonometric functions is an indispensable part of coordinate transformation. A traditional method for calculating sine and cosine functions usually adopts a lookup table method, that is, angle values and corresponding trigonometric function values are calculated in advance and stored in a lookup table, and corresponding trigonometric function values are obtained by directly looking up the table according to input angles.

[0003] However, in order to meet the calculation accuracy, the lookup table method usually needs to store 1024 different angle values corresponding to trigonometric function values, so as to correspond to a 10-bit angle resolution required by vector control, and a large storage space is occupied. Moreover, as the complexity of the motor control system increases, the microcontroller needs to process more tasks, and excessive occupation of storage resources will limit the overall performance of the system, and even cause the system to fail to operate normally. CONTENT OF THE INVENTION

[0004] In order to solve the above technical problems, the application provides a trigonometric function calculation circuit structure and a calculation chip.

[0005] In a first aspect, the application discloses a trigonometric function calculation circuit structure, comprising an interval judgment unit, an address index unit, a storage unit and a sign correction unit.

[0006] The interval judgment unit comprises a comparator circuit module, and the input end of the comparator circuit module is used for receiving to-be-calculated data. The comparator circuit module is used for outputting an interval signal based on the to-be-calculated data and a preset comparison value.

[0007] The address index unit comprises a subtracter circuit module. Two input ends of the subtracter circuit module receive the interval signal and the to-be-calculated data respectively, and are used for calculating a storage address signal corresponding to the to-be-calculated data based on the interval signal.

[0008] The storage unit is used for storing a plurality of preset function values. The input end of the storage unit is used for receiving the storage address signal output by the output end of the address index unit. The output end of the storage unit is connected with the first input end of the sign correction unit, and is used for sending the preset function value corresponding to the storage address signal.

[0009] The second input end of the sign correction unit is connected with the output end of the interval judgment unit, and is used for performing sign correction on the preset function value based on the interval signal to obtain a trigonometric function value.

[0010] In some possible embodiments, the to-be-calculated data comprises angle data.

[0011] The interval judging unit further comprises a unit value conversion module, which is configured to convert the angle data into corresponding unit value data; an output end of the unit value conversion module is connected with an input end of the comparator circuit module, and configured to send the unit value data to the comparator circuit module.

[0012] In some possible embodiments, the unit value conversion module comprises a multiplier circuit and a shifter;

[0013] An output end of the multiplier circuit is connected with an input end of the shifter; the multiplier circuit is configured to multiply the received angle data with a preset multiplication value to obtain a multiplication result, and send the multiplication result to the shifter; the shifter is configured to right shift the multiplication result by a first preset bit number to obtain the unit value data of an integer.

[0014] In some possible embodiments, the storage unit comprises a plurality of sub-storage units, each of which is configured to store different preset function values; the number of the unit value data is a first number, the number of the sub-storage units is a second number, and the second number is one half or one fourth of the first number.

[0015] In some possible embodiments, the comparator circuit module comprises a first digital comparator, a second digital comparator, a third digital comparator and a second logic gate circuit;

[0016] The first digital comparator, the second digital comparator and the third digital comparator have different preset comparison values; the input ends of the first digital comparator, the second digital comparator and the third digital comparator are all inputted with the unit value data, and the output ends thereof are all connected with the second logic gate circuit;

[0017] The second logic gate circuit is configured to obtain the interval signal of the comparator circuit module based on a first comparison result of the first digital comparator, a second comparison result of the second digital comparator and a third comparison result of the third digital comparator.

[0018] In some possible embodiments, the subtracter circuit module comprises a first subtracter, a second subtracter and a multiplexer;

[0019] A first input end of the first subtracter is connected with a first subtraction value, a second input end is inputted with the unit value data, and an output end outputs a first subtraction result; a first input end of the second subtracter is connected with a second subtraction value, a second input end is connected with the unit value data, and an output end outputs a second subtraction result;

[0020] The first input end of the multiplexer inputs the unitary data, the second input end is connected with the output end of the first subtractor, the third input end is connected with the output end of the first subtractor, the fourth input end is connected with the output end of the second subtractor, and the control end receives the interval signal; and the multiplexer is used for outputting the storage address signal corresponding to the unitary data based on the interval signal.

[0021] In some possible embodiments, the sign correction unit comprises a first logic gate circuit module, a first input end of the first logic gate circuit module is connected with the storage module, and a second input end is connected with the output end of the comparator circuit module, and is used for performing sign correction on the trigonometric function value according to the interval signal.

[0022] In some possible embodiments, the data truncation circuit is further connected with the input end of the sign correction unit, and is used for truncating the trigonometric function value corresponding to the to-be-calculated data to the second preset bit number.

[0023] In some possible embodiments, the circuit further comprises a first power supply module, a second power supply module and a power supply control module; and the storage unit comprises a first storage module and a second storage module.

[0024] The first power supply module is connected with the first storage module, and is used for supplying power for the first storage module; the second power supply module is connected with the second storage module, and is used for supplying power for the second storage module; and the power supply control module is in communication connection with the output end of the comparator circuit module and the first power supply module and the second power supply module, and is used for controlling the first power supply module or the second power supply module to be in a power supply state based on the interval signal.

[0025] In the second aspect, the embodiments of the present application disclose a calculation chip comprising the trigonometric function calculation circuit structure in any of the above.

[0026] The technical scheme provided by the embodiments of the present application has the following technical effects:

[0027] The trigonometric function calculation circuit structure of the embodiment of the present application comprises an interval judgment unit, an address index unit, a storage unit and a sign correction unit. The interval judgment unit comprises a comparator circuit module, the input end of the comparator circuit module is used for receiving the input data to be calculated, and the comparator circuit module is used for outputting an interval signal based on the comparison result of the data to be calculated and a preset comparison value. The address index unit comprises a subtracter circuit module. The first input end of the subtracter circuit module is connected with the output end of the interval judgment unit, and the second input end is used for receiving the data to be calculated. The subtracter circuit module is used for calculating the storage address signal corresponding to the data to be calculated based on the interval signal. The storage unit is used for storing a plurality of preset function values. The input end of the storage unit is connected with the output end of the address index unit, and is used for receiving the storage address signal. The output end of the storage unit is connected with the first input end of the sign correction unit, and is used for sending the preset function value corresponding to the data to be calculated to the sign correction unit. The second input end of the sign correction unit is connected with the output end of the interval judgment unit, and is used for performing sign correction on the preset function value based on the received interval signal, and outputting the trigonometric function value corresponding to the data to be calculated. In the embodiment of the present application, the symmetry of the trigonometric function is used to divide the trigonometric function value into a plurality of intervals, and only part of the trigonometric function values are stored. The rest of the trigonometric function values are obtained by sign change based on the symmetry of the stored trigonometric function values, thereby significantly saving the storage space, and ensuring the calculation performance and real-time performance through the efficient design of the hardware circuit. BRIEF DESCRIPTION OF DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art and the advantages thereof, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.

[0029] Figure 1 is a module schematic diagram of a trigonometric function calculation circuit structure provided by the embodiment of the present application Figure 1 ;

[0030] Figure 2 is a module schematic diagram of a trigonometric function calculation circuit structure provided by the embodiment of the present application Figure 2 ;

[0031] Figure 3 is a schematic diagram of a unit of the embodiment of the present application

[0032] Figure 4 is a schematic diagram of a comparator circuit module provided by the embodiment of the present application

[0033] Figure 5is a schematic diagram of a subtracter circuit module provided by an embodiment of the present application;

[0034] Figure 6 is a module schematic diagram of a trigonometric function calculation circuit structure provided by an embodiment of the present application Figure 3 ;

[0035] Figure 7 is a module schematic diagram of a trigonometric function calculation circuit structure provided by an embodiment of the present application Figure 4 .

[0036] Reference signs:

[0037] 1, interval judging unit; 11, comparator circuit module; 12, unit value conversion module; 2, address index unit; 21, subtracter circuit module; 3, storage unit; 4, sign correction unit; 5, data truncation circuit; 6, first power supply module; 7, second power supply module; 8, power supply control module. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0039] It should be noted that the description of the application embodiments refers to "one embodiment" or "an embodiment" in the specification and claims, which means that a particular feature, structure or characteristic described in connection with the embodiment can be included in at least one implementation of the application. It is understood that the terms "upper", "lower", "top", "bottom" and the like as used herein refer to the orientation or position shown in the drawings and are used for convenience only in describing the application and the principal direction of the application and are not intended to mean or imply that the application must have a particular orientation, be constructed and operated in a particular orientation, and therefore should not be construed to limit the application. The terms "first", "second", "third", etc. are used only to describe different ones of the identical objects and are not necessarily used to describe a particular sequential or chronological order. It is understood that the data thus used can be interchanged, where appropriate, to refer to any one of the identical objects to carry out the embodiments of the application described herein in other sequences than those illustrated or otherwise described herein. Furthermore, in the description of the embodiments, the meaning of "a plurality" is two or more, unless specified otherwise. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover not exclusively containing, for example, a process, method, system or product including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.

[0040] It should be understood that when an apparatus or component is referred to as being "on", "adjacent", "connected" to another element, it can be directly on, adjacent to, connected to the other element, or intervening elements can also be present. In contrast, when an apparatus or component is referred to as being "directly on", "directly adjacent", "directly connected" to another element, there are no intervening elements present. It will be understood that, although the terms first, second, third, etc. can be used herein to describe various components, regions, layers and / or sections, these components, regions, layers and / or sections should not be limited by these terms. These terms are simply used to distinguish one component, region, layer or section from another component, region, layer or section. Thus, a first component, region, layer or section discussed below could be termed a second component, region, layer or section without departing from the teachings of the application. Similarly, a second component, region, layer or section discussed below could be termed a first component, region, layer or section without departing from the teachings of the application.

[0041] In order to make the purpose, technical solutions and advantages of the embodiments disclosed in the present application clearer, the embodiments of the present application are further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present application and not to limit the embodiments of the present application.

[0042] The embodiments of the present application provide a trigonometric function calculation circuit structure. Figure 1 The embodiments of the present application provide a trigonometric function calculation circuit structure. Figure 1 As shown in the figure, the trigonometric function calculation circuit structure comprises an interval judgment unit 1, an address index unit 2, a storage unit 3 and a sign correction unit 4. Figure 2

[0043] The interval judgment unit 1 comprises a comparator circuit module 11, the input end of the comparator circuit module 11 is used for receiving the input data to be calculated, and the comparator circuit module 11 is used for outputting an interval signal based on the comparison result of the data to be calculated and a preset comparison value.

[0044] The address index unit 2 comprises a subtracter circuit module 21, the first input end of the subtracter circuit module 21 is connected with the output end of the interval judgment unit 1, the second input end is used for receiving the data to be calculated, and the subtracter circuit module 21 is used for calculating the storage address signal corresponding to the data to be calculated based on the interval signal.

[0045] The storage unit 3 is used for storing a plurality of preset function values, the input end of the storage unit 3 is connected with the output end of the address index unit 2, and is used for receiving the storage address signal. The output end of the storage unit 3 is connected with the first input end of the sign correction unit 4, and is used for sending the preset function value corresponding to the data to be calculated to the sign correction unit 4.

[0046] The second input end of the sign correction unit 4 is connected with the output end of the interval judgment unit 1, and is used for performing sign correction on the preset function value based on the received interval signal, and outputting the trigonometric function value corresponding to the data to be calculated.

[0047] When calculating the trigonometric function value of the angle a, the comparator circuit module 11 of the interval judgment unit 1 compares the angle value a with several preset comparison values, so as to determine the interval to which the angle value a belongs, and then the subtracter circuit module 21 of the address index unit 2 calculates the storage address signal representing the preset function value corresponding to the angle a in the storage unit 3, the storage unit 3 queries the preset function value corresponding to the angle a based on the storage address signal, and finally the sign correction unit 4 performs sign correction on the preset function value based on the interval to which the angle a belongs, and outputs the trigonometric function value corresponding to the angle a, which realizes that the trigonometric function value corresponding to the angle a is quickly obtained by table lookup method using the symmetry of the trigonometric function in the case that the trigonometric function value corresponding to the angle a is not stored in the storage unit 3.​

[0048] In the embodiments of the present application, the symmetry of trigonometric functions is utilized to divide the trigonometric function values into several intervals, and only part of the trigonometric function values are stored, and the rest of the trigonometric function values are obtained by sign change based on the symmetry of the stored trigonometric function values, thereby significantly saving the storage space, and meanwhile, the calculation performance and real-time performance are ensured through the efficient design of the hardware circuit.

[0049] In some possible embodiments, the trigonometric function can be any one of sine function (sinθ), tangent function (tanθ), cotangent function (cotθ), cosecant function (cscθ), cosine function (cosθ) and secant function (secθ) with symmetry.

[0050] In the embodiments of the present application, the sine function is taken as an example for the following description.

[0051] Figure 2 is a module diagram of a trigonometric function calculation circuit structure provided by the embodiments of the present application. Figure 2 As shown in Figure 3 , in some possible embodiments, since the preset function values that can be stored by the storage unit 3 are limited, the to-be-calculated data includes angle data, and the interval judgment unit 1 further includes a unit value conversion module 12, which is configured to convert the angle data into corresponding unit value data.

[0052] Specifically, the unit value conversion module 12 can uniformly convert the original angle a of 0-2π into 1024 10-bit unit values b (0-1023), and the unit values are all integers, for example, the unit value corresponding to 30 degrees is 85. The output end of the unit value conversion module 12 is connected with the input end of the comparator circuit module 11, and is configured to send the unit value data to the comparator circuit module 11, and the subsequent circuit structure performs calculation based on the integer unit value data.

[0053] In some possible embodiments, the input can also be an analog signal, and therefore the interval judgment unit 1 further includes an analog-digital conversion module, which converts the input analog signal into a digital signal and then performs unit value conversion.

[0054] In another possible embodiment, unit value data can also be directly input, and in this case, interval judgment can be directly performed without unit value conversion.

[0055] Figure 3 is a module diagram of a unit value conversion module provided by the embodiments of the present application, as shown in Figure 4 , in some possible embodiments, the unit value conversion module 12 includes a multiplier circuit and a shifter. The output end of the multiplier circuit is connected with the input end of the shifter.

[0056] The multiplier circuit is configured to multiply the received angle data with a preset multiplication value to obtain a multiplication result, and send the multiplication result to the shifter. The shifter is configured to right shift the multiplication result by a first preset number of bits to obtain the integer normalized value data.

[0057] In the embodiment of the present application, the preset multiplication value is 162.975, which is an approximate value of 2π / 3, and the shifter right shifts the multiplication result by 8 bits to extract the integer part and compress it into the 10-bit normalized value b.

[0058] In some possible embodiments, the storage unit 3 includes a plurality of sub-storage units, each of which is configured to store different preset function values. The number of normalized value data is a first number, and the number of sub-storage units is a second number, which is one half or one fourth of the first number.

[0059] In the embodiment of the present application, the first number is 1024, and the second number is 257, that is, the sine function values of the first 257 points of the normalized value are stored in a table of 257, and the remaining normalized values are obtained by sign changing the sine function values of the previous points, thereby effectively saving three fourths of the storage space.

[0060] Figure 4 is a module schematic diagram of a comparator circuit module provided by the embodiment of the present application, as shown in Figure 4 In some possible embodiments, the comparator circuit module 11 includes a first digital comparator, a second digital comparator, a third digital comparator, and a second logic gate circuit.

[0061] Specifically, the first digital comparator, the second digital comparator, and the third digital comparator have different preset comparison values. In the embodiment of the present application, the 1024 normalized values are divided into four intervals, interval one is 0 to 256, interval two is 257 to 512, interval three is 513 to 768, and interval four is 769 to 1023.

[0062] Therefore, the preset comparison value of the first digital comparator is 256, the preset comparison value of the second digital comparator is 512, and the preset comparison value of the third digital comparator is 768.

[0063] As shown in Figure 5 The input ends of the first digital comparator, the second digital comparator, and the third digital comparator all input the normalized value data, and the output ends are all connected with the second logic gate circuit. The second logic gate circuit is configured to obtain the interval signal of the comparator circuit module 11 based on a first comparison result of the first digital comparator, a second comparison result of the second digital comparator, and a third comparison result of the third digital comparator.

[0064] In the embodiment of the present application, the interval signal is a two-bit interval code, and the coding rule is as follows: when the unit value b corresponding to the angle a belongs to interval one (b≤256), the interval signal, i.e., the interval code, is 00; when the unit value b corresponding to the angle a belongs to interval two (256<b≤512), the interval signal, i.e., the interval code, is 01; when the unit value b corresponding to the angle a belongs to interval three (512<b≤768), the interval signal, i.e., the interval code, is 10; and when the unit value b corresponding to the angle a belongs to interval four (768<b≤1023), the interval signal, i.e., the interval code, is 11.

[0065] Figure 5 is a module schematic diagram of a subtractor circuit module provided in the embodiment of the present application, as shown in some possible embodiments, the subtractor circuit module 21 includes a first subtractor, a second subtractor, and a multiplexer. Figure 6

[0066] The first input end of the first subtractor is connected with a first subtraction value, the second output end inputs the unit value data, and the output end outputs a first subtraction result. The first input end of the second subtractor is connected with a second subtraction value, the second output end is connected with the unit value data, and the output end outputs a second subtraction result.

[0067] In the embodiment of the present application, the multiplexer is a four-to-one multiplexer, which can select a calculation path according to the above two-bit interval code. The first subtraction value of the first subtractor is 512, which is responsible for calculating the first subtraction result of 512-b. The first subtraction value of the second subtractor is 1024, which is responsible for calculating the second subtraction result of 1024-b.

[0068] In the embodiment of the present application, the first subtractor of the present application further has a control end, which ends the interval signal, and based on the interval signal, the polarity of the first subtractor is selected, and 512-b or b-512 is output.

[0069] The first input end of the multiplexer inputs the unit value data b, the second input end is connected with the output end 512-b of the first subtractor, the third input end inputs the output end b-512 of the first subtractor, and the fourth input end is connected with the output end 1024-b of the second subtractor. The control end receives the interval signal. The multiplexer is used to output the storage address signal corresponding to the unit value data based on the interval signal.

[0070] Through the above setting, the storage positions of each unit value from 0 to 1023 in the table can be calculated.

[0071] In some possible embodiments, the sign correction unit 4 includes a first logic gate circuit module, the first input end of the first logic gate circuit module is connected with the storage module, the second input end is connected with the output end of the comparator circuit module 11, and is used for performing sign correction on the trigonometric function value according to the interval signal.​

[0072] In the embodiment of the present application, the high bit of the interval signal is used as the control signal. Specifically, when the interval signal, i.e., the interval code, is 00 or 01, and the dimensionless value b corresponding to the angle a belongs to interval one or interval two, the preset function value can be directly output as the trigonometric function value; when the interval signal, i.e., the interval code, is 10 or 11, and the dimensionless value b corresponding to the angle a belongs to interval three or interval four, the preset function value is inverted as the trigonometric function value. For example, the first logic gate circuit module includes an exclusive-OR gate, and the two input ends of the exclusive-OR gate are connected to the sign bit of the storage module and the high bit of the interval signal, respectively.

[0073] Figure 3 is a module schematic diagram of a trigonometric function calculation circuit structure provided by the embodiment of the present application Figure 6 As shown in Figure 7 , when the angle data a needs to be calculated, the trigonometric function calculation circuit structure first converts the angle data a into the dimensionless value data b through the multiplier circuit and the shifter of the dimensionless value conversion circuit 12, for example, the dimensionless value data b is 423, and then judges whether the dimensionless value data b belongs to interval one, interval two, interval three or interval four through the comparator circuit module 11. Specifically, the dimensionless value data 23 is compared with the three comparison values 256, 512 and 768 of the digital comparator, respectively, to obtain three comparison results 001, and the comparison results 001 are converted into the interval signal 01 through the second logic gate circuit.

[0074] Next, the interval signal 01 is output to the subtracter circuit module 21, the corresponding preset function value in the storage unit 3 is determined according to the dimensionless value data 423, specifically, the first subtracter is used to calculate b-512 or 512-b, the second subtracter is used to calculate 1024-b, and the multiplexer selects b, 512-b, b-512 or 1024-b as the input based on the interval signal. When the interval signal is 01, the multiplexer selects 512-b, i.e., 89, as the storage address signal, the preset function value stored in the 89th sub-storage unit of the storage unit 3 is the preset function value corresponding to the dimensionless value data 423, and finally, since the high bit of the interval signal 01 is 0, the 89th preset function value is directly output through the sign correction unit 4 as the trigonometric function value of the dimensionless value data 423.

[0075] Figure 4 is a module schematic diagram of a trigonometric function calculation circuit structure provided by the embodiment of the present application Figure 7 As shown in ​ , in some possible embodiments, the trigonometric function calculation circuit structure further includes a data truncation circuit 5, the input end of the data truncation circuit 5 is connected to the input end of the sign correction unit 4, and the data truncation circuit 5 is used to truncate the trigonometric function value corresponding to the to-be-calculated data to the second preset bit number.

[0076] In some possible embodiments, the trigonometric function calculation circuit structure further comprises a first power supply module 6, a second power supply module 7 and a power supply control module 8. The storage unit 3 comprises a first storage module and a second storage module.

[0077] Specifically, the first power supply module 6 is connected with the first storage module and used to supply power for the first storage module; the second power supply module 7 is connected with the second storage module and used to supply power for the second storage module. The power supply control module 8 is in communication connection with the first power supply module 6, the second power supply module 7 and the output end of the comparator circuit module 11, and used to control the first power supply module 6 or the second power supply module 7 to be in a power supply state based on the interval signal. Through the above setting, only the storage area being accessed can be powered, and the storage area not being accessed can be powered off, thereby saving energy.

[0078] The embodiment of the present application further provides a calculation chip comprising the above trigonometric function calculation circuit structure.

[0079] In the embodiment of the present application, by setting the trigonometric function calculation circuit structure on the calculation chip, the symmetry of the trigonometric function is utilized to divide the trigonometric function value into several intervals, only part of the trigonometric function value is stored, and the rest of the trigonometric function value is obtained through the stored trigonometric function value based on the symmetry, thereby significantly saving the storage space, and through the efficient design of the hardware circuit, the calculation performance and real-time performance are ensured.

[0080] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. The above describes the specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be executed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.

[0081] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. Especially, the device embodiments are described simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiments.

[0082] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or can be instructed by a program to complete the related hardware, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0083] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A structure of a trigonometric function calculating circuit, characterized by comprising: The interval judging unit (1), the address indexing unit (2), the storage unit (3) and the sign correction unit (4) are included. The interval judging unit (1) comprises a comparator circuit module (11), the input end of the comparator circuit module (11) is used for receiving to-be-calculated data, and the comparator circuit module (11) is used for outputting an interval signal based on the to-be-calculated data and a preset comparison value. The address indexing unit (2) comprises a subtracter circuit module (21), two input ends of the subtracter circuit module (21) receive the interval signal and the to-be-calculated data respectively, and the subtracter circuit module (21) is used for calculating a storage address signal corresponding to the to-be-calculated data based on the interval signal. The storage unit (3) is used for storing a plurality of preset function values, the input end of the storage unit (3) is used for receiving the storage address signal output by the output end of the address indexing unit (2), the output end of the storage unit (3) is connected with the first input end of the sign correction unit (4), and the storage unit (3) is used for sending a preset function value corresponding to the storage address signal. The second input end of the sign correction unit (4) is connected with the output end of the interval judging unit (1), and the sign correction unit (4) is used for performing sign correction on the preset function value based on the interval signal to obtain a trigonometric function value.

2. A circuit structure for calculating trigonometric functions as claimed in claim 1, characterized in that The to-be-calculated data comprises angle data. The interval judging unit (1) further comprises a dimensionless value conversion module (12), the dimensionless value conversion module (12) is used for converting the angle data into corresponding dimensionless value data, and the output end of the dimensionless value conversion module (12) is connected with the input end of the comparator circuit module (11) and used for sending the dimensionless value data to the comparator circuit module (11).

3. A trigonometric function calculation circuit structure according to claim 2, wherein The dimensionless value conversion module (12) comprises a multiplier circuit and a shifter. The output end of the multiplier circuit is connected with the input end of the shifter, the multiplier circuit is used for multiplying the received angle data with a preset multiplication value to obtain a multiplication result and sending the multiplication result to the shifter, and the shifter is used for right shifting the multiplication result by a first preset bit number to obtain integer dimensionless value data.

4. The circuit structure for computing trigonometric functions according to claim 2, wherein, The storage unit (3) comprises a plurality of sub-storage units (3), each of the sub-storage units (3) is used for storing different preset function values, the number of the dimensionless value data is a first number, the number of the sub-storage units (3) is a second number, and the second number is one half or one fourth of the first number.

5. The circuit structure for computing trigonometric functions according to claim 2, wherein, The comparator circuit module (11) comprises a first digital comparator, a second digital comparator, a third digital comparator and a second logic gate circuit. The first digital comparator, the second digital comparator and the third digital comparator have different preset comparison values, the input ends of the first digital comparator, the second digital comparator and the third digital comparator input the dimensionless value data, and the output ends of the first digital comparator, the second digital comparator and the third digital comparator are connected with the second logic gate circuit. The second logic gate circuit is configured to obtain the interval signal of the comparator circuit module (11) based on a first comparison result of the first digital comparator, a second comparison result of the second digital comparator, and a third comparison result of the third digital comparator.

6. A trigonometric function calculation circuit structure according to claim 5, wherein The subtraction circuit module (21) comprises a first subtractor, a second subtractor, and a multiplexer. The first subtractor has a first input connected to a first subtraction value, a second output connected to the reference value data, and an output outputting a first subtraction result. The second subtractor has a first input connected to a second subtraction value, a second output connected to the reference value data, and an output outputting a second subtraction result. The multiplexer has a first input connected to the reference value data, a second input connected to the output of the first subtractor, a third input connected to the output of the first subtractor, a fourth input connected to the output of the first subtractor, and a control end receiving the interval signal. The multiplexer is configured to output a storage address signal corresponding to the reference value data based on the interval signal.

7. A trigonometric function calculation circuit structure according to claim 6, wherein The sign correction unit (4) comprises a first logic gate circuit module having a first input end connected to a storage module and a second input end connected to an output end of the comparator circuit module (11), and is configured to perform sign correction on the trigonometric function value according to the interval signal.

8. The circuit structure for computing trigonometric functions according to claim 1, wherein, The data truncation circuit (5) is connected to the input end of the sign correction unit (4) and is configured to truncate the trigonometric function value corresponding to the to-be-calculated data to a second preset number of bits.

9. The circuit structure for computing trigonometric functions according to claim 1, wherein, The first power supply module (6) is connected to the first storage module and is configured to supply power to the first storage module; the second power supply module (7) is connected to the second storage module and is configured to supply power to the second storage module; and the power supply control module (8) is in communication connection with the first power supply module (6), the second power supply module (7), and the output end of the comparator circuit module (11), and is configured to control the first power supply module (6) or the second power supply module (7) to be in a power supply state based on the interval signal. The trigonometric function calculation circuit structure comprises the trigonometric function calculation circuit structure according to any one of claims 1-9.

10. A computing chip, comprising: ​