[go: up one dir, main page]

CN107748912B - A Delay Optimization Method for Ternary FPRM Circuit Using Bat Algorithm - Google Patents

A Delay Optimization Method for Ternary FPRM Circuit Using Bat Algorithm Download PDF

Info

Publication number
CN107748912B
CN107748912B CN201710820964.4A CN201710820964A CN107748912B CN 107748912 B CN107748912 B CN 107748912B CN 201710820964 A CN201710820964 A CN 201710820964A CN 107748912 B CN107748912 B CN 107748912B
Authority
CN
China
Prior art keywords
bat
value
polarity
displacement
fitness
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
Application number
CN201710820964.4A
Other languages
Chinese (zh)
Other versions
CN107748912A (en
Inventor
汪鹏君
汪涛
张会红
陈伟伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo University
Original Assignee
Ningbo University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ningbo University filed Critical Ningbo University
Priority to CN201710820964.4A priority Critical patent/CN107748912B/en
Publication of CN107748912A publication Critical patent/CN107748912A/en
Application granted granted Critical
Publication of CN107748912B publication Critical patent/CN107748912B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Geometry (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention discloses a three-value FPRM circuit delay optimization method utilizing a bat algorithm, which optimizes the result of large-scale three-value FPRM circuit delay polarity search by utilizing the population search capability of the bat algorithm, and the bat continuously updates the speed and displacement of the bat in the population evolution iteration process and simultaneously accompanies the update change of the bat sound wave loudness and the bat pulse rate; the method has the advantage of higher search efficiency on the basis of ensuring the optimization precision.

Description

一种利用蝙蝠算法的三值FPRM电路延时优化方法A Delay Optimization Method for Ternary FPRM Circuit Using Bat Algorithm

技术领域technical field

本发明涉及一种三值FPRM电路延时优化方法,尤其是涉及一种利用蝙蝠算法的三值FPRM电路延时优化方法。The invention relates to a delay optimization method of a ternary FPRM circuit, in particular to a delay optimization method of a ternary FPRM circuit using a bat algorithm.

背景技术Background technique

三值FPRM电路的n个输入变量对应3n个不同极性的逻辑函数表达式,不同极性对应的逻辑函数表达式的繁简程度也不尽相同,因此搜索三值FPRM电路的最佳极性成为三值FPRM电路延时优化的关键。通常,中小规模三值FPRM电路采用穷举算法遍历所有极性能够确定电路的最佳极性,然而对于大规模三值FPRM电路来说,极性搜索空间随着输入变量n的不断增加而呈现指数倍的增长,在一定时间范围内,采用穷尽搜索已经无法遍历完所有的极性得到最佳延时。The n input variables of the ternary FPRM circuit correspond to 3 n logic function expressions of different polarities, and the complexity and simplicity of the logic function expressions corresponding to different polarities are not the same. The performance becomes the key to the delay optimization of the ternary FPRM circuit. Usually, small and medium-scale ternary FPRM circuits use an exhaustive algorithm to traverse all polarities to determine the optimal polarity of the circuit. However, for large-scale ternary FPRM circuits, the polarity search space increases as the input variable n increases. Exponentially increased, within a certain time range, exhaustive search has been unable to traverse all polarities to obtain the best delay.

蝙蝠算法(Bat-inspired Algorithm,BA)是英国学者YANG等根据蝙蝠的回声定位能力提出的一种群智能搜索算法,主要根据蝙蝠在飞行中捕猎食物或者遇到障碍物时,会不断调整自身所发出脉冲的响度和频率来定位目标。蝙蝠算法将搜索空间中的每一个解模拟成一只蝙蝠,同时为所有蝙蝠设置一个适应度值,让每只蝙蝠在迭代过程中都根据当前的最优蝙蝠来调整响度和频率,其搜索效率较高。Bat-inspired Algorithm (BA) is a swarm intelligent search algorithm proposed by British scholar YANG and others based on the echolocation ability of bats. The loudness and frequency of the impulse to locate the target. The bat algorithm simulates each solution in the search space as a bat, and sets a fitness value for all bats, so that each bat adjusts the loudness and frequency according to the current optimal bat in the iterative process, and its search efficiency is relatively high. high.

鉴此,设计一种在保证优化精度的基础上,搜索效率较高的利用蝙蝠算法的三值FPRM电路延时优化方法具有重要意义。In view of this, it is of great significance to design a three-valued FPRM circuit delay optimization method using the bat algorithm with high search efficiency on the basis of ensuring the optimization accuracy.

发明内容SUMMARY OF THE INVENTION

本发明所要解决的技术问题是提供一种在保证优化精度的基础上,搜索效率较高的利用蝙蝠算法的三值FPRM电路延时优化方法。The technical problem to be solved by the present invention is to provide a ternary FPRM circuit delay optimization method using the bat algorithm with high search efficiency on the basis of ensuring the optimization accuracy.

本发明解决上述技术问题所采用的技术方案为:一种利用蝙蝠算法的三值FPRM电路延时优化方法,包括以下步骤:The technical solution adopted by the present invention to solve the above-mentioned technical problems is: a ternary FPRM circuit delay optimization method utilizing the bat algorithm, comprising the following steps:

(1)将极性为q、含有n个输入变量的三值FPRM电路采用函数展开式表示为:(1) The three-valued FPRM circuit with polarity q and n input variables is expressed as:

Figure BDA0001406308150000021
Figure BDA0001406308150000021

其中,x0,x1,...,xn-1为函数展开式的n个输入变量,q表示三值FPRM电路的极性;⊕Σ为模3加运算符号,“·”为乘运算符号;

Figure BDA0001406308150000022
为模3乘项,ai为模3乘项的系数,i=0,1,2,…,3n-1-1,
Figure BDA0001406308150000023
其中
Figure BDA0001406308150000024
Among them, x 0 , x 1 ,...,x n-1 are the n input variables of the function expansion, q represents the polarity of the three-valued FPRM circuit; ⊕Σ is the modulo-3 addition symbol, "·" is the multiplication calculating signs;
Figure BDA0001406308150000022
is the modulo 3 multiplication term, a i is the coefficient of the modulo 3 multiplication term, i=0, 1, 2, ..., 3 n-1 -1,
Figure BDA0001406308150000023
in
Figure BDA0001406308150000024

(2)使用Huffman算法分解q极性下三值FPRM电路函数展开式中不为0的模3乘项的系数,将最后分解得到的系数作为q极性下三值FPRM电路的延时估计数据;(2) Use the Huffman algorithm to decompose the coefficients of the modulo 3 multipliers that are not 0 in the function expansion of the three-valued FPRM circuit under q-polarity, and use the coefficient obtained by the final decomposition as the delay estimation data of the three-valued FPRM circuit under q-polarity ;

(3)利用蝙蝠算法对q极性下三值FPRM电路进行延时优化,具体步骤如下:(3) The bat algorithm is used to optimize the delay time of the ternary FPRM circuit under the q polarity. The specific steps are as follows:

A.建立蝙蝠算法与q极性下三值FPRM电路延时优化的映射关系:A. Establish the mapping relationship between the bat algorithm and the ternary FPRM circuit delay optimization under q polarity:

蝙蝠算法包含以下几个关键要素:蝙蝠位移、蝙蝠速度、蝙蝠声波频率、蝙蝠声波响度、蝙蝠搜索空间、蝙蝠的适应度、适应度最大的蝙蝠位移和最大适应度值;The bat algorithm includes the following key elements: bat displacement, bat speed, bat sound frequency, bat sound loudness, bat search space, bat fitness, bat displacement with the greatest fitness, and maximum fitness value;

三值FPRM电路延时优化包含以下几个关键要素:极性、极性变换、极性交流、极性突变、极性搜索空间、相应极性的延时、延时最优的极性和最佳延时;The delay optimization of ternary FPRM circuit includes the following key elements: polarity, polarity conversion, polarity exchange, polarity mutation, polarity search space, delay of corresponding polarity, optimal polarity of delay and maximum delay good delay;

将蝙蝠位移表示为极性;将蝙蝠速度表示为极性变换;将蝙蝠声波频率表示为极性交流;将蝙蝠声波响度表示为极性突变;将蝙蝠搜索空间表示为极性搜索空间;将蝙蝠的适应度表示为相应极性的延时;将适应度最大的蝙蝠位移表示为延时最优的极性;将最大适应度值表示为最佳延时;Denote bat displacement as polarity; bat velocity as polarity transformation; bat sonic frequency as polarity exchange; bat sonic loudness as polarity mutation; bat search space as polar search space; The fitness of is expressed as the delay of the corresponding polarity; the bat displacement with the largest fitness is expressed as the polarity with the optimal delay; the maximum fitness value is expressed as the best delay;

B.设置蝙蝠算法的相关参数:B. Set the relevant parameters of the bat algorithm:

将蝙蝠种群数量记为m,m为大于等于40的整数,蝙蝠搜索空间维数记为b,b为大于等于30的整数,蝙蝠种群进化的最大进化代数记为N,N为大于等于3000的整数,设定蝙蝠群体的当前进化代数为变量h;Denote the number of bat populations as m, m is an integer greater than or equal to 40, the bat search space dimension is denoted as b, b is an integer greater than or equal to 30, and the maximum evolutionary generation of bat population evolution is denoted as N, where N is greater than or equal to 3000 Integer, set the current evolutionary generation of the bat population as the variable h;

C.设定蝙蝠算法中用于计算蝙蝠的适应度的适应度函数:C. Set the fitness function used to calculate the fitness of bats in the bat algorithm:

设定蝙蝠算法中计算蝙蝠的适应度的适应度函数:在蝙蝠算法中,适应度越大表示蝙蝠相对于目标的位置越好,但是搜索三值FPRM电路最佳延时要求延时越小越好,因此,为了便于两者有效地结合,采用延时的倒数表示适应度,得到适应度函数如下所示:Set the fitness function for calculating the fitness of the bat in the bat algorithm: in the bat algorithm, the larger the fitness, the better the position of the bat relative to the target, but the search for the optimal delay of the ternary FPRM circuit requires that the smaller the delay, the better the position of the bat relative to the target. Well, therefore, in order to facilitate the effective combination of the two, the inverse of the delay is used to represent the fitness, and the fitness function is obtained as follows:

Figure BDA0001406308150000025
Figure BDA0001406308150000025

其中,符号“/”表示除法运算符;fitnessc表示第c个蝙蝠的适应度大小,c为大于等于1且小于等于m的整数;fitc为第c个蝙蝠位移对应的极性下三值FPRM电路的延时估计数据;

Figure BDA0001406308150000031
表示适应度放大系数,取值为大于等于500的整数;Among them, the symbol "/" represents the division operator; fitness c represents the fitness of the c-th bat, c is an integer greater than or equal to 1 and less than or equal to m; fit c is the lower three polar values corresponding to the displacement of the c-th bat Delay estimation data of FPRM circuit;
Figure BDA0001406308150000031
Indicates the fitness amplification factor, which is an integer greater than or equal to 500;

D.将蝙蝠种群中第c个蝙蝠位移记为xc,d,第c个蝙蝠速度记为vc,d,d表示第c个蝙蝠的搜索空间维数,d∈[1,b],第c个蝙蝠声波响度记为Ac,第c个蝙蝠脉冲速率记为rc,第c个蝙蝠声波频率记为fc,对蝙蝠种群中各个蝙蝠位移、蝙蝠速度、蝙蝠声波响度、蝙蝠脉冲速率和蝙蝠声波频率进行初始化,其中蝙蝠位移初始化为极性取值范围内的任意值,AC初始化为1~2之间的随机数,rc初始化为大于0且小于等于1的随机数,蝙蝠声波频率fc初始化为fmin~fmax之间的随机数,其中,fmin表示蝙蝠声波频率的最小值,取值为100,fmax表示蝙蝠声波频率的最大值,取值为1200,将变量h初始化为1;D. Denote the displacement of the c-th bat in the bat population as x c,d , and the velocity of the c-th bat as v c,d , where d represents the search space dimension of the c-th bat, d∈[1,b], The sound wave loudness of the c-th bat is recorded as A c , the pulse rate of the c -th bat is recorded as rc , and the sound wave frequency of the c-th bat is recorded as f c . The velocity and the frequency of the bat sound wave are initialized, where the bat displacement is initialized to any value within the range of polarity values, A C is initialized to a random number between 1 and 2, and rc is initialized to a random number greater than 0 and less than or equal to 1, The bat sound wave frequency f c is initialized as a random number between f min and f max , where f min represents the minimum value of the bat sound wave frequency, and the value is 100, and f max represents the maximum bat sound wave frequency, and the value is 1200. Initialize the variable h to 1;

E.根据步骤(1)和(2)分别计算蝙蝠群体中每个蝙蝠位移对应的极性下三值FPRM电路的延时估计数据,然后根据延时估计数据计算每个蝙蝠的适应度,将适应度值最大的蝙蝠位移作为蝙蝠种群的当前全局最优位移,如果适应度值最大的蝙蝠位移有多个,则随机选择其中一个适应度值最大的蝙蝠位移作为蝙蝠种群的当前全局最优位移;E. Calculate the delay estimation data of the ternary FPRM circuit under the polarity corresponding to the displacement of each bat in the bat group according to steps (1) and (2), and then calculate the fitness of each bat according to the delay estimation data, and set the The bat displacement with the largest fitness value is used as the current global optimal displacement of the bat population. If there are multiple bat displacements with the largest fitness value, one of the bat displacements with the largest fitness value is randomly selected as the current global optimal displacement of the bat population. ;

F.对蝙蝠群体的蝙蝠位移和蝙蝠速度进行第h轮进化代的首次更新:先采用随机函数生成均匀分布的随机变量α,α∈[0,1],再通过公式(1)更新第h轮进化代的蝙蝠声波频率fc,然后再结合公式(2)和公式(3)更新蝙蝠位移xc,d和蝙蝠速度vc,dF. The first update of the h-th evolutionary generation for the bat displacement and bat velocity of the bat colony: First, use a random function to generate uniformly distributed random variables α, α∈[0,1], and then update the h-th generation through formula (1). The bat sound frequency f c of the round evolutionary generation, and then the bat displacement x c,d and the bat velocity v c,d are updated by combining equations (2) and (3):

fc=fmin+(fmax-fmin)*α (1)f c =f min +(f max -f min )*α (1)

Figure BDA0001406308150000032
Figure BDA0001406308150000032

Figure BDA0001406308150000033
Figure BDA0001406308150000033

其中,

Figure BDA0001406308150000034
表示在第h轮进化代第c个蝙蝠速度的首次更新值,
Figure BDA0001406308150000035
表示在第h轮进化代第c个蝙蝠位移的首次更新值;in,
Figure BDA0001406308150000034
represents the first update value of the cth bat velocity in the hth evolutionary generation,
Figure BDA0001406308150000035
represents the first update value of the displacement of the cth bat in the hth evolutionary generation;

如果h的当前值为1,则

Figure BDA0001406308150000036
为第c个蝙蝠速度的初始值,
Figure BDA0001406308150000037
为第c个蝙蝠位移的初始值,Ph-1为蝙蝠种群的当前全局最优位移的初始值;If the current value of h is 1, then
Figure BDA0001406308150000036
is the initial value of the cth bat speed,
Figure BDA0001406308150000037
is the initial value of the cth bat displacement, and P h-1 is the initial value of the current global optimal displacement of the bat population;

如果h的当前值大于1,则

Figure BDA0001406308150000038
为在第h-1轮进化代第c个蝙蝠速度的更新值,
Figure BDA0001406308150000039
为在第h-1轮进化代第c个蝙蝠位移的更新值,Ph-1为在第h-1轮进化代蝙蝠种群的当前全局最优位置的更新值;If the current value of h is greater than 1, then
Figure BDA0001406308150000038
is the updated value of the cth bat speed in the h-1th evolutionary generation,
Figure BDA0001406308150000039
is the updated value of the displacement of the cth bat in the h-1th evolutionary generation, and P h-1 is the updated value of the current global optimal position of the bat population in the h-1th evolutionary generation;

G.对蝙蝠群体进行再次更新,具体过程为:G. Update the bat colony again, the specific process is:

G-1.用随机函数产生随机数rand1,rand1∈[0,5000];G-1. Use random function to generate random number rand1, rand1∈[0,5000];

G-2.将rand1和第c个蝙蝠脉冲速率rc进行比较,如果rand1小于rc,则该蝙蝠的蝙蝠位移不需再次更新,将第c个蝙蝠速度的首次更新值作为其第h轮进化代的更新值,并返回步骤G-1,开始对下一个蝙蝠位移进行更新,如果rand1大于或等于rc,则将蝙蝠种群的当前全局最优位移对应的适应度值最大的蝙蝠位移加1后作为局部最优蝙蝠位移,记为

Figure BDA0001406308150000041
进入步骤G-3;G-2. Compare rand1 with the pulse rate rc of the cth bat. If rand1 is smaller than rc , the bat displacement of the bat does not need to be updated again, and the first update value of the cth bat speed is taken as its hth round The updated value of the evolutionary generation, and return to step G-1 to start updating the next bat displacement. If rand1 is greater than or equal to rc , add the bat displacement with the largest fitness value corresponding to the current global optimal displacement of the bat population. After 1 as the local optimal bat displacement, denoted as
Figure BDA0001406308150000041
Go to step G-3;

G-3.计算蝙蝠位移

Figure BDA0001406308150000042
对应的适应度值;G-3. Calculate bat displacement
Figure BDA0001406308150000042
the corresponding fitness value;

G-4.用随机函数产生随机数rand2,rand2∈[0,3000];G-4. Use random functions to generate random numbers rand2, rand2∈[0, 3000];

G-5.如果rand2小于或等于Ac,并且蝙蝠位移

Figure BDA0001406308150000043
对应的适应度值大于或等于第c个蝙蝠当前的适应度值,则采用蝙蝠位移
Figure BDA0001406308150000044
再次更新蝙蝠位移xc,d,将第c个蝙蝠速度的再次更新值作为其第h轮进化代的更新值,否则,蝙蝠位移xc,d不进行更新,将其首次更新值作为其第h轮进化代的更新值;G-5. If rand2 is less than or equal to A c and the bat is displaced
Figure BDA0001406308150000043
If the corresponding fitness value is greater than or equal to the current fitness value of the cth bat, the bat displacement is used
Figure BDA0001406308150000044
The bat displacement x c,d is updated again, and the re-updated value of the c-th bat velocity is taken as the updated value of its h-th evolutionary generation. Otherwise, the bat displacement x c, d is not updated, and its first updated value is taken as its first updated value. The updated value of the h-round evolutionary generation;

G-6.按照步骤G-1~G-5的方法完成蝙蝠群体的再次更新,然后重新计算更新后的蝙蝠群体中所有蝙蝠的适应度值,采用适应度值最大的蝙蝠位移去更新蝙蝠种群的当前全局最优位移,如果适应度值最大的蝙蝠位移有多个,则随机选择其中一个适应度值最大的蝙蝠位移去更新蝙蝠种群的当前全局最优位移;G-6. Follow steps G-1 to G-5 to update the bat colony again, then recalculate the fitness values of all bats in the updated bat colony, and use the bat displacement with the largest fitness value to update the bat colony If there are multiple bat displacements with the largest fitness value, one of the bat displacements with the largest fitness value is randomly selected to update the current global optimal displacement of the bat population;

H.通过公式(4)和公式(5)对蝙蝠群体的蝙蝠声波响度和蝙蝠脉冲速率进行第h轮更新:H. The h-th round update of the bat sonic loudness and bat pulse rate of the bat colony is performed by Equation (4) and Equation (5):

Figure BDA0001406308150000045
Figure BDA0001406308150000045

Figure BDA0001406308150000046
Figure BDA0001406308150000046

其中,δ为大于0且小于等于1的任意常数,γ为大于0的常数,exp表示以自然常数e为底的指数函数,

Figure BDA0001406308150000047
表示第c个蝙蝠声波响度在第h轮的更新值,
Figure BDA0001406308150000048
第c个蝙蝠脉冲速率在第h轮的更新值;Among them, δ is an arbitrary constant greater than 0 and less than or equal to 1, γ is a constant greater than 0, exp represents the exponential function with the natural constant e as the base,
Figure BDA0001406308150000047
represents the updated value of the cth bat sound wave loudness in the hth round,
Figure BDA0001406308150000048
The updated value of the cth bat pulse rate in the hth round;

如果h的当前值等于1时,

Figure BDA0001406308150000049
表示第c个蝙蝠声波响度的初始值,
Figure BDA00014063081500000410
表示第c个蝙蝠脉冲速率的初始值;If the current value of h is equal to 1,
Figure BDA0001406308150000049
represents the initial value of the loudness of the cth bat sound,
Figure BDA00014063081500000410
represents the initial value of the cth bat pulse rate;

如果h的当前值大于1时,

Figure BDA00014063081500000411
表示第h-1轮第c个蝙蝠声波响度的更新值,
Figure BDA00014063081500000412
表示第h-1轮第c个蝙蝠脉冲速率的更新值;If the current value of h is greater than 1,
Figure BDA00014063081500000411
represents the updated value of the loudness of the cth bat sound in the h-1th round,
Figure BDA00014063081500000412
Represents the updated value of the cth bat pulse rate in the h-1th round;

I.判断h的当前值是否等于最大进化代数,如果不等于,则采用h的当前值加1后的值更新h的值,并返回步骤F进行下一轮的更新;如果h的当前值等于最大进化代数,则将蝙蝠种群的当前全局最优位移对应的适应度值最大的蝙蝠位移作为延时最优的极性,将该延时最优极性对应的适应度值作为最佳延时。I. Judge whether the current value of h is equal to the maximum evolutionary algebra, if not, then use the current value of h plus 1 to update the value of h, and return to step F for the next round of update; if the current value of h is equal to The maximum evolutionary algebra, the bat displacement with the largest fitness value corresponding to the current global optimal displacement of the bat population is used as the polarity of the optimal delay, and the fitness value corresponding to the optimal polarity of the delay is regarded as the optimal delay .

所述的步骤(2)中得到q极性下三值FPRM电路的延时估计数据的具体过程为:In the described step (2), the specific process of obtaining the delay estimation data of the ternary FPRM circuit under the q polarity is:

a.根据q极性下三值FPRM电路函数展开式,确定q极性下三值FPRM电路中不为0的模3乘项的数量,将不为0的模3乘项数量记为M;a. According to the function expansion of the three-valued FPRM circuit under the q-polarity, determine the number of modulo-3 multipliers that are not 0 in the three-valued FPRM circuit under the q-polarity, and denote the number of modulo-3 multipliers that are not 0 as M;

b.对M个模3乘项的系数进行比较,得到q极性下三值FPRM电路的延时估计数据,具体过程为:b. Compare the coefficients of the M modulo-3 multiplication terms to obtain the delay estimation data of the three-valued FPRM circuit under the q polarity. The specific process is:

当M等于1时,则将这1个模3乘项的系数作为q极性下三值FPRM电路的延时估计数据;When M is equal to 1, the coefficient of the 1 modulo 3 multiplication term is used as the delay estimation data of the three-valued FPRM circuit under the q polarity;

当M等于2时,如果两个系数相等,则选择任意一个系数作为q极性下三值FPRM电路的延时估计数据,如果两个系数不相等,则删除两者中较小的系数,保留两者中较大的系数,并采用两者中较大的系数的值加1后得到的值更新该系数的值,将其更新值作为q极性下三值FPRM电路的延时估计数据;When M is equal to 2, if the two coefficients are equal, select any one of the coefficients as the delay estimation data of the three-valued FPRM circuit under the q polarity. If the two coefficients are not equal, delete the smaller coefficient and keep it. The larger coefficient of the two is used to update the value of the coefficient with the value obtained by adding 1 to the value of the larger coefficient of the two, and the updated value is used as the delay estimation data of the three-value FPRM circuit under the q polarity;

当M大于2时,具体比较过程为:When M is greater than 2, the specific comparison process is:

①随机选择任意两个模3乘项的系数;①Randomly select the coefficients of any two modulo 3 multipliers;

②对两个系数进行比较:如果两者相等,则返回步骤①开始新一轮的选择;如果两者不相等,则删除两者中较小的系数,保留两者中较大的系数,并采用两者中较大的系数的值加1后得到的值更新该系数的值;②Compare the two coefficients: if the two are equal, go back to step ① to start a new round of selection; if the two are not equal, delete the smaller coefficient of the two, keep the larger coefficient of the two, and Update the value of the coefficient with the value obtained by adding 1 to the value of the larger coefficient of the two;

③再从剩余模3乘项的系数中随机选择一个系数,将该系数与上一步骤中保留的较大系数的更新值按照步骤②的方法进行比较;③ Then randomly select a coefficient from the coefficients of the remaining modulo 3 multiplication terms, and compare the coefficient with the updated value of the larger coefficient retained in the previous step according to the method of step ②;

④重复步骤③,直到所有的系数比较完成;④ Repeat step ③ until all coefficient comparisons are completed;

⑤将最后保留的较大系数的更新值作为q极性下三值FPRM电路的延时估计数据;⑤ Use the updated value of the last remaining larger coefficient as the delay estimation data of the three-valued FPRM circuit under the q polarity;

与现有技术相比,本发明的优点在于通过运用蝙蝠算法的种群搜索能力优化大规模三值FPRM电路延时极性搜索的结果,蝙蝠在种群进化迭代过程中不断更新自身速度与位移,同时伴随着蝙蝠声波响度和蝙蝠脉冲速率的更新变化,本发明的方法在保证优化精度的基础上,搜索效率较高。Compared with the prior art, the advantage of the present invention is that by using the population search capability of the bat algorithm to optimize the results of the large-scale ternary FPRM circuit delay polarity search, the bat continuously updates its own speed and displacement in the iterative process of population evolution, and at the same time. Along with the update and change of the bat sound wave loudness and the bat pulse rate, the method of the present invention has high search efficiency on the basis of ensuring the optimization accuracy.

具体实施方式Detailed ways

以下结合实施例对本发明作进一步详细描述。The present invention will be described in further detail below in conjunction with the embodiments.

实施例一:一种利用蝙蝠算法的三值FPRM电路延时优化方法,包括以下步骤:Embodiment 1: a three-valued FPRM circuit delay optimization method utilizing the bat algorithm, comprising the following steps:

(1)将极性为q、含有n个输入变量的三值FPRM电路采用函数展开式表示为:(1) The three-valued FPRM circuit with polarity q and n input variables is expressed as:

Figure BDA0001406308150000061
Figure BDA0001406308150000061

其中,x0,x1,...,xn-1为函数展开式的n个输入变量,q表示三值FPRM电路的极性;⊕Σ为模3加运算符号,“·”为乘运算符号;

Figure BDA0001406308150000062
为模3乘项,ai为模3乘项的系数,i=0,1,2,…,3n-1-1,
Figure BDA0001406308150000063
其中
Figure BDA0001406308150000064
Among them, x 0 , x 1 ,...,x n-1 are the n input variables of the function expansion, q represents the polarity of the three-valued FPRM circuit; ⊕Σ is the modulo-3 addition symbol, "·" is the multiplication calculating signs;
Figure BDA0001406308150000062
is the modulo 3 multiplication term, a i is the coefficient of the modulo 3 multiplication term, i=0, 1, 2, ..., 3 n-1 -1,
Figure BDA0001406308150000063
in
Figure BDA0001406308150000064

(2)使用Huffman算法分解q极性下三值FPRM电路函数展开式中不为0的模3乘项的系数,将最后分解得到的系数作为q极性下三值FPRM电路的延时估计数据;(2) Use the Huffman algorithm to decompose the coefficients of the modulo 3 multipliers that are not 0 in the function expansion of the three-valued FPRM circuit under q-polarity, and use the coefficient obtained by the final decomposition as the delay estimation data of the three-valued FPRM circuit under q-polarity ;

(3)利用蝙蝠算法对q极性下三值FPRM电路进行延时优化,具体步骤如下:(3) The bat algorithm is used to optimize the delay time of the ternary FPRM circuit under the q polarity. The specific steps are as follows:

A.建立蝙蝠算法与q极性下三值FPRM电路延时优化的映射关系:A. Establish the mapping relationship between the bat algorithm and the ternary FPRM circuit delay optimization under q polarity:

蝙蝠算法包含以下几个关键要素:蝙蝠位移、蝙蝠速度、蝙蝠声波频率、蝙蝠声波响度、蝙蝠搜索空间、蝙蝠的适应度、适应度最大的蝙蝠位移和最大适应度值;The bat algorithm includes the following key elements: bat displacement, bat speed, bat sound frequency, bat sound loudness, bat search space, bat fitness, bat displacement with the greatest fitness, and maximum fitness value;

三值FPRM电路延时优化包含以下几个关键要素:极性、极性变换、极性交流、极性突变、极性搜索空间、相应极性的延时、延时最优的极性和最佳延时;The delay optimization of ternary FPRM circuit includes the following key elements: polarity, polarity conversion, polarity exchange, polarity mutation, polarity search space, delay of corresponding polarity, optimal polarity of delay and maximum delay good delay;

将蝙蝠位移表示为极性;将蝙蝠速度表示为极性变换;将蝙蝠声波频率表示为极性交流;将蝙蝠声波响度表示为极性突变;将蝙蝠搜索空间表示为极性搜索空间;将蝙蝠的适应度表示为相应极性的延时;将适应度最大的蝙蝠位移表示为延时最优的极性;将最大适应度值表示为最佳延时;Denote bat displacement as polarity; bat velocity as polarity transformation; bat sonic frequency as polarity exchange; bat sonic loudness as polarity mutation; bat search space as polar search space; The fitness of is expressed as the delay of the corresponding polarity; the bat displacement with the largest fitness is expressed as the polarity with the optimal delay; the maximum fitness value is expressed as the best delay;

B.设置蝙蝠算法的相关参数:B. Set the relevant parameters of the bat algorithm:

将蝙蝠种群数量记为m,m为大于等于40的整数,蝙蝠搜索空间维数记为b,b为大于等于30的整数,蝙蝠种群进化的最大进化代数记为N,N为大于等于3000的整数,设定蝙蝠群体的当前进化代数为变量h;Denote the number of bat populations as m, m is an integer greater than or equal to 40, the bat search space dimension is denoted as b, b is an integer greater than or equal to 30, and the maximum evolutionary generation of bat population evolution is denoted as N, where N is greater than or equal to 3000 Integer, set the current evolutionary generation of the bat population as the variable h;

C.设定蝙蝠算法中用于计算蝙蝠的适应度的适应度函数:C. Set the fitness function used to calculate the fitness of bats in the bat algorithm:

设定蝙蝠算法中计算蝙蝠的适应度的适应度函数:在蝙蝠算法中,适应度越大表示蝙蝠相对于目标的位置越好,但是搜索三值FPRM电路最佳延时要求延时越小越好,因此,为了便于两者有效地结合,采用延时的倒数表示适应度,得到适应度函数如下所示:Set the fitness function for calculating the fitness of the bat in the bat algorithm: in the bat algorithm, the larger the fitness, the better the position of the bat relative to the target, but the search for the optimal delay of the ternary FPRM circuit requires that the smaller the delay, the better the position of the bat relative to the target. Well, therefore, in order to facilitate the effective combination of the two, the inverse of the delay is used to represent the fitness, and the fitness function is obtained as follows:

Figure BDA0001406308150000071
Figure BDA0001406308150000071

其中,符号“/”表示除法运算符;fitnessc表示第c个蝙蝠的适应度大小,c为大于等于1且小于等于m的整数;fitc为第c个蝙蝠位移对应的极性下三值FPRM电路的延时估计数据;

Figure BDA0001406308150000072
表示适应度放大系数,取值为大于等于500的整数;Among them, the symbol "/" represents the division operator; fitness c represents the fitness of the c-th bat, c is an integer greater than or equal to 1 and less than or equal to m; fit c is the lower three polar values corresponding to the displacement of the c-th bat Delay estimation data of FPRM circuit;
Figure BDA0001406308150000072
Indicates the fitness amplification factor, which is an integer greater than or equal to 500;

D.将蝙蝠种群中第c个蝙蝠位移记为xc,d,第c个蝙蝠速度记为vc,d,d表示第c个蝙蝠的搜索空间维数,d∈[1,b],第c个蝙蝠声波响度记为Ac,第c个蝙蝠脉冲速率记为rc,第c个蝙蝠声波频率记为fc,对蝙蝠种群中各个蝙蝠位移、蝙蝠速度、蝙蝠声波响度、蝙蝠脉冲速率和蝙蝠声波频率进行初始化,其中蝙蝠位移初始化为极性取值范围内的任意值,AC初始化为1~2之间的随机数,rc初始化为大于0且小于等于1的随机数,蝙蝠声波频率fc初始化为fmin~fmax之间的随机数,其中,fmin表示蝙蝠声波频率的最小值,取值为100,fmax表示蝙蝠声波频率的最大值,取值为1200,将变量h初始化为1;D. Denote the displacement of the c-th bat in the bat population as x c,d , and the velocity of the c-th bat as v c,d , where d represents the search space dimension of the c-th bat, d∈[1,b], The sound wave loudness of the c-th bat is recorded as A c , the pulse rate of the c -th bat is recorded as rc , and the sound wave frequency of the c-th bat is recorded as f c . The velocity and the frequency of the bat sound wave are initialized, where the bat displacement is initialized to any value within the range of polarity values, A C is initialized to a random number between 1 and 2, and rc is initialized to a random number greater than 0 and less than or equal to 1, The bat sound wave frequency f c is initialized as a random number between f min and f max , where f min represents the minimum value of the bat sound wave frequency, and the value is 100, and f max represents the maximum bat sound wave frequency, and the value is 1200. Initialize the variable h to 1;

E.根据步骤(1)和(2)分别计算蝙蝠群体中每个蝙蝠位移对应的极性下三值FPRM电路的延时估计数据,然后根据延时估计数据计算每个蝙蝠的适应度,将适应度值最大的蝙蝠位移作为蝙蝠种群的当前全局最优位移,如果适应度值最大的蝙蝠位移有多个,则随机选择其中一个适应度值最大的蝙蝠位移作为蝙蝠种群的当前全局最优位移;E. Calculate the delay estimation data of the ternary FPRM circuit under the polarity corresponding to the displacement of each bat in the bat group according to steps (1) and (2), and then calculate the fitness of each bat according to the delay estimation data, and set the The bat displacement with the largest fitness value is used as the current global optimal displacement of the bat population. If there are multiple bat displacements with the largest fitness value, one of the bat displacements with the largest fitness value is randomly selected as the current global optimal displacement of the bat population. ;

F.对蝙蝠群体的蝙蝠位移和蝙蝠速度进行第h轮进化代的首次更新:先采用随机函数生成均匀分布的随机变量α,α∈[0,1],再通过公式(1)更新第h轮进化代的蝙蝠声波频率fc,然后再结合公式(2)和公式(3)更新蝙蝠位移xc,d和蝙蝠速度vc,dF. The first update of the h-th evolutionary generation for the bat displacement and bat velocity of the bat colony: First, use a random function to generate uniformly distributed random variables α, α∈[0,1], and then update the h-th generation through formula (1). The bat sound frequency f c of the round evolutionary generation, and then the bat displacement x c,d and the bat velocity v c,d are updated by combining equations (2) and (3):

fc=fmin+(fmax-fmin)*α (1)f c =f min +(f max -f min )*α (1)

Figure BDA0001406308150000073
Figure BDA0001406308150000073

Figure BDA0001406308150000074
Figure BDA0001406308150000074

其中,

Figure BDA0001406308150000075
表示在第h轮进化代第c个蝙蝠速度的首次更新值,
Figure BDA0001406308150000076
表示在第h轮进化代第c个蝙蝠位移的首次更新值;in,
Figure BDA0001406308150000075
represents the first update value of the cth bat velocity in the hth evolutionary generation,
Figure BDA0001406308150000076
represents the first update value of the displacement of the cth bat in the hth evolutionary generation;

如果h的当前值为1,则

Figure BDA0001406308150000077
为第c个蝙蝠速度的初始值,
Figure BDA0001406308150000078
为第c个蝙蝠位移的初始值,Ph-1为蝙蝠种群的当前全局最优位移的初始值;If the current value of h is 1, then
Figure BDA0001406308150000077
is the initial value of the cth bat speed,
Figure BDA0001406308150000078
is the initial value of the cth bat displacement, and P h-1 is the initial value of the current global optimal displacement of the bat population;

如果h的当前值大于1,则

Figure BDA0001406308150000081
为在第h-1轮进化代第c个蝙蝠速度的更新值,
Figure BDA0001406308150000082
为在第h-1轮进化代第c个蝙蝠位移的更新值,Ph-1为在第h-1轮进化代蝙蝠种群的当前全局最优位置的更新值;If the current value of h is greater than 1, then
Figure BDA0001406308150000081
is the updated value of the cth bat speed in the h-1th evolutionary generation,
Figure BDA0001406308150000082
is the updated value of the displacement of the cth bat in the h-1th evolutionary generation, and P h-1 is the updated value of the current global optimal position of the bat population in the h-1th evolutionary generation;

G.对蝙蝠群体进行再次更新,具体过程为:G. Update the bat colony again, the specific process is:

G-1.用随机函数产生随机数rand1,rand1∈[0,5000];G-1. Use random function to generate random number rand1, rand1∈[0,5000];

G-2.将rand1和第c个蝙蝠脉冲速率rc进行比较,如果rand1小于rc,则该蝙蝠的蝙蝠位移不需再次更新,将第c个蝙蝠速度的首次更新值作为其第h轮进化代的更新值,并返回步骤G-1,开始对下一个蝙蝠位移进行更新,如果rand1大于或等于rc,则将蝙蝠种群的当前全局最优位移对应的适应度值最大的蝙蝠位移加1后作为局部最优蝙蝠位移,记为

Figure BDA0001406308150000083
进入步骤G-3;G-2. Compare rand1 with the pulse rate rc of the cth bat. If rand1 is smaller than rc , the bat displacement of the bat does not need to be updated again, and the first update value of the cth bat speed is taken as its hth round The updated value of the evolutionary generation, and return to step G-1 to start updating the next bat displacement. If rand1 is greater than or equal to rc , add the bat displacement with the largest fitness value corresponding to the current global optimal displacement of the bat population. After 1 as the local optimal bat displacement, denoted as
Figure BDA0001406308150000083
Go to step G-3;

G-3.计算蝙蝠位移

Figure BDA0001406308150000084
对应的适应度值;G-3. Calculate bat displacement
Figure BDA0001406308150000084
the corresponding fitness value;

G-4.用随机函数产生随机数rand2,rand2∈[0,3000];G-4. Use random functions to generate random numbers rand2, rand2∈[0, 3000];

G-5.如果rand2小于或等于Ac,并且蝙蝠位移

Figure BDA0001406308150000085
对应的适应度值大于或等于第c个蝙蝠当前的适应度值,则采用蝙蝠位移
Figure BDA0001406308150000086
再次更新蝙蝠位移xc,d,将第c个蝙蝠速度的再次更新值作为其第h轮进化代的更新值,否则,蝙蝠位移xc,d不进行更新,将其首次更新值作为其第h轮进化代的更新值;G-5. If rand2 is less than or equal to A c and the bat is displaced
Figure BDA0001406308150000085
If the corresponding fitness value is greater than or equal to the current fitness value of the cth bat, the bat displacement is used
Figure BDA0001406308150000086
The bat displacement x c,d is updated again, and the re-updated value of the c-th bat velocity is taken as the updated value of its h-th evolutionary generation. Otherwise, the bat displacement x c, d is not updated, and its first updated value is taken as its first updated value. The updated value of the h-round evolutionary generation;

G-6.按照步骤G-1~G-5的方法完成蝙蝠群体的再次更新,然后重新计算更新后的蝙蝠群体中所有蝙蝠的适应度值,采用适应度值最大的蝙蝠位移去更新蝙蝠种群的当前全局最优位移,如果适应度值最大的蝙蝠位移有多个,则随机选择其中一个适应度值最大的蝙蝠位移去更新蝙蝠种群的当前全局最优位移;G-6. Follow steps G-1 to G-5 to update the bat colony again, then recalculate the fitness values of all bats in the updated bat colony, and use the bat displacement with the largest fitness value to update the bat colony If there are multiple bat displacements with the largest fitness value, one of the bat displacements with the largest fitness value is randomly selected to update the current global optimal displacement of the bat population;

H.通过公式(4)和公式(5)对蝙蝠群体的蝙蝠声波响度和蝙蝠脉冲速率进行第h轮更新:H. The h-th round update of the bat sonic loudness and bat pulse rate of the bat colony is performed by Equation (4) and Equation (5):

Figure BDA0001406308150000087
Figure BDA0001406308150000087

Figure BDA0001406308150000088
Figure BDA0001406308150000088

其中,δ为大于0且小于等于1的任意常数,γ为大于0的常数,exp表示以自然常数e为底的指数函数,

Figure BDA0001406308150000089
表示第c个蝙蝠声波响度在第h轮的更新值,
Figure BDA00014063081500000810
第c个蝙蝠脉冲速率在第h轮的更新值;Among them, δ is an arbitrary constant greater than 0 and less than or equal to 1, γ is a constant greater than 0, exp represents the exponential function with the natural constant e as the base,
Figure BDA0001406308150000089
represents the updated value of the cth bat sound wave loudness in the hth round,
Figure BDA00014063081500000810
The updated value of the cth bat pulse rate in the hth round;

如果h的当前值等于1时,

Figure BDA0001406308150000091
表示第c个蝙蝠声波响度的初始值,
Figure BDA0001406308150000092
表示第c个蝙蝠脉冲速率的初始值;If the current value of h is equal to 1,
Figure BDA0001406308150000091
represents the initial value of the loudness of the cth bat sound,
Figure BDA0001406308150000092
represents the initial value of the cth bat pulse rate;

如果h的当前值大于1时,

Figure BDA0001406308150000093
表示第h-1轮第c个蝙蝠声波响度的更新值,
Figure BDA0001406308150000094
表示第h-1轮第c个蝙蝠脉冲速率的更新值;If the current value of h is greater than 1,
Figure BDA0001406308150000093
represents the updated value of the loudness of the cth bat sound in the h-1th round,
Figure BDA0001406308150000094
Represents the updated value of the cth bat pulse rate in the h-1th round;

I.判断h的当前值是否等于最大进化代数,如果不等于,则采用h的当前值加1后的值更新h的值,并返回步骤F进行下一轮的更新;如果h的当前值等于最大进化代数,则将蝙蝠种群的当前全局最优位移对应的适应度值最大的蝙蝠位移作为延时最优的极性,将该延时最优极性对应的适应度值作为最佳延时。I. Judge whether the current value of h is equal to the maximum evolutionary algebra, if not, then use the current value of h plus 1 to update the value of h, and return to step F for the next round of update; if the current value of h is equal to The maximum evolutionary algebra, the bat displacement with the largest fitness value corresponding to the current global optimal displacement of the bat population is used as the polarity of the optimal delay, and the fitness value corresponding to the optimal polarity of the delay is regarded as the optimal delay .

实施例二:一种利用蝙蝠算法的三值FPRM电路延时优化方法,包括以下步骤:Embodiment 2: a three-valued FPRM circuit delay optimization method utilizing the bat algorithm, comprising the following steps:

(1)将极性为q、含有n个输入变量的三值FPRM电路采用函数展开式表示为:(1) The three-valued FPRM circuit with polarity q and n input variables is expressed as:

Figure BDA0001406308150000095
Figure BDA0001406308150000095

其中,x0,x1,...,xn-1为函数展开式的n个输入变量,q表示三值FPRM电路的极性;⊕Σ为模3加运算符号,“·”为乘运算符号;

Figure BDA0001406308150000096
为模3乘项,ai为模3乘项的系数,i=0,1,2,…,3n-1-1,
Figure BDA0001406308150000097
其中
Figure BDA0001406308150000098
Among them, x 0 , x 1 ,...,x n-1 are the n input variables of the function expansion, q represents the polarity of the three-valued FPRM circuit; ⊕Σ is the modulo-3 addition symbol, "·" is the multiplication calculating signs;
Figure BDA0001406308150000096
is the modulo 3 multiplication term, a i is the coefficient of the modulo 3 multiplication term, i=0, 1, 2, ..., 3 n-1 -1,
Figure BDA0001406308150000097
in
Figure BDA0001406308150000098

(2)使用Huffman算法分解q极性下三值FPRM电路函数展开式中不为0的模3乘项的系数,将最后分解得到的系数作为q极性下三值FPRM电路的延时估计数据;(2) Use the Huffman algorithm to decompose the coefficients of the modulo 3 multipliers that are not 0 in the function expansion of the three-valued FPRM circuit under q-polarity, and use the coefficient obtained by the final decomposition as the delay estimation data of the three-valued FPRM circuit under q-polarity ;

(3)利用蝙蝠算法对q极性下三值FPRM电路进行延时优化,具体步骤如下:(3) The bat algorithm is used to optimize the delay time of the ternary FPRM circuit under the q polarity. The specific steps are as follows:

A.建立蝙蝠算法与q极性下三值FPRM电路延时优化的映射关系:A. Establish the mapping relationship between the bat algorithm and the ternary FPRM circuit delay optimization under q polarity:

蝙蝠算法包含以下几个关键要素:蝙蝠位移、蝙蝠速度、蝙蝠声波频率、蝙蝠声波响度、蝙蝠搜索空间、蝙蝠的适应度、适应度最大的蝙蝠位移和最大适应度值;The bat algorithm includes the following key elements: bat displacement, bat speed, bat sound frequency, bat sound loudness, bat search space, bat fitness, bat displacement with the greatest fitness, and maximum fitness value;

三值FPRM电路延时优化包含以下几个关键要素:极性、极性变换、极性交流、极性突变、极性搜索空间、相应极性的延时、延时最优的极性和最佳延时;The delay optimization of ternary FPRM circuit includes the following key elements: polarity, polarity conversion, polarity exchange, polarity mutation, polarity search space, delay of corresponding polarity, optimal polarity of delay and maximum delay good delay;

将蝙蝠位移表示为极性;将蝙蝠速度表示为极性变换;将蝙蝠声波频率表示为极性交流;将蝙蝠声波响度表示为极性突变;将蝙蝠搜索空间表示为极性搜索空间;将蝙蝠的适应度表示为相应极性的延时;将适应度最大的蝙蝠位移表示为延时最优的极性;将最大适应度值表示为最佳延时;Denote bat displacement as polarity; bat velocity as polarity transformation; bat sonic frequency as polarity exchange; bat sonic loudness as polarity mutation; bat search space as polar search space; The fitness of is expressed as the delay of the corresponding polarity; the bat displacement with the largest fitness is expressed as the polarity with the optimal delay; the maximum fitness value is expressed as the best delay;

B.设置蝙蝠算法的相关参数:B. Set the relevant parameters of the bat algorithm:

将蝙蝠种群数量记为m,m为大于等于40的整数,蝙蝠搜索空间维数记为b,b为大于等于30的整数,蝙蝠种群进化的最大进化代数记为N,N为大于等于3000的整数,设定蝙蝠群体的当前进化代数为变量h;Denote the number of bat populations as m, m is an integer greater than or equal to 40, the bat search space dimension is denoted as b, b is an integer greater than or equal to 30, and the maximum evolutionary generation of bat population evolution is denoted as N, where N is greater than or equal to 3000 Integer, set the current evolutionary generation of the bat population as the variable h;

C.设定蝙蝠算法中用于计算蝙蝠的适应度的适应度函数:C. Set the fitness function used to calculate the fitness of bats in the bat algorithm:

设定蝙蝠算法中计算蝙蝠的适应度的适应度函数:在蝙蝠算法中,适应度越大表示蝙蝠相对于目标的位置越好,但是搜索三值FPRM电路最佳延时要求延时越小越好,因此,为了便于两者有效地结合,采用延时的倒数表示适应度,得到适应度函数如下所示:Set the fitness function for calculating the fitness of the bat in the bat algorithm: in the bat algorithm, the larger the fitness, the better the position of the bat relative to the target, but the search for the optimal delay of the ternary FPRM circuit requires that the smaller the delay, the better the position of the bat relative to the target. Well, therefore, in order to facilitate the effective combination of the two, the inverse of the delay is used to represent the fitness, and the fitness function is obtained as follows:

Figure BDA0001406308150000101
Figure BDA0001406308150000101

其中,符号“/”表示除法运算符;fitnessc表示第c个蝙蝠的适应度大小,c为大于等于1且小于等于m的整数;fitc为第c个蝙蝠位移对应的极性下三值FPRM电路的延时估计数据;

Figure BDA0001406308150000102
表示适应度放大系数,取值为大于等于500的整数;Among them, the symbol "/" represents the division operator; fitness c represents the fitness of the c-th bat, c is an integer greater than or equal to 1 and less than or equal to m; fit c is the lower three polar values corresponding to the displacement of the c-th bat Delay estimation data of FPRM circuit;
Figure BDA0001406308150000102
Indicates the fitness amplification factor, which is an integer greater than or equal to 500;

D.将蝙蝠种群中第c个蝙蝠位移记为xc,d,第c个蝙蝠速度记为vc,d,d表示第c个蝙蝠的搜索空间维数,d∈[1,b],第c个蝙蝠声波响度记为Ac,第c个蝙蝠脉冲速率记为rc,第c个蝙蝠声波频率记为fc,对蝙蝠种群中各个蝙蝠位移、蝙蝠速度、蝙蝠声波响度、蝙蝠脉冲速率和蝙蝠声波频率进行初始化,其中蝙蝠位移初始化为极性取值范围内的任意值,AC初始化为1~2之间的随机数,rc初始化为大于0且小于等于1的随机数,蝙蝠声波频率fc初始化为fmin~fmax之间的随机数,其中,fmin表示蝙蝠声波频率的最小值,取值为100,fmax表示蝙蝠声波频率的最大值,取值为1200,将变量h初始化为1;D. Denote the displacement of the c-th bat in the bat population as x c,d , and the velocity of the c-th bat as v c,d , where d represents the search space dimension of the c-th bat, d∈[1,b], The sound wave loudness of the c-th bat is recorded as A c , the pulse rate of the c -th bat is recorded as rc , and the sound wave frequency of the c-th bat is recorded as f c . The velocity and the frequency of the bat sound wave are initialized, where the bat displacement is initialized to any value within the range of polarity values, A C is initialized to a random number between 1 and 2, and rc is initialized to a random number greater than 0 and less than or equal to 1, The bat sound wave frequency f c is initialized as a random number between f min and f max , where f min represents the minimum value of the bat sound wave frequency, and the value is 100, and f max represents the maximum bat sound wave frequency, and the value is 1200. Initialize the variable h to 1;

E.根据步骤(1)和(2)分别计算蝙蝠群体中每个蝙蝠位移对应的极性下三值FPRM电路的延时估计数据,然后根据延时估计数据计算每个蝙蝠的适应度,将适应度值最大的蝙蝠位移作为蝙蝠种群的当前全局最优位移,如果适应度值最大的蝙蝠位移有多个,则随机选择其中一个适应度值最大的蝙蝠位移作为蝙蝠种群的当前全局最优位移;E. Calculate the delay estimation data of the ternary FPRM circuit under the polarity corresponding to the displacement of each bat in the bat group according to steps (1) and (2), and then calculate the fitness of each bat according to the delay estimation data, and set the The bat displacement with the largest fitness value is used as the current global optimal displacement of the bat population. If there are multiple bat displacements with the largest fitness value, one of the bat displacements with the largest fitness value is randomly selected as the current global optimal displacement of the bat population. ;

F.对蝙蝠群体的蝙蝠位移和蝙蝠速度进行第h轮进化代的首次更新:先采用随机函数生成均匀分布的随机变量α,α∈[0,1],再通过公式(1)更新第h轮进化代的蝙蝠声波频率fc,然后再结合公式(2)和公式(3)更新蝙蝠位移xc,d和蝙蝠速度vc,dF. The first update of the h-th evolutionary generation for the bat displacement and bat velocity of the bat colony: First, use a random function to generate uniformly distributed random variables α, α∈[0,1], and then update the h-th generation through formula (1). The bat sound frequency f c of the round evolutionary generation, and then the bat displacement x c,d and the bat velocity v c,d are updated by combining equations (2) and (3):

fc=fmin+(fmax-fmin)*α (1)f c =f min +(f max -f min )*α (1)

Figure BDA0001406308150000103
Figure BDA0001406308150000103

Figure BDA0001406308150000111
Figure BDA0001406308150000111

其中,

Figure BDA0001406308150000112
表示在第h轮进化代第c个蝙蝠速度的首次更新值,
Figure BDA0001406308150000113
表示在第h轮进化代第c个蝙蝠位移的首次更新值;in,
Figure BDA0001406308150000112
represents the first update value of the cth bat velocity in the hth evolutionary generation,
Figure BDA0001406308150000113
represents the first update value of the displacement of the cth bat in the hth evolutionary generation;

如果h的当前值为1,则

Figure BDA0001406308150000114
为第c个蝙蝠速度的初始值,
Figure BDA0001406308150000115
为第c个蝙蝠位移的初始值,Ph-1为蝙蝠种群的当前全局最优位移的初始值;If the current value of h is 1, then
Figure BDA0001406308150000114
is the initial value of the cth bat speed,
Figure BDA0001406308150000115
is the initial value of the cth bat displacement, and P h-1 is the initial value of the current global optimal displacement of the bat population;

如果h的当前值大于1,则

Figure BDA0001406308150000116
为在第h-1轮进化代第c个蝙蝠速度的更新值,
Figure BDA0001406308150000117
为在第h-1轮进化代第c个蝙蝠位移的更新值,Ph-1为在第h-1轮进化代蝙蝠种群的当前全局最优位置的更新值;If the current value of h is greater than 1, then
Figure BDA0001406308150000116
is the updated value of the cth bat speed in the h-1th evolutionary generation,
Figure BDA0001406308150000117
is the updated value of the displacement of the cth bat in the h-1th evolutionary generation, and P h-1 is the updated value of the current global optimal position of the bat population in the h-1th evolutionary generation;

G.对蝙蝠群体进行再次更新,具体过程为:G. Update the bat colony again, the specific process is:

G-1.用随机函数产生随机数rand1,rand1∈[0,5000];G-1. Use random function to generate random number rand1, rand1∈[0,5000];

G-2.将rand1和第c个蝙蝠脉冲速率rc进行比较,如果rand1小于rc,则该蝙蝠的蝙蝠位移不需再次更新,将第c个蝙蝠速度的首次更新值作为其第h轮进化代的更新值,并返回步骤G-1,开始对下一个蝙蝠位移进行更新,如果rand1大于或等于rc,则将蝙蝠种群的当前全局最优位移对应的适应度值最大的蝙蝠位移加1后作为局部最优蝙蝠位移,记为

Figure BDA0001406308150000118
进入步骤G-3;G-2. Compare rand1 with the pulse rate rc of the cth bat. If rand1 is smaller than rc , the bat displacement of the bat does not need to be updated again, and the first update value of the cth bat speed is taken as its hth round The updated value of the evolutionary generation, and return to step G-1 to start updating the next bat displacement. If rand1 is greater than or equal to rc , add the bat displacement with the largest fitness value corresponding to the current global optimal displacement of the bat population. After 1 as the local optimal bat displacement, denoted as
Figure BDA0001406308150000118
Go to step G-3;

G-3.计算蝙蝠位移

Figure BDA0001406308150000119
对应的适应度值;G-3. Calculate bat displacement
Figure BDA0001406308150000119
the corresponding fitness value;

G-4.用随机函数产生随机数rand2,rand2∈[0,3000];G-4. Use random functions to generate random numbers rand2, rand2∈[0, 3000];

G-5.如果rand2小于或等于Ac,并且蝙蝠位移

Figure BDA00014063081500001110
对应的适应度值大于或等于第c个蝙蝠当前的适应度值,则采用蝙蝠位移
Figure BDA00014063081500001111
再次更新蝙蝠位移xc,d,将第c个蝙蝠速度的再次更新值作为其第h轮进化代的更新值,否则,蝙蝠位移xc,d不进行更新,将其首次更新值作为其第h轮进化代的更新值;G-5. If rand2 is less than or equal to A c and the bat is displaced
Figure BDA00014063081500001110
If the corresponding fitness value is greater than or equal to the current fitness value of the cth bat, the bat displacement is used
Figure BDA00014063081500001111
The bat displacement x c,d is updated again, and the re-updated value of the c-th bat velocity is taken as the updated value of its h-th evolutionary generation. Otherwise, the bat displacement x c, d is not updated, and its first updated value is taken as its first updated value. The updated value of the h-round evolutionary generation;

G-6.按照步骤G-1~G-5的方法完成蝙蝠群体的再次更新,然后重新计算更新后的蝙蝠群体中所有蝙蝠的适应度值,采用适应度值最大的蝙蝠位移去更新蝙蝠种群的当前全局最优位移,如果适应度值最大的蝙蝠位移有多个,则随机选择其中一个适应度值最大的蝙蝠位移去更新蝙蝠种群的当前全局最优位移;G-6. Follow steps G-1 to G-5 to update the bat colony again, then recalculate the fitness values of all bats in the updated bat colony, and use the bat displacement with the largest fitness value to update the bat colony If there are multiple bat displacements with the largest fitness value, one of the bat displacements with the largest fitness value is randomly selected to update the current global optimal displacement of the bat population;

H.通过公式(4)和公式(5)对蝙蝠群体的蝙蝠声波响度和蝙蝠脉冲速率进行第h轮更新:H. The h-th round update of the bat sonic loudness and bat pulse rate of the bat colony is performed by Equation (4) and Equation (5):

Figure BDA0001406308150000121
Figure BDA0001406308150000121

Figure BDA0001406308150000122
Figure BDA0001406308150000122

其中,δ为大于0且小于等于1的任意常数,γ为大于0的常数,exp表示以自然常数e为底的指数函数,

Figure BDA0001406308150000123
表示第c个蝙蝠声波响度在第h轮的更新值,
Figure BDA0001406308150000124
第c个蝙蝠脉冲速率在第h轮的更新值;Among them, δ is an arbitrary constant greater than 0 and less than or equal to 1, γ is a constant greater than 0, exp represents the exponential function with the natural constant e as the base,
Figure BDA0001406308150000123
represents the updated value of the cth bat sound wave loudness in the hth round,
Figure BDA0001406308150000124
The updated value of the cth bat pulse rate in the hth round;

如果h的当前值等于1时,

Figure BDA0001406308150000125
表示第c个蝙蝠声波响度的初始值,
Figure BDA0001406308150000126
表示第c个蝙蝠脉冲速率的初始值;If the current value of h is equal to 1,
Figure BDA0001406308150000125
represents the initial value of the loudness of the cth bat sound,
Figure BDA0001406308150000126
represents the initial value of the cth bat pulse rate;

如果h的当前值大于1时,

Figure BDA0001406308150000127
表示第h-1轮第c个蝙蝠声波响度的更新值,
Figure BDA0001406308150000128
表示第h-1轮第c个蝙蝠脉冲速率的更新值;If the current value of h is greater than 1,
Figure BDA0001406308150000127
represents the updated value of the loudness of the cth bat sound in the h-1th round,
Figure BDA0001406308150000128
Represents the updated value of the cth bat pulse rate in the h-1th round;

I.判断h的当前值是否等于最大进化代数,如果不等于,则采用h的当前值加1后的值更新h的值,并返回步骤F进行下一轮的更新;如果h的当前值等于最大进化代数,则将蝙蝠种群的当前全局最优位移对应的适应度值最大的蝙蝠位移作为延时最优的极性,将该延时最优极性对应的适应度值作为最佳延时。I. Judge whether the current value of h is equal to the maximum evolutionary algebra, if not, then use the current value of h plus 1 to update the value of h, and return to step F for the next round of update; if the current value of h is equal to The maximum evolutionary algebra, the bat displacement with the largest fitness value corresponding to the current global optimal displacement of the bat population is used as the polarity of the optimal delay, and the fitness value corresponding to the optimal polarity of the delay is regarded as the optimal delay .

本实施例中,步骤(2)中得到q极性下三值FPRM电路的延时估计数据的具体过程为:In the present embodiment, the specific process of obtaining the delay estimation data of the ternary FPRM circuit under the q polarity in step (2) is:

a.根据q极性下三值FPRM电路函数展开式,确定q极性下三值FPRM电路中不为0的模3乘项的数量,将不为0的模3乘项数量记为M;a. According to the function expansion of the three-valued FPRM circuit under the q-polarity, determine the number of modulo-3 multipliers that are not 0 in the three-valued FPRM circuit under the q-polarity, and denote the number of modulo-3 multipliers that are not 0 as M;

b.对M个模3乘项的系数进行比较,得到q极性下三值FPRM电路的延时估计数据,具体过程为:b. Compare the coefficients of the M modulo-3 multiplication terms to obtain the delay estimation data of the three-valued FPRM circuit under the q polarity. The specific process is:

当M等于1时,则将这1个模3乘项的系数作为q极性下三值FPRM电路的延时估计数据;When M is equal to 1, the coefficient of the 1 modulo 3 multiplication term is used as the delay estimation data of the three-valued FPRM circuit under the q polarity;

当M等于2时,如果两个系数相等,则选择任意一个系数作为q极性下三值FPRM电路的延时估计数据,如果两个系数不相等,则删除两者中较小的系数,保留两者中较大的系数,并采用两者中较大的系数的值加1后得到的值更新该系数的值,将其更新值作为q极性下三值FPRM电路的延时估计数据;When M is equal to 2, if the two coefficients are equal, select any one of the coefficients as the delay estimation data of the three-valued FPRM circuit under the q polarity. If the two coefficients are not equal, delete the smaller coefficient and keep it. The larger coefficient of the two is used to update the value of the coefficient with the value obtained by adding 1 to the value of the larger coefficient of the two, and the updated value is used as the delay estimation data of the three-value FPRM circuit under the q polarity;

当M大于2时,具体比较过程为:When M is greater than 2, the specific comparison process is:

①随机选择任意两个模3乘项的系数;①Randomly select the coefficients of any two modulo 3 multipliers;

②对两个系数进行比较:如果两者相等,则返回步骤①开始新一轮的选择;如果两者不相等,则删除两者中较小的系数,保留两者中较大的系数,并采用两者中较大的系数的值加1后得到的值更新该系数的值;②Compare the two coefficients: if the two are equal, go back to step ① to start a new round of selection; if the two are not equal, delete the smaller coefficient of the two, keep the larger coefficient of the two, and Update the value of the coefficient with the value obtained by adding 1 to the value of the larger coefficient of the two;

③再从剩余模3乘项的系数中随机选择一个系数,将该系数与上一步骤中保留的较大系数的更新值按照步骤②的方法进行比较;③ Then randomly select a coefficient from the coefficients of the remaining modulo 3 multiplication terms, and compare the coefficient with the updated value of the larger coefficient retained in the previous step according to the method of step ②;

④重复步骤③,直到所有的系数比较完成;④ Repeat step ③ until all coefficient comparisons are completed;

⑤将最后保留的较大系数的更新值作为q极性下三值FPRM电路的延时估计数据;⑤ Use the updated value of the last remaining larger coefficient as the delay estimation data of the three-valued FPRM circuit under the q polarity;

当M大于2时,如果所有的比较过程中两个系数均相等,则选择任意一个系数作为q极性下三值FPRM电路的延时估计数据。When M is greater than 2, if the two coefficients are equal in all comparison processes, any one coefficient is selected as the delay estimation data of the three-valued FPRM circuit under the q polarity.

实验随机选取9个MCNC Benchmark电路,使用本发明的方法与穷举法分别对电路进行测试。测试环境为:Windows 10(64位),3.20GHz英特尔奔腾CPU,4.00GB内存,Dev-C++软件。本发明的方法中,相关参数为:蝙蝠种群数量为100,搜索空间维数为30,种群最大进化代数为3000。实验数据如表1所示,其中,列1、列2分别为测试电路的名称及其输入变量数目;列3、列4分别为穷尽法搜索得到的电路面积和延时数据;列5、列6分别为本发明的方法搜索得到的电路面积和延时数据。根据表1的测试数据可知,采取本发明的方法搜索到的电路面积平均增加26.7%,延时平均降低11.3%。In the experiment, 9 MCNC Benchmark circuits are randomly selected, and the circuits are tested by the method of the present invention and the exhaustive method respectively. The test environment is: Windows 10 (64-bit), 3.20GHz Intel Pentium CPU, 4.00GB memory, Dev-C++ software. In the method of the present invention, the relevant parameters are: the number of bat populations is 100, the dimension of the search space is 30, and the maximum evolutionary generation of the population is 3000. The experimental data are shown in Table 1, among which, column 1 and column 2 are the name of the test circuit and the number of input variables respectively; column 3 and column 4 are the circuit area and delay data obtained by exhaustive search respectively; column 5, column 6 are the circuit area and delay data obtained by the method of the present invention, respectively. According to the test data in Table 1, it can be known that the circuit area searched by the method of the present invention increases by 26.7% on average, and the delay time decreases by 11.3% on average.

表1Table 1

Figure BDA0001406308150000131
Figure BDA0001406308150000131

比较本发明方法(IWBA)与PSO算法及传统的蝙蝠算法(BA算法)对三值FPRM电路延时和面积优化的实验结果如表2所示,其中,列1、列2分别为测试电路的名称及其输入变量数目;列3、列4分别为基于PSO算法优化得到的电路面积和延时数据;列5、列6分别为基于BA算法优化得到的电路面积和延时数据;列7、列8分别为本发明方法优化得到的电路面积和延时数据。The experimental results comparing the method of the present invention (IWBA) with the PSO algorithm and the traditional bat algorithm (BA algorithm) on the delay and area optimization of the ternary FPRM circuit are shown in Table 2. Among them, column 1 and column 2 are respectively the test circuit. Names and the number of input variables; Columns 3 and 4 are the circuit area and delay data optimized based on the PSO algorithm, respectively; Columns 5 and 6 are the circuit area and delay data optimized based on the BA algorithm; Columns 7, Column 8 is the circuit area and delay data obtained by the optimization of the method of the present invention, respectively.

表2Table 2

Figure BDA0001406308150000141
Figure BDA0001406308150000141

对比表2中三种方法的面积和延时优化结果可知,本发明的优化效果明显优于PSO算法和BA算法。其中,本发明的方法相对于PSO算法,平均面积节省73.5%,延时节省16.5%;本发明的方法相对于BA算法,平均面积节省66.0%、延时节省14.3%。Comparing the area and delay optimization results of the three methods in Table 2, it can be seen that the optimization effect of the present invention is obviously better than that of the PSO algorithm and the BA algorithm. Compared with the PSO algorithm, the method of the present invention saves 73.5% of the average area and 16.5% of the delay; compared to the BA algorithm, the method of the present invention saves 66.0% of the average area and 14.3% of the delay.

Claims (2)

1.一种利用蝙蝠算法的三值FPRM电路延时优化方法,其特征在于包括以下步骤:1. a three-valued FPRM circuit delay optimization method utilizing bat algorithm is characterized in that comprising the following steps: (1)将极性为q、含有n个输入变量的三值FPRM电路采用函数展开式表示为:(1) The three-valued FPRM circuit with polarity q and n input variables is expressed as:
Figure FDA0001406308140000011
Figure FDA0001406308140000011
其中,x0,x1,...,xn-1为函数展开式的n个输入变量,q表示三值FPRM电路的极性;
Figure FDA0001406308140000012
为模3加运算符号,“·”为乘运算符号;
Figure FDA0001406308140000013
为模3乘项,ai为模3乘项的系数,i=0,1,2,…,3n-1-1,
Figure FDA0001406308140000014
ij∈{0,1,2},其中
Figure FDA0001406308140000015
j=0,1,…,n-1;
Among them, x 0 , x 1 ,...,x n-1 are the n input variables of the function expansion, and q represents the polarity of the three-valued FPRM circuit;
Figure FDA0001406308140000012
It is a modulo 3 addition symbol, and "·" is a multiplication symbol;
Figure FDA0001406308140000013
is the modulo 3 multiplication term, a i is the coefficient of the modulo 3 multiplication term, i=0, 1, 2, ..., 3 n-1 -1,
Figure FDA0001406308140000014
i j ∈{0,1,2}, where
Figure FDA0001406308140000015
j=0,1,...,n-1;
(2)使用Huffman算法分解q极性下三值FPRM电路函数展开式中不为0的模3乘项的系数,将最后分解得到的系数作为q极性下三值FPRM电路的延时估计数据;(2) Use the Huffman algorithm to decompose the coefficients of the modulo 3 multipliers that are not 0 in the function expansion of the three-valued FPRM circuit under q-polarity, and use the coefficient obtained by the final decomposition as the delay estimation data of the three-valued FPRM circuit under q-polarity ; (3)利用蝙蝠算法对q极性下三值FPRM电路进行延时优化,具体步骤如下:(3) The bat algorithm is used to optimize the delay time of the ternary FPRM circuit under the q polarity. The specific steps are as follows: A.建立蝙蝠算法与q极性下三值FPRM电路延时优化的映射关系:A. Establish the mapping relationship between the bat algorithm and the ternary FPRM circuit delay optimization under q polarity: 蝙蝠算法包含以下几个关键要素:蝙蝠位移、蝙蝠速度、蝙蝠声波频率、蝙蝠声波响度、蝙蝠搜索空间、蝙蝠的适应度、适应度最大的蝙蝠位移和最大适应度值;The bat algorithm includes the following key elements: bat displacement, bat speed, bat sound frequency, bat sound loudness, bat search space, bat fitness, bat displacement with the greatest fitness, and maximum fitness value; 三值FPRM电路延时优化包含以下几个关键要素:极性、极性变换、极性交流、极性突变、极性搜索空间、相应极性的延时、延时最优的极性和最佳延时;The delay optimization of ternary FPRM circuit includes the following key elements: polarity, polarity conversion, polarity exchange, polarity mutation, polarity search space, delay of corresponding polarity, optimal polarity of delay and maximum delay good delay; 将蝙蝠位移表示为极性;将蝙蝠速度表示为极性变换;将蝙蝠声波频率表示为极性交流;将蝙蝠声波响度表示为极性突变;将蝙蝠搜索空间表示为极性搜索空间;将蝙蝠的适应度表示为相应极性的延时;将适应度最大的蝙蝠位移表示为延时最优的极性;将最大适应度值表示为最佳延时;Denote bat displacement as polarity; bat velocity as polarity transformation; bat sonic frequency as polarity exchange; bat sonic loudness as polarity mutation; bat search space as polar search space; The fitness of is expressed as the delay of the corresponding polarity; the bat displacement with the largest fitness is expressed as the polarity with the optimal delay; the maximum fitness value is expressed as the best delay; B.设置蝙蝠算法的相关参数:B. Set the relevant parameters of the bat algorithm: 将蝙蝠种群数量记为m,m为大于等于40的整数,蝙蝠搜索空间维数记为b,b为大于等于30的整数,蝙蝠种群进化的最大进化代数记为N,N为大于等于3000的整数,设定蝙蝠群体的当前进化代数为变量h;Denote the number of bat populations as m, m is an integer greater than or equal to 40, the bat search space dimension is denoted as b, b is an integer greater than or equal to 30, and the maximum evolutionary generation of bat population evolution is denoted as N, where N is greater than or equal to 3000 Integer, set the current evolutionary generation of the bat population as the variable h; C.设定蝙蝠算法中用于计算蝙蝠的适应度的适应度函数:C. Set the fitness function used to calculate the fitness of bats in the bat algorithm: 设定蝙蝠算法中计算蝙蝠的适应度的适应度函数:在蝙蝠算法中,适应度越大表示蝙蝠相对于目标的位置越好,但是搜索三值FPRM电路最佳延时要求延时越小越好,因此,为了便于两者有效地结合,采用延时的倒数表示适应度,得到适应度函数如下所示:Set the fitness function for calculating the fitness of the bat in the bat algorithm: in the bat algorithm, the larger the fitness, the better the position of the bat relative to the target, but the search for the optimal delay of the ternary FPRM circuit requires that the smaller the delay, the better the position of the bat relative to the target. Well, therefore, in order to facilitate the effective combination of the two, the inverse of the delay is used to represent the fitness, and the fitness function is obtained as follows:
Figure FDA0001406308140000021
Figure FDA0001406308140000021
其中,符号“/”表示除法运算符;fitnessc表示第c个蝙蝠的适应度大小,c为大于等于1且小于等于m的整数;fitc为第c个蝙蝠位移对应的极性下三值FPRM电路的延时估计数据;
Figure FDA0001406308140000022
表示适应度放大系数,取值为大于等于500的整数;
Among them, the symbol "/" represents the division operator; fitness c represents the fitness of the c-th bat, c is an integer greater than or equal to 1 and less than or equal to m; fit c is the lower three polar values corresponding to the displacement of the c-th bat Delay estimation data of FPRM circuit;
Figure FDA0001406308140000022
Indicates the fitness amplification factor, which is an integer greater than or equal to 500;
D.将蝙蝠种群中第c个蝙蝠位移记为xc,d,第c个蝙蝠速度记为vc,d,d表示第c个蝙蝠的搜索空间维数,d∈[1,b],第c个蝙蝠声波响度记为Ac,第c个蝙蝠脉冲速率记为rc,第c个蝙蝠声波频率记为fc,对蝙蝠种群中各个蝙蝠位移、蝙蝠速度、蝙蝠声波响度、蝙蝠脉冲速率和蝙蝠声波频率进行初始化,其中蝙蝠位移初始化为极性取值范围内的任意值,AC初始化为1~2之间的随机数,rc初始化为大于0且小于等于1的随机数,蝙蝠声波频率fc初始化为fmin~fmax之间的随机数,其中,fmin表示蝙蝠声波频率的最小值,取值为100,fmax表示蝙蝠声波频率的最大值,取值为1200,将变量h初始化为1;D. Denote the displacement of the c-th bat in the bat population as x c,d , and the velocity of the c-th bat as v c,d , where d represents the search space dimension of the c-th bat, d∈[1,b], The sound wave loudness of the c-th bat is recorded as A c , the pulse rate of the c -th bat is recorded as rc , and the sound wave frequency of the c-th bat is recorded as f c . The velocity and the frequency of the bat sound wave are initialized, where the bat displacement is initialized to any value within the range of polarity values, A C is initialized to a random number between 1 and 2, and rc is initialized to a random number greater than 0 and less than or equal to 1, The bat sound wave frequency f c is initialized as a random number between f min and f max , where f min represents the minimum value of the bat sound wave frequency, and the value is 100, and f max represents the maximum bat sound wave frequency, and the value is 1200. Initialize the variable h to 1; E.根据步骤(1)和(2)分别计算蝙蝠群体中每个蝙蝠位移对应的极性下三值FPRM电路的延时估计数据,然后根据延时估计数据计算每个蝙蝠的适应度,将适应度值最大的蝙蝠位移作为蝙蝠种群的当前全局最优位移,如果适应度值最大的蝙蝠位移有多个,则随机选择其中一个适应度值最大的蝙蝠位移作为蝙蝠种群的当前全局最优位移;E. Calculate the delay estimation data of the ternary FPRM circuit under the polarity corresponding to the displacement of each bat in the bat group according to steps (1) and (2), and then calculate the fitness of each bat according to the delay estimation data, and set the The bat displacement with the largest fitness value is used as the current global optimal displacement of the bat population. If there are multiple bat displacements with the largest fitness value, one of the bat displacements with the largest fitness value is randomly selected as the current global optimal displacement of the bat population. ; F.对蝙蝠群体的蝙蝠位移和蝙蝠速度进行第h轮进化代的首次更新:先采用随机函数生成均匀分布的随机变量α,α∈[0,1],再通过公式(1)更新第h轮进化代的蝙蝠声波频率fc,然后再结合公式(2)和公式(3)更新蝙蝠位移xc,d和蝙蝠速度vc,dF. The first update of the h-th evolutionary generation for the bat displacement and bat velocity of the bat colony: First, use a random function to generate uniformly distributed random variables α, α∈[0,1], and then update the h-th generation through formula (1). The bat sound frequency f c of the round evolutionary generation, and then the bat displacement x c,d and the bat velocity v c,d are updated by combining equations (2) and (3): fc=fmin+(fmax-fmin)*α (1)f c =f min +(f max -f min )*α (1)
Figure FDA0001406308140000023
Figure FDA0001406308140000023
Figure FDA0001406308140000024
Figure FDA0001406308140000024
其中,
Figure FDA0001406308140000025
表示在第h轮进化代第c个蝙蝠速度的首次更新值,
Figure FDA0001406308140000026
表示在第h轮进化代第c个蝙蝠位移的首次更新值;
in,
Figure FDA0001406308140000025
represents the first update value of the cth bat velocity in the hth evolutionary generation,
Figure FDA0001406308140000026
represents the first update value of the displacement of the cth bat in the hth evolutionary generation;
如果h的当前值为1,则
Figure FDA0001406308140000031
为第c个蝙蝠速度的初始值,
Figure FDA0001406308140000032
为第c个蝙蝠位移的初始值,Ph-1为蝙蝠种群的当前全局最优位移的初始值;
If the current value of h is 1, then
Figure FDA0001406308140000031
is the initial value of the cth bat speed,
Figure FDA0001406308140000032
is the initial value of the cth bat displacement, and P h-1 is the initial value of the current global optimal displacement of the bat population;
如果h的当前值大于1,则
Figure FDA0001406308140000033
为在第h-1轮进化代第c个蝙蝠速度的更新值,
Figure FDA0001406308140000034
为在第h-1轮进化代第c个蝙蝠位移的更新值,Ph-1为在第h-1轮进化代蝙蝠种群的当前全局最优位置的更新值;
If the current value of h is greater than 1, then
Figure FDA0001406308140000033
is the updated value of the cth bat speed in the h-1th evolutionary generation,
Figure FDA0001406308140000034
is the updated value of the displacement of the cth bat in the h-1th evolutionary generation, and P h-1 is the updated value of the current global optimal position of the bat population in the h-1th evolutionary generation;
G.对蝙蝠群体进行再次更新,具体过程为:G. Update the bat colony again, the specific process is: G-1.用随机函数产生随机数rand1,rand1∈[0,5000];G-1. Use random function to generate random number rand1, rand1∈[0,5000]; G-2.将rand1和第c个蝙蝠脉冲速率rc进行比较,如果rand1小于rc,则该蝙蝠的蝙蝠位移不需再次更新,将第c个蝙蝠速度的首次更新值作为其第h轮进化代的更新值,并返回步骤G-1,开始对下一个蝙蝠位移进行更新,如果rand1大于或等于rc,则将蝙蝠种群的当前全局最优位移对应的适应度值最大的蝙蝠位移加1后作为局部最优蝙蝠位移,记为
Figure FDA0001406308140000035
进入步骤G-3;
G-2. Compare rand1 with the pulse rate rc of the cth bat. If rand1 is smaller than rc , the bat displacement of the bat does not need to be updated again, and the first update value of the cth bat speed is taken as its hth round The updated value of the evolutionary generation, and return to step G-1 to start updating the next bat displacement. If rand1 is greater than or equal to rc , add the bat displacement with the largest fitness value corresponding to the current global optimal displacement of the bat population. After 1 as the local optimal bat displacement, denoted as
Figure FDA0001406308140000035
Go to step G-3;
G-3.计算蝙蝠位移
Figure FDA0001406308140000036
对应的适应度值;
G-3. Calculate bat displacement
Figure FDA0001406308140000036
the corresponding fitness value;
G-4.用随机函数产生随机数rand2,rand2∈[0,3000];G-4. Use random functions to generate random numbers rand2, rand2∈[0, 3000]; G-5.如果rand2小于或等于Ac,并且蝙蝠位移
Figure FDA0001406308140000037
对应的适应度值大于或等于第c个蝙蝠当前的适应度值,则采用蝙蝠位移
Figure FDA0001406308140000038
再次更新蝙蝠位移xc,d,将第c个蝙蝠速度的再次更新值作为其第h轮进化代的更新值,否则,蝙蝠位移xc,d不进行更新,将其首次更新值作为其第h轮进化代的更新值;
G-5. If rand2 is less than or equal to A c and the bat is displaced
Figure FDA0001406308140000037
If the corresponding fitness value is greater than or equal to the current fitness value of the cth bat, the bat displacement is used
Figure FDA0001406308140000038
The bat displacement x c,d is updated again, and the re-updated value of the c-th bat velocity is taken as the updated value of its h-th evolutionary generation. Otherwise, the bat displacement x c, d is not updated, and its first updated value is taken as its first updated value. The updated value of the h-round evolutionary generation;
G-6.按照步骤G-1~G-5的方法完成蝙蝠群体的再次更新,然后重新计算更新后的蝙蝠群体中所有蝙蝠的适应度值,采用适应度值最大的蝙蝠位移去更新蝙蝠种群的当前全局最优位移,如果适应度值最大的蝙蝠位移有多个,则随机选择其中一个适应度值最大的蝙蝠位移去更新蝙蝠种群的当前全局最优位移;G-6. Follow steps G-1 to G-5 to update the bat colony again, then recalculate the fitness values of all bats in the updated bat colony, and use the bat displacement with the largest fitness value to update the bat colony If there are multiple bat displacements with the largest fitness value, one of the bat displacements with the largest fitness value is randomly selected to update the current global optimal displacement of the bat population; H.通过公式(4)和公式(5)对蝙蝠群体的蝙蝠声波响度和蝙蝠脉冲速率进行第h轮更新:H. The h-th round update of the bat sonic loudness and bat pulse rate of the bat colony is performed by Equation (4) and Equation (5):
Figure FDA0001406308140000039
Figure FDA0001406308140000039
Figure FDA0001406308140000041
Figure FDA0001406308140000041
其中,δ为大于0且小于等于1的任意常数,γ为大于0的常数,exp表示以自然常数e为底的指数函数,
Figure FDA0001406308140000042
表示第c个蝙蝠声波响度在第h轮的更新值,
Figure FDA0001406308140000043
第c个蝙蝠脉冲速率在第h轮的更新值;
Among them, δ is an arbitrary constant greater than 0 and less than or equal to 1, γ is a constant greater than 0, exp represents the exponential function with the natural constant e as the base,
Figure FDA0001406308140000042
represents the updated value of the cth bat sound wave loudness in the hth round,
Figure FDA0001406308140000043
The updated value of the cth bat pulse rate in the hth round;
如果h的当前值等于1时,
Figure FDA0001406308140000044
表示第c个蝙蝠声波响度的初始值,
Figure FDA0001406308140000045
表示第c个蝙蝠脉冲速率的初始值;
If the current value of h is equal to 1,
Figure FDA0001406308140000044
represents the initial value of the loudness of the cth bat sound,
Figure FDA0001406308140000045
represents the initial value of the cth bat pulse rate;
如果h的当前值大于1时,
Figure FDA0001406308140000046
表示第h-1轮第c个蝙蝠声波响度的更新值,
Figure FDA0001406308140000047
表示第h-1轮第c个蝙蝠脉冲速率的更新值;
If the current value of h is greater than 1,
Figure FDA0001406308140000046
represents the updated value of the loudness of the cth bat sound in the h-1th round,
Figure FDA0001406308140000047
Represents the updated value of the cth bat pulse rate in the h-1th round;
I.判断h的当前值是否等于最大进化代数,如果不等于,则采用h的当前值加1后的值更新h的值,并返回步骤F进行下一轮的更新;如果h的当前值等于最大进化代数,则将蝙蝠种群的当前全局最优位移对应的适应度值最大的蝙蝠位移作为延时最优的极性,将该延时最优极性对应的适应度值作为最佳延时。I. Judge whether the current value of h is equal to the maximum evolutionary algebra, if not, then use the current value of h plus 1 to update the value of h, and return to step F for the next round of update; if the current value of h is equal to The maximum evolutionary algebra, the bat displacement with the largest fitness value corresponding to the current global optimal displacement of the bat population is used as the polarity of the optimal delay, and the fitness value corresponding to the optimal polarity of the delay is regarded as the optimal delay .
2.根据权利要求1所述的一种利用蝙蝠算法的三值FPRM电路延时优化方法,其特征在于所述的步骤(2)中得到q极性下三值FPRM电路的延时估计数据的具体过程为:2. a kind of ternary FPRM circuit delay optimization method utilizing bat algorithm according to claim 1, it is characterized in that in described step (2), obtain the time delay estimation data of tertiary FPRM circuit under q polarity The specific process is: a.根据q极性下三值FPRM电路函数展开式,确定q极性下三值FPRM电路中不为0的模3乘项的数量,将不为0的模3乘项数量记为M;a. According to the function expansion of the three-valued FPRM circuit under the q-polarity, determine the number of modulo-3 multipliers that are not 0 in the three-valued FPRM circuit under the q-polarity, and denote the number of modulo-3 multipliers that are not 0 as M; b.对M个模3乘项的系数进行比较,得到q极性下三值FPRM电路的延时估计数据,具体过程为:b. Compare the coefficients of the M modulo-3 multiplication terms to obtain the delay estimation data of the three-valued FPRM circuit under the q polarity. The specific process is: 当M等于1时,则将这1个模3乘项的系数作为q极性下三值FPRM电路的延时估计数据;When M is equal to 1, the coefficient of the 1 modulo 3 multiplication term is used as the delay estimation data of the three-valued FPRM circuit under the q polarity; 当M等于2时,如果两个系数相等,则选择任意一个系数作为q极性下三值FPRM电路的延时估计数据,如果两个系数不相等,则删除两者中较小的系数,保留两者中较大的系数,并采用两者中较大的系数的值加1后得到的值更新该系数的值,将其更新值作为q极性下三值FPRM电路的延时估计数据;When M is equal to 2, if the two coefficients are equal, select any one of the coefficients as the delay estimation data of the three-valued FPRM circuit under the q polarity. If the two coefficients are not equal, delete the smaller coefficient and keep it. The larger coefficient of the two is used to update the value of the coefficient with the value obtained by adding 1 to the value of the larger coefficient of the two, and the updated value is used as the delay estimation data of the three-value FPRM circuit under the q polarity; 当M大于2时,具体比较过程为:When M is greater than 2, the specific comparison process is: ①随机选择任意两个模3乘项的系数;①Randomly select the coefficients of any two modulo 3 multipliers; ②对两个系数进行比较:如果两者相等,则返回步骤①开始新一轮的选择;如果两者不相等,则删除两者中较小的系数,保留两者中较大的系数,并采用两者中较大的系数的值加1后得到的值更新该系数的值;②Compare the two coefficients: if the two are equal, go back to step ① to start a new round of selection; if the two are not equal, delete the smaller coefficient of the two, keep the larger coefficient of the two, and Update the value of the coefficient with the value obtained by adding 1 to the value of the larger coefficient of the two; ③再从剩余模3乘项的系数中随机选择一个系数,将该系数与上一步骤中保留的较大系数的更新值按照步骤②的方法进行比较;③ Then randomly select a coefficient from the coefficients of the remaining modulo 3 multiplication terms, and compare the coefficient with the updated value of the larger coefficient retained in the previous step according to the method of step ②; ④重复步骤③,直到所有的系数比较完成;④ Repeat step ③ until all coefficient comparisons are completed; ⑤将最后保留的较大系数的更新值作为q极性下三值FPRM电路的延时估计数据。⑤ Take the updated value of the larger coefficient retained at the end as the delay estimation data of the three-valued FPRM circuit under the q polarity.
CN201710820964.4A 2017-09-13 2017-09-13 A Delay Optimization Method for Ternary FPRM Circuit Using Bat Algorithm Active CN107748912B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710820964.4A CN107748912B (en) 2017-09-13 2017-09-13 A Delay Optimization Method for Ternary FPRM Circuit Using Bat Algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710820964.4A CN107748912B (en) 2017-09-13 2017-09-13 A Delay Optimization Method for Ternary FPRM Circuit Using Bat Algorithm

Publications (2)

Publication Number Publication Date
CN107748912A CN107748912A (en) 2018-03-02
CN107748912B true CN107748912B (en) 2020-11-27

Family

ID=61254945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710820964.4A Active CN107748912B (en) 2017-09-13 2017-09-13 A Delay Optimization Method for Ternary FPRM Circuit Using Bat Algorithm

Country Status (1)

Country Link
CN (1) CN107748912B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102592013A (en) * 2011-12-31 2012-07-18 宁波大学 Optimization method for time delay and area of fixed-polarity Reed-Muller circuit
US8581768B1 (en) * 2011-06-27 2013-11-12 Syntropy Systems, Llc Linear to discrete quantization conversion with reduced sampling variation errors
CN105306075A (en) * 2015-08-27 2016-02-03 宁波大学 Best polarity search method for power consumption of three-value FPRM circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8581768B1 (en) * 2011-06-27 2013-11-12 Syntropy Systems, Llc Linear to discrete quantization conversion with reduced sampling variation errors
CN102592013A (en) * 2011-12-31 2012-07-18 宁波大学 Optimization method for time delay and area of fixed-polarity Reed-Muller circuit
CN105306075A (en) * 2015-08-27 2016-02-03 宁波大学 Best polarity search method for power consumption of three-value FPRM circuit

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A new metaheuristic bat-inspired algorithm;YANG X S et al.;《Computer Knowledge&Technology》;20101231;第65-74页 *
基于SMPSO算法的三值FPRM电路延时优化;汪涛 等;《宁波大学学报(理工版)》;20170331;第30卷(第2期);第60-65页 *
基于XOR/AND逻辑的三值FPRM电路最佳延时极性搜索;汪涛 等;《科技通报》;20170131;第33卷(第1期);第71-75页 *

Also Published As

Publication number Publication date
CN107748912A (en) 2018-03-02

Similar Documents

Publication Publication Date Title
Wang et al. A study of the residue-to-binary converters for the three-moduli sets
CN104270247B (en) Suitable for the efficient general Hash functions authentication method of quantum cryptography system
Murugesh et al. Modified high speed 32-bit vedic multiplier design and implementation
CN103888391B (en) Signal blind detection method based on double Sigmoid chaotic neural network
CN110620633A (en) Method and device for generating aperiodic four-phase Z complementary sequence pair signal
WO2017049790A1 (en) Online/offline signature system and method based on multivariate cryptography
CN106685745A (en) Method and device for constructing network topology
CN105162494B (en) It is a kind of based on RS yards generation frequency hop sequences model reconstruction method
CN111835671B (en) A kind of method and device for generating four-phase Z-complementary sequence pair with low PMEPR
CN107748912B (en) A Delay Optimization Method for Ternary FPRM Circuit Using Bat Algorithm
CN103701591A (en) Sequence password realization method and key stream generating method and device
CN106293615B (en) True Random Number Generator based on fully connected network
CN107220463A (en) One kind mixing polarity XNOR/OR circuit area optimization methods
CN105138742B (en) A kind of two-value FPRM circuit area optimum polarity search methods
CN104881267B (en) A kind of Nakagami m based on the method for weighting decline generation of random series method again
Lin et al. A 690fJ/Bit ML-Attack-Resilient Strong PUF Based on Subthreshold Voltage Attenuator Ring with Closed-Loop Feedback
Yi et al. An h-p Petrov-Galerkin finite element method for linear Volterra integro-differential equations
Van Keilegom et al. Density and hazard estimation in censored regression models
Hernandez et al. The three/two Gaussian parametric LDLC lattice decoding algorithm and its analysis
CN110166060B (en) High-throughput pipeline type polarization code BP decoder and implementation method thereof
CN111262642A (en) Method and device for generating two-type binary non-periodic Z complementary sequence pair signal by interpolation
Liao et al. Real-time multi-user detection engine design for IoT applications via modified sparsity adaptive matching pursuit
CN107679326B (en) A comprehensive optimization method for area and delay of binary FPRM circuit
CN115984025A (en) Influence propagation estimation method and system based on deep learning graph network model
US20060100830A1 (en) Moment computations of nonuniform distributed coupled RLC trees with applications to estimating crosstalk noise

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
GR01 Patent grant
GR01 Patent grant