CN115456186B - Sinusoidal and cosine signal generator and quantum computer control system - Google Patents
Sinusoidal and cosine signal generator and quantum computer control system Download PDFInfo
- Publication number
- CN115456186B CN115456186B CN202210105741.0A CN202210105741A CN115456186B CN 115456186 B CN115456186 B CN 115456186B CN 202210105741 A CN202210105741 A CN 202210105741A CN 115456186 B CN115456186 B CN 115456186B
- Authority
- CN
- China
- Prior art keywords
- sine
- cosine
- value
- frequency
- memory
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/02—Digital function generators
- G06F1/03—Digital function generators working, at least partly, by table look-up
- G06F1/0321—Waveform generators, i.e. devices for generating periodical functions of time, e.g. direct digital synthesizers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2101/00—Indexing scheme relating to the type of digital function generated
- G06F2101/04—Trigonometric functions
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Computational Mathematics (AREA)
- Condensed Matter Physics & Semiconductors (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Stabilization Of Oscillater, Synchronisation, Frequency Synthesizers (AREA)
- Complex Calculations (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及量子计算领域,特别是涉及一种正余弦信号发生器及量子计算机控制系统。The present invention relates to the field of quantum computing, and in particular to a sine-cosine signal generator and a quantum computer control system.
背景技术Background technique
量子计算机控制系统主要作用是对量子计算机进行控制,更具体的,是对量子比特进行控制。对量子比特进行控制的本质是对量子比特施加各种控制信号,控制信号大多根据基础的正余弦信号生成。由于量子比特的频率比较高,因此控制信号需要有较高的频率,对应的正余弦信号也需要有较高的频率。The main function of quantum computer control system is to control quantum computers, more specifically, quantum bits. The essence of controlling quantum bits is to apply various control signals to quantum bits, and most of the control signals are generated based on basic sine and cosine signals. Since the frequency of quantum bits is relatively high, the control signal needs to have a higher frequency, and the corresponding sine and cosine signals also need to have a higher frequency.
然而,正余弦信号一般采用NCO(数控振荡器)产生,NCO可在FPGA等器件中实现。正余弦信号频率越高,需要的采样率更高,但是大部分FPGA的最高工作频率有限,所以产生的正余弦信号的频率较低。为了提高正余弦信号的频率,现有的做法是通过多个FPGA并行生成较低频率的正余弦信号,再将这些正余弦信号的频率进行综合。但这样做需要多个FPGA,资源消耗和成本大幅增加。However, sine and cosine signals are generally generated by NCO (numerically controlled oscillator), which can be implemented in devices such as FPGA. The higher the frequency of the sine and cosine signal, the higher the sampling rate required, but the maximum operating frequency of most FPGAs is limited, so the frequency of the generated sine and cosine signals is relatively low. In order to increase the frequency of the sine and cosine signals, the existing practice is to generate lower-frequency sine and cosine signals in parallel through multiple FPGAs, and then synthesize the frequencies of these sine and cosine signals. However, this requires multiple FPGAs, which greatly increases resource consumption and costs.
发明内容Summary of the invention
本发明的目的是提供一种正余弦信号发生器、存储器及量子计算机控制系统,以解决现有技术中FPGA内生成的正余弦信号频率较低的问题,能够在FPGA内生成较高频率的正余弦信号。The purpose of the present invention is to provide a sine-cosine signal generator, a memory and a quantum computer control system to solve the problem of low frequency of sine-cosine signals generated in FPGA in the prior art, and to generate higher frequency sine-cosine signals in FPGA.
为解决上述技术问题,本发明提供一种正余弦信号发生器,用于FPGA,包括地址获取模块和存储有至少四分之一周期的三角函数值的存储器,一个周期的三角函数值的数量为第一数量,所述存储器的数量为第二数量;To solve the above technical problems, the present invention provides a sine-cosine signal generator for FPGA, comprising an address acquisition module and a memory storing trigonometric function values of at least a quarter period, the number of trigonometric function values of one period is a first number, and the number of the memory is a second number;
所述地址获取模块用于在工作时钟作用下依次获取多路查表地址,并分别送入第二数量的存储器,同一时刻相邻两路的查表地址相差预设相位增量,同一路相邻两个查表地址相差预设相位增量的第二数量倍数;The address acquisition module is used to sequentially acquire multiple table lookup addresses under the action of the working clock, and send them to the second number of memories respectively, the table lookup addresses of two adjacent paths at the same time differ by a preset phase increment, and the table lookup addresses of two adjacent paths on the same path differ by a second number multiple of the preset phase increment;
所述存储器被配置为每送入一个查表地址时,输出当前正弦值和当前余弦值,分别形成预设频率的正弦信号和余弦信号;The memory is configured to output a current sine value and a current cosine value each time a table lookup address is input, so as to form a sine signal and a cosine signal of a preset frequency respectively;
其中,所述预设相位增量根据所述预设频率、所述第一数量、所述第二数量和所述工作时钟的频率确定。The preset phase increment is determined according to the preset frequency, the first number, the second number and the frequency of the working clock.
优选的,所述存储器存储的三角函数值为至少四分之一周期的正弦值、至少四分之一周期的余弦值或者至少四分之一周期的正弦值和余弦值。Preferably, the trigonometric function values stored in the memory are sine values of at least a quarter period, cosine values of at least a quarter period, or sine values and cosine values of at least a quarter period.
优选的,所述存储器被配置为每送入一个查表地址时,检查当前查表地址是否存储有对应的正弦值或余弦值,在存储有对应的正弦值或余弦值时,输出存储的当前正弦值和当前余弦值,分别形成预设频率的正弦信号和余弦信号,以及在没有存储有对应的正弦值或余弦值时,根据正弦值或余弦值的周期性计算出对应的正弦值或余弦值,输出计算的当前正弦值和当前余弦值,分别形成预设频率的正弦信号和余弦信号。Preferably, the memory is configured to check whether the current lookup address has a corresponding sine value or cosine value stored therein each time a lookup address is input; and when the corresponding sine value or cosine value is stored therein, output the stored current sine value and current cosine value to form a sine signal and a cosine signal of a preset frequency, respectively; and when the corresponding sine value or cosine value is not stored therein, calculate the corresponding sine value or cosine value according to the periodicity of the sine value or cosine value, output the calculated current sine value and current cosine value to form a sine signal and a cosine signal of a preset frequency, respectively.
优选的,所述存储器提供查找表,所述查找表存储有四分之一周期的正弦值,所述查找表的查表地址位数为第一位数A,其中,2A与第一数量相等。Preferably, the memory provides a lookup table, the lookup table stores a quarter-cycle sine value, and the number of lookup address bits of the lookup table is a first number A, wherein 2 A is equal to the first number.
优选的,所述预设相位增量为:Preferably, the preset phase increment is:
其中,N表示所述第一数量,c表示所述第二数量,fout表示所述预设频率,fS表示所述工作时钟的频率,Round()表示取整函数。Among them, N represents the first number, c represents the second number, f out represents the preset frequency, f S represents the frequency of the working clock, and Round() represents a rounding function.
优选的,所述正弦信号为:Preferably, the sinusoidal signal is:
所述余弦信号为:The cosine signal is:
其中,n*PINC表示送入存储器的查表地址的值,n的取值范围为[0,2A-1],a表示幅值,表示初相,b表示偏距。Where n*PINC represents the value of the table lookup address sent to the memory, the value range of n is [0, 2 A -1], a represents the amplitude, represents the initial phase, and b represents the offset.
优选的,所述存储器输出的当前正弦值为:Preferably, the current sine value output by the memory is:
所述存储器输出的当前余弦值为:The current cosine value output by the memory is:
其中,m表示查找表的查表地址的值,取值范围为[0,2A-1]。Wherein, m represents the value of the lookup address of the lookup table, and its value range is [0, 2 A -1].
优选的,所述正弦信号和所述余弦信号的幅值、初相和偏距相同。Preferably, the sine signal and the cosine signal have the same amplitude, initial phase and offset.
优选的,所述地址获取模块包括频率字单元和与第二数量的存储器一一对应的相位累加器;Preferably, the address acquisition module includes a frequency word unit and a phase accumulator corresponding one-to-one to the second number of memories;
所述频率字单元用于获取多路频率字,并分别送入第二数量的相位累加器,所述频率字为预设相位增量的第二数量倍数;The frequency word unit is used to obtain multiple frequency words and send them to a second number of phase accumulators respectively, wherein the frequency words are a second number of multiples of a preset phase increment;
所述相位累加器用于在所述工作时钟作用下以所述频率字为步进不断累加得到查表地址,并送入对应的存储器,其中,同一时刻相邻两个相位累加器得到的查表地址相差预设相位增量。The phase accumulator is used to continuously accumulate the table lookup address in steps of the frequency word under the action of the working clock, and send it to the corresponding memory, wherein the table lookup addresses obtained by two adjacent phase accumulators at the same time differ by a preset phase increment.
为解决上述技术问题,本发明还提供一种量子计算机控制系统,包括前述任一种所述的正余弦信号发生器。In order to solve the above technical problems, the present invention also provides a quantum computer control system, comprising any one of the aforementioned sine and cosine signal generators.
区别于现有技术的情况,本发明提供的正余弦信号发生器通过设置第二数量的存储器,每一存储器存储有至少四分之一周期的三角函数值,存储器被配置为每送入一个查表地址时,输出当前正弦值和当前余弦值,分别形成预设频率的正弦信号和余弦信号,而同一时刻相邻两路的查表地址相差预设相位增量,同一路相邻两个查表地址相差预设相位增量的第二数量倍数,由于工作时钟的频率与第二数量的乘积等效为采样频率,根据奈奎斯特采样定律,理论上预设频率可以达到采样频率的一半,从而能够在FPGA内生成较高频率的正余弦信号,可以降低资源消耗和成本。Different from the prior art, the sine-cosine signal generator provided by the present invention sets a second number of memories, each memory stores at least a quarter period of trigonometric function values, and the memories are configured to output the current sine value and the current cosine value each time a lookup table address is input, so as to form a sine signal and a cosine signal of a preset frequency respectively, and the lookup table addresses of two adjacent paths at the same time differ by a preset phase increment, and the two adjacent lookup table addresses of the same path differ by a second number of multiples of the preset phase increment. Since the product of the frequency of the working clock and the second number is equivalent to the sampling frequency, according to the Nyquist sampling theorem, the preset frequency can theoretically reach half of the sampling frequency, so that a higher frequency sine-cosine signal can be generated in the FPGA, which can reduce resource consumption and cost.
本发明提供的量子计算机控制系统,与正余弦信号发生器属于同一发明构思,因此具有相同的有益效果,在此不再赘述。The quantum computer control system provided by the present invention belongs to the same inventive concept as the sine-cosine signal generator, and therefore has the same beneficial effects, which will not be described in detail here.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明第一实施例提供的正余弦信号发生器的结构示意图。FIG. 1 is a schematic diagram of the structure of a sine-cosine signal generator provided in a first embodiment of the present invention.
图2为第一实施例中正余弦信号发生器的存储器提供的查找表的数据结构示意图。FIG. 2 is a schematic diagram of the data structure of a lookup table provided by a memory of the sine-cosine signal generator in the first embodiment.
图3为本发明第二实施例提供的正余弦信号发生器的地址获取模块的结构示意图。FIG3 is a schematic diagram of the structure of an address acquisition module of a sine-cosine signal generator provided in a second embodiment of the present invention.
具体实施方式Detailed ways
下面将结合示意图对本发明的具体实施方式进行更详细的描述。根据下列描述和权利要求书,本发明的优点和特征将更清楚。需说明的是,附图均采用非常简化的形式且均使用非精准的比例,仅用以方便、明晰地辅助说明本发明实施例的目的。The specific implementation of the present invention will be described in more detail below in conjunction with the schematic diagram. The advantages and features of the present invention will become clearer from the following description and claims. It should be noted that the drawings are all in a very simplified form and are not in exact proportions, and are only used to facilitate and clearly assist in explaining the purpose of the embodiments of the present invention.
在本发明的描述中,需要理解的是,术语“中心”、“上”、“下”、“左”、“右”等指示的方位或者位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。In the description of the present invention, it is necessary to understand that the terms "center", "up", "down", "left", "right", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
请参考图1,本发明第一实施例提供了一种正余弦信号发生器,该正余弦信号发生器用于FPGA,能够在FPGA内产生较高频率的正余弦信号。该正余弦信号发生器包括地址获取模块10和存储有至少四分之一周期的三角函数值的存储器20,一个周期的三角函数值的数量为第一数量,存储器20的数量为第二数量。Please refer to Fig. 1, a first embodiment of the present invention provides a sine-cosine signal generator, which is used in FPGA and can generate a sine-cosine signal with a higher frequency in the FPGA. The sine-cosine signal generator includes an address acquisition module 10 and a memory 20 storing at least a quarter of a period of trigonometric function values, the number of trigonometric function values in one period is a first number, and the number of the memory 20 is a second number.
地址获取模块10用于在工作时钟作用下依次获取多路查表地址,并分别送入第二数量的存储器20,同一时刻相邻两路的查表地址相差预设相位增量,同一路相邻两个查表地址相差预设相位增量的第二数量倍数。如果预设相位增量采用PINC表示,第二数量采用c表示,同一时刻相邻两路的查表地址相差PINC,第一次获取的查表地址中最小的优选为0,其他几路的查表地址则依次为1*PINC、2*PINC、3*PINC、4*PINC、……,同一路相邻两个查表地址相差c*PINC,例如第一路的查表地址依次为0、c*PINC、2c*PINC、3c*PINC、……。The address acquisition module 10 is used to sequentially acquire multiple lookup table addresses under the action of the working clock, and send them to the second number of memories 20 respectively. The lookup table addresses of two adjacent paths at the same time differ by a preset phase increment, and the lookup table addresses of two adjacent paths on the same path differ by a second number of multiples of the preset phase increment. If the preset phase increment is represented by PINC, the second number is represented by c, and the lookup table addresses of two adjacent paths at the same time differ by PINC, the smallest of the lookup table addresses acquired for the first time is preferably 0, and the lookup table addresses of the other paths are 1*PINC, 2*PINC, 3*PINC, 4*PINC, ..., respectively, and the lookup table addresses of two adjacent paths on the same path differ by c*PINC, for example, the lookup table addresses of the first path are 0, c*PINC, 2c*PINC, 3c*PINC, ..., respectively.
存储器20被配置为每送入一个查表地址时,输出当前正弦值和当前余弦值,分别形成预设频率的正弦信号和余弦信号。其中,预设相位增量根据预设频率、第一数量、第二数量和工作时钟的频率确定。The memory 20 is configured to output the current sine value and the current cosine value each time a table lookup address is input, so as to form a sine signal and a cosine signal of a preset frequency respectively. The preset phase increment is determined according to the preset frequency, the first quantity, the second quantity and the frequency of the working clock.
其中,存储器20存储的每一个三角函数值对应的查表地址从0开始以PINC递增。对于某一个存储器20而言,例如第一路查表地址对应的存储器20,它收到的查表地址依次为0、c*PINC、2c*PINC、3c*PINC、……,那么最终输出的正弦信号和余弦信号的相位以c*PINC递增,相邻两个存储器20输出的正弦信号和余弦信号的相位相差PINC。The lookup table address corresponding to each trigonometric function value stored in the memory 20 increases by PINC from 0. For a certain memory 20, for example, the memory 20 corresponding to the first lookup table address, the lookup table addresses it receives are 0, c*PINC, 2c*PINC, 3c*PINC, ..., then the phases of the sine signal and cosine signal finally outputted increase by c*PINC, and the phase difference of the sine signal and cosine signal outputted by two adjacent memories 20 is PINC.
预设频率、第一数量、第二数量和工作时钟的频率根据实际需要设置。第一数量是一个周期的三角函数值的总数,存储器20至少需要存储第一数量的三角函数值的前四分之一部分。工作时钟的频率应当不超过FPGA的最高工作频率。工作时钟的频率和第二数量的值与采样率有关,两者的乘积等效为采样率,例如采样率为1.6GHz时,工作时钟的频率设为200MHz,那么第二数量就为8,也就是需要8个存储器20。采样率是由量子比特的控制需求决定的。根据奈奎斯特采样定律,预设频率与采样频率之比最大为1:2,也就是说,预设频率理论上可以达到800MHz,从而在FPGA内实现了较高频率的正余弦信号。The preset frequency, the first number, the second number and the frequency of the working clock are set according to actual needs. The first number is the total number of trigonometric function values of a period, and the memory 20 needs to store at least the first quarter of the trigonometric function values of the first number. The frequency of the working clock should not exceed the maximum operating frequency of the FPGA. The frequency of the working clock and the value of the second number are related to the sampling rate, and the product of the two is equivalent to the sampling rate. For example, when the sampling rate is 1.6GHz, the frequency of the working clock is set to 200MHz, then the second number is 8, that is, 8 memories 20 are required. The sampling rate is determined by the control requirements of the quantum bit. According to the Nyquist sampling theorem, the ratio of the preset frequency to the sampling frequency is at most 1:2, that is, the preset frequency can theoretically reach 800MHz, thereby realizing a higher frequency sine and cosine signal in the FPGA.
由于三角函数具有周期性,因此,只要知道前四分之一周期的三角函数值,就可以根据周期性计算出后四分之三周期的三角函数值。在本实施例中,存储器20存储的三角函数值为至少四分之一周期的正弦值、至少四分之一周期的余弦值或者至少四分之一周期的正弦值和余弦值。Since trigonometric functions are periodic, as long as the trigonometric function values of the first quarter period are known, the trigonometric function values of the last three quarter periods can be calculated according to the periodicity. In this embodiment, the trigonometric function values stored in the memory 20 are the sine values of at least a quarter period, the cosine values of at least a quarter period, or the sine values and cosine values of at least a quarter period.
进一步地,存储器20被配置为每送入一个查表地址时,检查当前查表地址是否存储有对应的正弦值或余弦值,在存储有对应的正弦值或余弦值时,输出存储的当前正弦值和当前余弦值,分别形成预设频率的正弦信号和余弦信号,以及在没有存储有对应的正弦值或余弦值时,根据正弦值或余弦值的周期性计算出对应的正弦值或余弦值,输出计算的当前正弦值和当前余弦值,分别形成预设频率的正弦信号和余弦信号。Furthermore, the memory 20 is configured to check whether the corresponding sine value or cosine value is stored in the current table lookup address each time a table lookup address is input, and when the corresponding sine value or cosine value is stored, output the stored current sine value and current cosine value to form a sine signal and a cosine signal of a preset frequency respectively, and when the corresponding sine value or cosine value is not stored, calculate the corresponding sine value or cosine value according to the periodicity of the sine value or cosine value, output the calculated current sine value and current cosine value to form a sine signal and a cosine signal of a preset frequency respectively.
如果存储器20存储有一个周期的正弦值以及一个周期的余弦值,正弦值和余弦值的数量均为第一数量,那么每一个查表地址都存储有对应的正弦值或余弦值,可以直接输出存储的当前正弦值和当前余弦值。如果存储器20只存储有不足一个周期的正弦值和/或不足一个周期的余弦值,那么存在某些查表地址没有对应的正弦值或余弦值的情形,这时可以根据正弦值或余弦值的周期性结合已存储的正弦值和/或余弦值计算出这些查表地址对应的正弦值和余弦值。If the memory 20 stores a period of sine values and a period of cosine values, and the number of sine values and cosine values is the first number, then each lookup address stores a corresponding sine value or cosine value, and the stored current sine value and current cosine value can be directly output. If the memory 20 only stores less than one period of sine values and/or less than one period of cosine values, then there are some lookup addresses that do not have corresponding sine values or cosine values. In this case, the sine values and cosine values corresponding to these lookup addresses can be calculated based on the periodicity of the sine values or cosine values combined with the stored sine values and/or cosine values.
请参考图2,存储器20提供查找表LUT,查找表LUT存储有四分之一周期的正弦值,查找表LUT的查表地址位数为第一位数A,其中,2A与第一数量相等。只有前2A/4的查表地址分别对应的数据位存储有正弦值,其余的查表地址对应的数据位为空。Please refer to FIG. 2 , the memory 20 provides a lookup table LUT, the lookup table LUT stores a quarter period of sine value, and the number of lookup table address bits of the lookup table LUT is the first number A, where 2 A is equal to the first number. Only the data bits corresponding to the first 2 A /4 lookup table addresses respectively store sine values, and the data bits corresponding to the remaining lookup table addresses are empty.
在本实施例中,预设相位增量为:In this embodiment, the preset phase increment is:
其中,N表示第一数量,c表示第二数量,fout表示预设频率,fS表示工作时钟的频率,Round()表示取整函数。Wherein, N represents the first quantity, c represents the second quantity, f out represents the preset frequency, f S represents the frequency of the working clock, and Round() represents the rounding function.
进一步地,正弦信号为:Furthermore, the sinusoidal signal is:
余弦信号为:The cosine signal is:
其中,n*PINC表示查表地址的值,n的取值范围为[0,2A-1],a表示幅值,表示初相,b表示偏距。Where n*PINC represents the value of the table lookup address, the value range of n is [0, 2 A -1], and a represents the amplitude. represents the initial phase, and b represents the offset.
存储器20输出的当前正弦值为:The current sine value output by memory 20 is:
存储器20输出的当前余弦值为:The current cosine value output by memory 20 is:
其中,m表示查找表的查表地址的值,取值范围为[0,2A-1]。Wherein, m represents the value of the lookup address of the lookup table, and its value range is [0, 2 A -1].
为了方便进行信号处理,在本实施例中,正弦信号和余弦信号的幅值、初相和偏距相同。为了方便理解,a取1,和b取0。In order to facilitate signal processing, in this embodiment, the amplitude, initial phase and offset of the sine signal and the cosine signal are the same. For ease of understanding, a is 1, and b are 0.
从图2中可以看出,查找表LUT前2A/4个数据位存储的正弦值依次为、sin(0*2π/N)、sin(1*2π/N)、sin(2*2π/N)、sin(3*2π/N)、……、其余数据位存储的数据为NULL,表示为空。可以看出,查找表LUT中每一个存储的正弦值与查找表的查表地址有关,查表地址为m,则正弦值为sin(m*2π/N)。As can be seen from Figure 2, the sine values stored in the first 2 A /4 data bits of the lookup table LUT are sin(0*2π/N), sin(1*2π/N), sin(2*2π/N), sin(3*2π/N), ..., The data stored in the remaining data bits is NULL, indicating that it is empty. It can be seen that each sine value stored in the lookup table LUT is related to the lookup table address of the lookup table. If the lookup table address is m, the sine value is sin(m*2π/N).
那么通过正弦函数的周期性,可以计算出其余查找地址对应的正弦值依次为……、sin[(N-2)*2π/N]、sin[(N-1)*2π/N]。Then, through the periodicity of the sine function, the sine values corresponding to the remaining search addresses can be calculated as follows: ..., sin[(N-2)*2π/N], sin[(N-1)*2π/N].
同样的,余弦值也可以根据正弦值的周期性计算得到。Similarly, the cosine value can also be calculated based on the periodicity of the sine value.
假设第二数量为8,产生正弦信号的过程如下:Assuming the second number is 8, the process of generating a sine signal is as follows:
送入第1个存储器20的查表地址依次为0*PINC、8*PINC、16*PINC、……,查找表LUT中与0*PINC、8*PINC、16*PINC、……相等的查表地址依次为0*PINC、8*PINC、16*PINC、……,则第1个存储器20输出的正弦信号为sin(0*2π*PINC/N)、sin(8*2π*PINC/N)、sin(16*2π*PINC/N)、……;The lookup table addresses sent to the first memory 20 are 0*PINC, 8*PINC, 16*PINC, ... in sequence, and the lookup table addresses equal to 0*PINC, 8*PINC, 16*PINC, ... in the lookup table LUT are 0*PINC, 8*PINC, 16*PINC, ... in sequence, then the sinusoidal signals output by the first memory 20 are sin(0*2π*PINC/N), sin(8*2π*PINC/N), sin(16*2π*PINC/N), ...;
送入第2个存储器20的查表地址依次为1*PINC、9*PINC、17*PINC、……,查找表LUT中与1*PINC、9*PINC、17*PINC、……相等的查表地址依次为1*PINC、9*PINC、17*PINC、……,则第2个存储器20输出的正弦信号为sin(1*2π*PINC/N)、sin(9*2π*PINC/N)、sin(17*2π*PINC/N)、……;The lookup table addresses sent to the second memory 20 are 1*PINC, 9*PINC, 17*PINC, ... in sequence, and the lookup table addresses equal to 1*PINC, 9*PINC, 17*PINC, ... in the lookup table LUT are 1*PINC, 9*PINC, 17*PINC, ... in sequence, then the sinusoidal signals output by the second memory 20 are sin(1*2π*PINC/N), sin(9*2π*PINC/N), sin(17*2π*PINC/N), ...;
送入第3个存储器20的查表地址依次为2*PINC、10*PINC、18*PINC、……,查找表LUT中与2*PINC、10*PINC、18*PINC、……相等的查表地址依次为2*PINC、10*PINC、18*PINC、……,则第3个存储器20输出的正弦信号为sin(2*2π*PINC/N)、sin(10*2π*PINC/N)、sin(18*2π*PINC/N)、……;The lookup table addresses sent to the third memory 20 are 2*PINC, 10*PINC, 18*PINC, ... in sequence, and the lookup table addresses equal to 2*PINC, 10*PINC, 18*PINC, ... in the lookup table LUT are 2*PINC, 10*PINC, 18*PINC, ... in sequence, then the sinusoidal signals output by the third memory 20 are sin(2*2π*PINC/N), sin(10*2π*PINC/N), sin(18*2π*PINC/N), ...;
以此类推,送入第8个存储器20的查表地址依次为7*PINC、15*PINC、23*PINC、……,查找表LUT中与7*PINC、15*PINC、23*PINC、……相等的查表地址依次为7*PINC、15*PINC、23*PINC、……,则第8个存储器20输出的正弦信号为sin(7*2π*PINC/N)、sin(15*2π*PINC/N)、sin(23*2π*PINC/N)、……。By analogy, the lookup addresses sent to the eighth memory 20 are 7*PINC, 15*PINC, 23*PINC, ..., and the lookup addresses equal to 7*PINC, 15*PINC, 23*PINC, ... in the lookup table LUT are 7*PINC, 15*PINC, 23*PINC, ..., then the sinusoidal signals output by the eighth memory 20 are sin(7*2π*PINC/N), sin(15*2π*PINC/N), sin(23*2π*PINC/N), ...
可以看出,8个存储器20每次输出的正弦信号的相位以PINC递增,同一个存储器20输出的正弦信号的相位以8*PINC递增。It can be seen that the phase of the sinusoidal signal output by the eight memories 20 increases by PINC each time, and the phase of the sinusoidal signal output by the same memory 20 increases by 8*PINC.
需要说明的是,如果送入存储器20的查表地址超过了查找表的查表地址的最大值,则存储器20在查找表LUT中寻址的查表地址是送入存储器20的查表地址与第一数量N的求余结果。It should be noted that if the lookup address sent to the memory 20 exceeds the maximum value of the lookup address of the lookup table, the lookup address addressed by the memory 20 in the lookup table LUT is the modulo result of the lookup address sent to the memory 20 and the first number N.
同样的,8个存储器20按照上述过程输出余弦信号。第1个存储器20输出的余弦信号为cos(0*2π*PINC/N)、cos(8*2π*PINC/N)、cos(16*2π*PINC/N)、……;第2个存储器20输出的余弦信号为cos(1*2π*PINC/N)、cos(9*2π*PINC/N)、cos(17*2π*PINC/N)、……;第3个存储器20输出的余弦信号为cos(2*2π*PINC/N)、cos(10*2π*PINC/N)、cos(18*2π*PINC/N)、……;……;第8个存储器20输出的余弦信号为cos(7*2π*PINC/N)、cos(15*2π*PINC/N)、cos(23*2π*PINC/N)、……。Similarly, the eight memories 20 output cosine signals according to the above process. The cosine signals output by the first memory 20 are cos(0*2π*PINC/N), cos(8*2π*PINC/N), cos(16*2π*PINC/N), ...; the cosine signals output by the second memory 20 are cos(1*2π*PINC/N), cos(9*2π*PINC/N), cos(17*2π*PINC/N), ...; the cosine signals output by the third memory 20 are cos(2*2π*PINC/N), cos(10*2π*PINC/N), cos(18*2π*PINC/N), ...; ...; the cosine signals output by the eighth memory 20 are cos(7*2π*PINC/N), cos(15*2π*PINC/N), cos(23*2π*PINC/N), ....
请参考图3,本发明第二实施例提供了一种正余弦信号发生器,本实施例的正余弦信号发生器包括第一实施例的全部技术特征,在第一实施例的基础上,地址获取模块10包括频率字单元11和与第二数量的存储器20一一对应的相位累加器12。Please refer to Figure 3. The second embodiment of the present invention provides a sine-cosine signal generator. The sine-cosine signal generator of this embodiment includes all the technical features of the first embodiment. On the basis of the first embodiment, the address acquisition module 10 includes a frequency word unit 11 and a phase accumulator 12 corresponding to the second number of memories 20.
频率字单元11用于获取多路频率字,并分别送入第二数量的相位累加器12,频率字为预设相位增量的第二数量倍数。其中,频率字可以由外部输入,也可以由频率字单元11预先存储或自动生成。The frequency word unit 11 is used to obtain multiple frequency words and send them to the second number of phase accumulators 12 respectively. The frequency words are second number multiples of the preset phase increment. The frequency words can be input from the outside or pre-stored or automatically generated by the frequency word unit 11.
相位累加器12用于在工作时钟作用下以频率字为步进不断累加得到查表地址,并送入对应的存储器20,其中,同一时刻相邻两个相位累加器12得到的查表地址相差预设相位增量。其中,假设预设相位增量为PINC,第二数量为8,以第一个相位累加器12为例,相位累加器12收到第一个频率字时,输出一个查表地址0*PINC,然后将0*PINC与频率字累加得到第二个查表地址8*PINC,继续将8*PINC与频率字累加得到第三个查表地址16*PINC。也就是说,每一次相位累加器12输出的查表地址都会与频率字进行累加作为下一次输出的查表地址。The phase accumulator 12 is used to continuously accumulate the lookup address with the frequency word as the step under the action of the working clock, and send it to the corresponding memory 20, wherein the lookup address obtained by two adjacent phase accumulators 12 at the same time differs by a preset phase increment. Wherein, assuming that the preset phase increment is PINC, and the second number is 8, taking the first phase accumulator 12 as an example, when the phase accumulator 12 receives the first frequency word, it outputs a lookup address 0*PINC, and then accumulates 0*PINC and the frequency word to obtain the second lookup address 8*PINC, and continues to accumulate 8*PINC and the frequency word to obtain the third lookup address 16*PINC. In other words, each time the lookup address output by the phase accumulator 12 is accumulated with the frequency word as the lookup address outputted next time.
通过上述方式,本发明实施例的正余弦信号发生器通过设置第二数量的存储器,每一存储器存储有至少四分之一周期的三角函数值,存储器被配置为每送入一个查表地址时,输出当前正弦值和当前余弦值,分别形成预设频率的正弦信号和余弦信号,而同一时刻相邻两路的查表地址相差预设相位增量,同一路相邻两个查表地址相差预设相位增量的第二数量倍数,由于工作时钟的频率与第二数量的乘积等效为采样频率,根据奈奎斯特采样定律,理论上预设频率可以达到采样频率的一半,从而能够在FPGA内生成较高频率的正余弦信号,可以降低资源消耗和成本。Through the above method, the sine and cosine signal generator of the embodiment of the present invention sets a second number of memories, each memory stores at least a quarter period of trigonometric function values, and the memory is configured to output the current sine value and the current cosine value each time a lookup table address is input, so as to form a sine signal and a cosine signal of a preset frequency respectively, and the lookup table addresses of two adjacent paths at the same time differ by a preset phase increment, and the two adjacent lookup table addresses of the same path differ by a second number of multiples of the preset phase increment. Since the product of the frequency of the working clock and the second number is equivalent to the sampling frequency, according to the Nyquist sampling theorem, the preset frequency can theoretically reach half of the sampling frequency, so that a higher frequency sine and cosine signal can be generated in the FPGA, which can reduce resource consumption and cost.
本发明实施例还提供一种量子计算机控制系统,该量子计算机控制系统包括第一实施例或第二实施例的正余弦信号发生器。An embodiment of the present invention further provides a quantum computer control system, which includes the sine-cosine signal generator of the first embodiment or the second embodiment.
需要说明的是,前述实施例提供的正余弦发生器除了应用于量子计算机控制系统,也同样适用于任何具有正余弦信号生成需求的其他应用场景中,本发明对此不作限定。It should be noted that, in addition to being applied to quantum computer control systems, the sine and cosine generators provided in the aforementioned embodiments are also applicable to any other application scenarios that require sine and cosine signal generation, and the present invention is not limited to this.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”或“具体示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例中以合适的方式结合。此外,本领域的技术人员可以将本说明书中描述的不同实施例或示例进行接合和组合。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example" or "specific example" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification.
上述仅为本发明的优选实施例而已,并不对本发明起到任何限制作用。任何所属技术领域的技术人员,在不脱离本发明的技术方案的范围内,对本发明揭露的技术方案和技术内容做任何形式的等同替换或修改等变动,均属未脱离本发明的技术方案的内容,仍属于本发明的保护范围之内。The above is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any technician in the relevant technical field, without departing from the scope of the technical solution of the present invention, makes any form of equivalent replacement or modification to the technical solution and technical content disclosed in the present invention, which does not depart from the content of the technical solution of the present invention and still falls within the protection scope of the present invention.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210105741.0A CN115456186B (en) | 2022-01-27 | 2022-01-27 | Sinusoidal and cosine signal generator and quantum computer control system |
PCT/CN2023/073345 WO2023143447A1 (en) | 2022-01-27 | 2023-01-20 | Device for generating qubit control signal and quantum computer control system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210105741.0A CN115456186B (en) | 2022-01-27 | 2022-01-27 | Sinusoidal and cosine signal generator and quantum computer control system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115456186A CN115456186A (en) | 2022-12-09 |
CN115456186B true CN115456186B (en) | 2024-06-14 |
Family
ID=84295981
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210105741.0A Active CN115456186B (en) | 2022-01-27 | 2022-01-27 | Sinusoidal and cosine signal generator and quantum computer control system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115456186B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023143447A1 (en) * | 2022-01-27 | 2023-08-03 | 本源量子计算科技(合肥)股份有限公司 | Device for generating qubit control signal and quantum computer control system |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR0169371B1 (en) * | 1995-11-15 | 1999-03-20 | 김광호 | Sine/cosine wave generator |
KR100202956B1 (en) * | 1996-12-26 | 1999-06-15 | 전주범 | Method and apparatus for accessing trigonometric sum lookup table in digital signal processing system |
CN100429603C (en) * | 2006-11-01 | 2008-10-29 | 王文华 | High speed arbitrary waveform generator based on FPGA |
CN101335509B (en) * | 2007-06-29 | 2010-06-02 | 联芯科技有限公司 | Method and digital control oscillator for sinusoidal and cosine signal generation |
CN100568153C (en) * | 2008-07-18 | 2009-12-09 | 电子科技大学 | A Dual-channel Synchronous DDS Device with Adjustable Phase and Amplitude Modulation |
CN102983839A (en) * | 2012-12-05 | 2013-03-20 | 天津光电通信技术有限公司 | Method for realizing GMSK (Guassian Minimum Shift Keying) signal generator based on FPGA (Field Programmable Gate Array) |
CN103117731A (en) * | 2013-01-22 | 2013-05-22 | 上海航天测控通信研究所 | Sinusoidal signal generator implementation method based on field programmable gate array (FPGA) and sinusoidal signal generator implementation device |
CN105635014B (en) * | 2015-12-25 | 2018-12-21 | 北京遥测技术研究所 | CPM modulation digital implementation and digitlization CPM modulation module based on look-up table |
EP3788563B1 (en) * | 2018-09-10 | 2025-04-09 | Google LLC | Qubit control electronics |
-
2022
- 2022-01-27 CN CN202210105741.0A patent/CN115456186B/en active Active
Non-Patent Citations (2)
Title |
---|
基于动态相位分割的四通道信号发生器设计;岳国盛;;仪表技术与传感器;20090215(第02期);全文 * |
基于查找表和Newton插值算法的正余弦函数的FPGA实现;黄聚永;袁慧梅;吴向阳;崔国亮;高琴;;继电器;20070816(第16期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN115456186A (en) | 2022-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Krisztin | On stability properties for one-dimensional functional-differential equations | |
US8115519B2 (en) | Phase accumulator generating reference phase for phase coherent direct digital synthesis outputs | |
AU2019101559A4 (en) | Method and apparatus for generating random character string | |
CN115456186B (en) | Sinusoidal and cosine signal generator and quantum computer control system | |
CN101681297A (en) | Arrangements for memory allocation | |
JPH0357500B2 (en) | ||
CN103488245A (en) | Phase-amplitude conversion method and device in DDS (Direct Digital Synthesizer) | |
US8260836B2 (en) | Method and device for generating a filter coefficient in real time | |
EP2534754A1 (en) | Rom-based direct digital synthesizer with pipeline delay circuit | |
CN115469711B (en) | Sine and cosine signal generator, memory and quantum computer control system | |
CN115456182B (en) | Device for generating qubit control signal and quantum computer control system | |
CN107436619B (en) | High-precision low-cost digital sine wave generating device | |
CN110618883A (en) | Method, device, equipment and storage medium for sharing memory linked list | |
CN106598135A (en) | DDS signal generator | |
CN110633447B (en) | Spherical distance fixed-point calculation method based on FPGA and calculation device thereof | |
US20030172245A1 (en) | Data processing method and device for parallel stride access | |
CN102749957B (en) | Linear frequency modulation signal generation device for satellite borne equipment | |
CN103338159B (en) | Polling dispatching implementation method and device | |
CN104660218A (en) | Arbitrary waveform synthesizer | |
CN113240123B (en) | Digital quantum bit preparation method, system, computer and readable storage medium | |
CN112379858A (en) | Method and device for generating random number, electronic equipment and readable storage medium | |
CN107066030B (en) | Signal source and multi-frequency output compensation method and system thereof | |
WO2023143447A1 (en) | Device for generating qubit control signal and quantum computer control system | |
CN107291148B (en) | Sine wave generator | |
US8575976B2 (en) | Frequency divider systems and methods thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 230088 6th floor, E2 building, phase II, innovation industrial park, 2800 innovation Avenue, high tech Zone, Hefei City, Anhui Province Applicant after: Benyuan Quantum Computing Technology (Hefei) Co.,Ltd. Address before: 230088 6th floor, E2 building, phase II, innovation industrial park, 2800 innovation Avenue, high tech Zone, Hefei City, Anhui Province Applicant before: ORIGIN QUANTUM COMPUTING COMPANY, LIMITED, HEFEI |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: Sine and Cosine Signal Generator and Quantum Computer Control System Granted publication date: 20240614 Pledgee: Industrial Bank Limited by Share Ltd. Hefei branch Pledgor: Benyuan Quantum Computing Technology (Hefei) Co.,Ltd. Registration number: Y2024980059996 |