CN107748912B - Three-value FPRM circuit delay optimization method utilizing bat algorithm - Google Patents
Three-value FPRM circuit delay optimization method utilizing bat algorithm Download PDFInfo
- 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
- displacement
- polarity
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial 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]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/30—Circuit design
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
Technical Field
The invention relates to a three-value FPRM circuit delay optimization method, in particular to a three-value FPRM circuit delay optimization method utilizing a bat algorithm.
Background
The n input variables of the three-valued FPRM circuit correspond to 3nThe logic function expressions with different polarities have different complexity degrees, so that the search for the optimal polarity of the ternary FPRM circuit becomes the key for optimizing the delay of the ternary FPRM circuit. Generally, a medium-small scale three-value FPRM circuit can determine the optimal polarity of the circuit by traversing all polarities through an exhaustive algorithm, however, for a large-scale three-value FPRM circuit, the polarity search space is exponentially increased along with the continuous increase of an input variable n, and the optimal delay cannot be obtained by traversing all polarities through the exhaustive search within a certain time range.
The Bat-interpolated Algorithm (BA) is a group of intelligent search algorithms proposed by the english scholars YANG and the like according to the echo positioning capability of bats, and targets are positioned mainly according to the fact that bats continuously adjust loudness and frequency of pulses sent out by the bats when catching food in flight or encountering obstacles. The bat algorithm simulates each solution in the search space into one bat, and simultaneously sets a fitness value for all bats, so that each bat adjusts loudness and frequency according to the current optimal bat in an iterative process, and the search efficiency is high.
Therefore, the design of the ternary FPRM circuit delay optimization method utilizing the bat algorithm, which has higher search efficiency on the basis of ensuring the optimization precision, has important significance.
Disclosure of Invention
The invention aims to solve the technical problem of providing a three-value FPRM circuit delay optimization method which has higher search efficiency and utilizes a bat algorithm on the basis of ensuring the optimization precision.
The technical scheme adopted by the invention for solving the technical problems is as follows: a three-value FPRM circuit delay optimization method utilizing a bat algorithm comprises the following steps:
(1) a ternary FPRM circuit with the polarity of q and n input variables is expressed by adopting a function expansion formula as follows:
wherein x is0,x1,...,xn-1Q represents the polarity of the ternary FPRM circuit for n input variables of the function expansion; ∑ is modulo 3 plus the operation sign, "·" is the multiplication sign;is a modulo 3 multiplication term, aiIs a coefficient of modulo 3 multiplication, i being 0,1,2, …, 3n-1-1,Wherein
(2) Decomposing the coefficient of a modulo 3 multiplication term which is not 0 in the function expansion of the ternary FPRM circuit under the q polarity by using a Huffman algorithm, and taking the finally decomposed coefficient as delay estimation data of the ternary FPRM circuit under the q polarity;
(3) the method comprises the following steps of utilizing a bat algorithm to carry out delay optimization on a three-value FPRM circuit under the q polarity:
A. establishing a mapping relation between a bat algorithm and a three-value FPRM circuit delay optimization under the q polarity:
the bat algorithm contains several key elements: bat displacement, bat speed, bat sound wave frequency, bat sound wave loudness, bat search space, bat fitness, maximum bat displacement and maximum fitness value;
the delay optimization of the ternary FPRM circuit comprises the following key elements: polarity, polarity conversion, polarity alternating current, polarity mutation, polarity search space, corresponding polarity delay, optimal polarity and optimal delay;
expressing the bat displacement as a polarity; representing the bat velocity as a polarity reversal; representing the bat acoustic wave frequency as a polar alternating current; expressing the loudness of the bat sound wave as a polarity mutation; representing the bat search space as a polar search space; representing the fitness of the bat as the time delay of the corresponding polarity; representing the bat displacement with the maximum fitness as the polarity with optimal delay; expressing the maximum fitness value as the optimal delay;
B. setting relevant parameters of the bat algorithm:
recording the bat population number as m, wherein m is an integer larger than or equal to 40, recording the bat search space dimension as b, wherein b is an integer larger than or equal to 30, recording the maximum evolution algebra of bat population evolution as N, wherein N is an integer larger than or equal to 3000, and setting the current evolution algebra of the bat population as a variable h;
C. setting a fitness function used for calculating the fitness of the bat in the bat algorithm:
setting a fitness function for calculating the fitness of the bat in a bat algorithm: in the bat algorithm, the higher the fitness is, the better the bat is located relative to the target, but the lower the delay required for searching the optimal delay of the three-value FPRM circuit is, the better, therefore, in order to combine the two effectively, the fitness is expressed by adopting the reciprocal of the delay, and the fitness function is obtained as follows:
wherein the symbol "/" represents a division operator; fitnesscRepresenting the fitness of the c-th bat, wherein c is an integer which is more than or equal to 1 and less than or equal to m; fitcDelay estimation data of a polarity lower three-value FPRM circuit corresponding to the c-th bat displacement;representing a fitness amplification coefficient, and taking the value of an integer greater than or equal to 500;
D. recording the c-th bat displacement in the bat population as xc,dThe c th bat velocity is denoted as vc,dD represents the search space dimension of the c-th bat, d ∈ [1, b ]]The c th batsound wave loudness is marked as AcThe c th bat pulse rate is recorded as rcThe frequency of the c-th bat sound wave is recorded as fcInitializing the displacement, speed, loudness, pulse rate and frequency of the bat sound wave in the bat population, wherein the bat displacement is initialized to any value within a range of polarity values, ACInitialization is random number r between 1 and2cInitialized to random number more than 0 and less than or equal to 1, bat sound wave frequency fcInitialisation to fmin~fmaxA random number in between, wherein fminThe minimum value of the bat sound wave frequency is represented and is 100, fmaxThe maximum value of the bat sound wave frequency is represented, the value is 1200, and the variable h is initialized to 1;
E. respectively calculating delay estimation data of a polarity lower three-value FPRM circuit corresponding to each bat displacement in a bat group according to the steps (1) and (2), then calculating the fitness of each bat according to the delay estimation data, taking the bat displacement with the maximum fitness value as the current global optimal displacement of the bat group, and if a plurality of bat displacements with the maximum fitness values exist, randomly selecting one bat displacement with the maximum fitness value as the current global optimal displacement of the bat group;
F. the first update of the h-th round of evolutionary generations is carried out on the bat displacement and the bat speed of the bat group: firstly, a random function is adopted to generate uniformly distributed random variables alpha, and alpha belongs to [0,1 ]]Then updating the bat sound wave frequency f of the h-th round of evolution through the formula (1)cThen updating the bat displacement x by combining the formula (2) and the formula (3)c,dAnd bat velocity vc,d:
fc=fmin+(fmax-fmin)*α (1)
Wherein the content of the first and second substances,represents the first updated value of the c-th bat speed at the h-th generation,a first updated value representing the c-th bat displacement at the h-th generation;
if the current value of h is 1, thenIs the initial value of the c-th bat speed,is the initial value of the c-th bat displacement, Ph-1Is the initial value of the current global optimal displacement of the bat population;
if the current value of h is greater than 1, thenFor the updated value of the c-th bat speed in the h-1 th round of evolution,is an updated value of the c-th bat displacement, P, in the h-1 th round of evolutionh-1An updated value of the current global optimal position of the bat population in the h-1 th round of evolution;
G. the bat group is updated again, and the specific process is as follows:
g-1, generating a random number rand1 by using a random function, wherein rand1 belongs to [0,5000 ];
g-2, will rand1 and the c th bat pulse rate rcMaking a comparison if rand1 is less than rcIf the bat displacement of the bat does not need to be updated again, the first updated value of the c-th bat speed is taken as the updated value of the h-th generation, and the step G-1 is returned to, the next bat displacement is updated, if rand1 is greater than or equal to rcAdding 1 to the bat displacement with the maximum fitness value corresponding to the current global optimal displacement of the bat population to obtain a local optimal bat displacement, and recording the local optimal bat displacement as the local optimal bat displacementEntering the step G-3;
g-4, generating a random number rand2 by using a random function, wherein rand2 belongs to [0, 3000 ];
g-5 if rand2 is less than or equal to AcAnd bat displacementIf the corresponding fitness value is greater than or equal to the current fitness value of the c-th bat, the bat displacement is adoptedUpdating the bat displacement x againc,dTaking the re-updated value of the c-th bat speed as the updated value of the h-th generation, otherwise, the bat displacement xc,dNot updating, and taking the first updated value as the updated value of the h-th evolutionary generation;
g-6, completing the re-updating of the bat populations according to the methods of the steps G-1 to G-5, then recalculating the fitness values of all the bats in the updated bat populations, removing the current global optimal displacement of the updated bat populations by adopting the bat positions with the maximum fitness values, and if a plurality of bat displacements with the maximum fitness values exist, randomly selecting one of the bat positions with the maximum fitness values to remove the current global optimal displacement of the updated bat populations;
H. performing h-th round update on the bat sound wave loudness and the bat pulse rate of the bat population through formula (4) and formula (5):
wherein, the constant is any constant which is more than 0 and less than or equal to 1, gamma is a constant which is more than 0, exp represents an exponential function with a natural constant e as a base,represents the updated value of the c-th batsound wave loudness at the h-th round,the updated value of the c-th bat pulse rate at the h-th round;
if the current value of h is equal to 1,represents the initial value of the c-th batsound wave loudness,an initial value representing a c-th bat pulse rate;
if the current value of h is greater than 1,represents an updated value of the loudness of the c-th bat sound wave of the h-1 th round,an updated value representing the mth bat pulse rate of the h-1 th round;
I. judging whether the current value of h is equal to the maximum evolution algebra, if not, updating the value of h by adding 1 to the current value of h, and returning to the step F to update the next round; and if the current value of h is equal to the maximum evolution algebra, taking the bat displacement with the maximum fitness value corresponding to the current global optimal displacement of the bat population as the optimal polarity of the delay, and taking the fitness value corresponding to the optimal polarity of the delay as the optimal delay.
The specific process of obtaining the delay estimation data of the three-valued FPRM circuit under the q polarity in the step (2) is as follows:
a. determining the number of modulo-3 multiplication terms which are not 0 in the ternary FPRM circuit under the q polarity according to the function expansion of the ternary FPRM circuit under the q polarity, and recording the number of the modulo-3 multiplication terms which are not 0 as M;
b. comparing the M coefficients of the modulo 3 multiplication terms to obtain delay estimation data of a three-value FPRM circuit under q polarity, and the specific process is as follows:
when M is equal to 1, taking the coefficient of the 1 modulo 3 multiplication term as delay estimation data of the three-value FPRM circuit under the q polarity;
when M is equal to 2, if the two coefficients are equal, selecting any one coefficient as delay estimation data of the three-value FPRM circuit under the q polarity, if the two coefficients are not equal, deleting the smaller coefficient of the two coefficients, keeping the larger coefficient of the two coefficients, updating the value of the coefficient by adopting the value obtained by adding 1 to the value of the larger coefficient of the two coefficients, and using the updated value as the delay estimation data of the three-value FPRM circuit under the q polarity;
when M is larger than 2, the specific comparison process is as follows:
randomly selecting any two coefficients of the modulo 3 multiplication term;
comparing the two coefficients: if the two are equal, returning to the step (i) to start a new round of selection; if the two are not equal, deleting the smaller coefficient of the two, keeping the larger coefficient of the two, and updating the value of the coefficient by adopting the value obtained by adding 1 to the value of the larger coefficient of the two;
randomly selecting a coefficient from the coefficients of the remaining modulo 3 multiplication items, and comparing the coefficient with the update value of the larger coefficient reserved in the previous step according to the method of the second step;
fourthly, repeating the step III until all the coefficients are compared;
using the last reserved updating value with a larger coefficient as the delay estimation data of the three-value FPRM circuit under the q polarity;
compared with the prior art, the method has the advantages that the large-scale ternary FPRM circuit time-delay polarity search result is optimized by applying the population search capability of the bat algorithm, the bat continuously updates the speed and displacement of the bat in the population evolution iteration process, and meanwhile, the updating change of the bat sound wave loudness and the bat pulse rate is accompanied, and the method has higher search efficiency on the basis of ensuring the optimization precision.
Detailed Description
The present invention will be described in further detail with reference to examples.
The first embodiment is as follows: a three-value FPRM circuit delay optimization method utilizing a bat algorithm comprises the following steps:
(1) a ternary FPRM circuit with the polarity of q and n input variables is expressed by adopting a function expansion formula as follows:
wherein x is0,x1,...,xn-1Q represents the polarity of the ternary FPRM circuit for n input variables of the function expansion; ∑ is modulo 3 plus the operation sign, "·" is the multiplication sign;is a modulo 3 multiplication term, aiIs a coefficient of modulo 3 multiplication, i being 0,1,2, …, 3n-1-1,Wherein
(2) Decomposing the coefficient of a modulo 3 multiplication term which is not 0 in the function expansion of the ternary FPRM circuit under the q polarity by using a Huffman algorithm, and taking the finally decomposed coefficient as delay estimation data of the ternary FPRM circuit under the q polarity;
(3) the method comprises the following steps of utilizing a bat algorithm to carry out delay optimization on a three-value FPRM circuit under the q polarity:
A. establishing a mapping relation between a bat algorithm and a three-value FPRM circuit delay optimization under the q polarity:
the bat algorithm contains several key elements: bat displacement, bat speed, bat sound wave frequency, bat sound wave loudness, bat search space, bat fitness, maximum bat displacement and maximum fitness value;
the delay optimization of the ternary FPRM circuit comprises the following key elements: polarity, polarity conversion, polarity alternating current, polarity mutation, polarity search space, corresponding polarity delay, optimal polarity and optimal delay;
expressing the bat displacement as a polarity; representing the bat velocity as a polarity reversal; representing the bat acoustic wave frequency as a polar alternating current; expressing the loudness of the bat sound wave as a polarity mutation; representing the bat search space as a polar search space; representing the fitness of the bat as the time delay of the corresponding polarity; representing the bat displacement with the maximum fitness as the polarity with optimal delay; expressing the maximum fitness value as the optimal delay;
B. setting relevant parameters of the bat algorithm:
recording the bat population number as m, wherein m is an integer larger than or equal to 40, recording the bat search space dimension as b, wherein b is an integer larger than or equal to 30, recording the maximum evolution algebra of bat population evolution as N, wherein N is an integer larger than or equal to 3000, and setting the current evolution algebra of the bat population as a variable h;
C. setting a fitness function used for calculating the fitness of the bat in the bat algorithm:
setting a fitness function for calculating the fitness of the bat in a bat algorithm: in the bat algorithm, the higher the fitness is, the better the bat is located relative to the target, but the lower the delay required for searching the optimal delay of the three-value FPRM circuit is, the better, therefore, in order to combine the two effectively, the fitness is expressed by adopting the reciprocal of the delay, and the fitness function is obtained as follows:
wherein the symbol "/" represents a division operator; fitnesscRepresenting the fitness of the c-th bat, wherein c is an integer which is more than or equal to 1 and less than or equal to m; fitcDelay estimation data of a polarity lower three-value FPRM circuit corresponding to the c-th bat displacement;representing a fitness amplification coefficient, and taking the value of an integer greater than or equal to 500;
D. recording the c-th bat displacement in the bat population as xc,dThe c th bat velocity is denoted as vc,dD represents the search space dimension of the c-th bat, d ∈ [1, b ]]The c th batsound wave loudness is marked as AcThe c th bat pulse rate is recorded as rcThe frequency of the c-th bat sound wave is recorded as fcInitializing the displacement, speed, loudness, pulse rate and frequency of the bat sound wave in the bat population, wherein the bat displacement is initialized to any value within a range of polarity values, ACInitialization is random number r between 1 and2cInitialized to random number more than 0 and less than or equal to 1, bat sound wave frequency fcInitialisation to fmin~fmaxA random number in between, wherein fminThe minimum value of the bat sound wave frequency is represented and is 100, fmaxThe maximum value of the bat sound wave frequency is represented, the value is 1200, and the variable h is initialized to 1;
E. respectively calculating delay estimation data of a polarity lower three-value FPRM circuit corresponding to each bat displacement in a bat group according to the steps (1) and (2), then calculating the fitness of each bat according to the delay estimation data, taking the bat displacement with the maximum fitness value as the current global optimal displacement of the bat group, and if a plurality of bat displacements with the maximum fitness values exist, randomly selecting one bat displacement with the maximum fitness value as the current global optimal displacement of the bat group;
F. the first update of the h-th round of evolutionary generations is carried out on the bat displacement and the bat speed of the bat group: firstly, a random function is adopted to generate uniformly distributed random variables alpha, and alpha belongs to [0,1 ]]Then updating the bat sound wave frequency f of the h-th round of evolution through the formula (1)cThen updating the bat displacement x by combining the formula (2) and the formula (3)c,dAnd bat velocity vc,d:
fc=fmin+(fmax-fmin)*α (1)
Wherein the content of the first and second substances,represents the first updated value of the c-th bat speed at the h-th generation,a first updated value representing the c-th bat displacement at the h-th generation;
if the current value of h is 1, thenIs the initial value of the c-th bat speed,is the initial value of the c-th bat displacement, Ph-1Is the initial value of the current global optimal displacement of the bat population;
if the current value of h is greater than 1, thenFor the updated value of the c-th bat speed in the h-1 th round of evolution,is an updated value of the c-th bat displacement, P, in the h-1 th round of evolutionh-1An updated value of the current global optimal position of the bat population in the h-1 th round of evolution;
G. the bat group is updated again, and the specific process is as follows:
g-1, generating a random number rand1 by using a random function, wherein rand1 belongs to [0,5000 ];
g-2, will rand1 and the c th bat pulse rate rcMaking a comparison if rand1 is less than rcIf the bat displacement of the bat does not need to be updated again, the first updated value of the c-th bat speed is taken as the updated value of the h-th generation, and the step G-1 is returned to, the next bat displacement is updated, if rand1 is greater than or equal to rcAdding 1 to the bat displacement with the maximum fitness value corresponding to the current global optimal displacement of the bat population to obtain a local optimal bat displacement, and recording the local optimal bat displacement as the local optimal bat displacementEntering the step G-3;
g-4, generating a random number rand2 by using a random function, wherein rand2 belongs to [0, 3000 ];
g-5 if rand2 is less than or equal to AcAnd bat displacementIf the corresponding fitness value is greater than or equal to the current fitness value of the c-th bat, the bat displacement is adoptedUpdating the bat displacement x againc,dMaking the updated value of the c-th bat speedIs an updated value of its h-th generation, otherwise, the bat is displaced by xc,dNot updating, and taking the first updated value as the updated value of the h-th evolutionary generation;
g-6, completing the re-updating of the bat populations according to the methods of the steps G-1 to G-5, then recalculating the fitness values of all the bats in the updated bat populations, removing the current global optimal displacement of the updated bat populations by adopting the bat positions with the maximum fitness values, and if a plurality of bat displacements with the maximum fitness values exist, randomly selecting one of the bat positions with the maximum fitness values to remove the current global optimal displacement of the updated bat populations;
H. performing h-th round update on the bat sound wave loudness and the bat pulse rate of the bat population through formula (4) and formula (5):
wherein, the constant is any constant which is more than 0 and less than or equal to 1, gamma is a constant which is more than 0, exp represents an exponential function with a natural constant e as a base,represents the updated value of the c-th batsound wave loudness at the h-th round,the updated value of the c-th bat pulse rate at the h-th round;
if the current value of h is equal to 1,represents the initial value of the c-th batsound wave loudness,an initial value representing a c-th bat pulse rate;
if the current value of h is greater than 1,represents an updated value of the loudness of the c-th bat sound wave of the h-1 th round,an updated value representing the mth bat pulse rate of the h-1 th round;
I. judging whether the current value of h is equal to the maximum evolution algebra, if not, updating the value of h by adding 1 to the current value of h, and returning to the step F to update the next round; and if the current value of h is equal to the maximum evolution algebra, taking the bat displacement with the maximum fitness value corresponding to the current global optimal displacement of the bat population as the optimal polarity of the delay, and taking the fitness value corresponding to the optimal polarity of the delay as the optimal delay.
Example two: a three-value FPRM circuit delay optimization method utilizing a bat algorithm comprises the following steps:
(1) a ternary FPRM circuit with the polarity of q and n input variables is expressed by adopting a function expansion formula as follows:
wherein x is0,x1,...,xn-1Q represents the polarity of the ternary FPRM circuit for n input variables of the function expansion; ∑ is modulo 3 plus the operation sign, "·" is the multiplication sign;is a modulo 3 multiplication term, aiIs a coefficient of modulo 3 multiplication, i being 0,1,2, …, 3n-1-1,Wherein
(2) Decomposing the coefficient of a modulo 3 multiplication term which is not 0 in the function expansion of the ternary FPRM circuit under the q polarity by using a Huffman algorithm, and taking the finally decomposed coefficient as delay estimation data of the ternary FPRM circuit under the q polarity;
(3) the method comprises the following steps of utilizing a bat algorithm to carry out delay optimization on a three-value FPRM circuit under the q polarity:
A. establishing a mapping relation between a bat algorithm and a three-value FPRM circuit delay optimization under the q polarity:
the bat algorithm contains several key elements: bat displacement, bat speed, bat sound wave frequency, bat sound wave loudness, bat search space, bat fitness, maximum bat displacement and maximum fitness value;
the delay optimization of the ternary FPRM circuit comprises the following key elements: polarity, polarity conversion, polarity alternating current, polarity mutation, polarity search space, corresponding polarity delay, optimal polarity and optimal delay;
expressing the bat displacement as a polarity; representing the bat velocity as a polarity reversal; representing the bat acoustic wave frequency as a polar alternating current; expressing the loudness of the bat sound wave as a polarity mutation; representing the bat search space as a polar search space; representing the fitness of the bat as the time delay of the corresponding polarity; representing the bat displacement with the maximum fitness as the polarity with optimal delay; expressing the maximum fitness value as the optimal delay;
B. setting relevant parameters of the bat algorithm:
recording the bat population number as m, wherein m is an integer larger than or equal to 40, recording the bat search space dimension as b, wherein b is an integer larger than or equal to 30, recording the maximum evolution algebra of bat population evolution as N, wherein N is an integer larger than or equal to 3000, and setting the current evolution algebra of the bat population as a variable h;
C. setting a fitness function used for calculating the fitness of the bat in the bat algorithm:
setting a fitness function for calculating the fitness of the bat in a bat algorithm: in the bat algorithm, the higher the fitness is, the better the bat is located relative to the target, but the lower the delay required for searching the optimal delay of the three-value FPRM circuit is, the better, therefore, in order to combine the two effectively, the fitness is expressed by adopting the reciprocal of the delay, and the fitness function is obtained as follows:
wherein the symbol "/" represents a division operator; fitnesscRepresenting the fitness of the c-th bat, wherein c is an integer which is more than or equal to 1 and less than or equal to m; fitcDelay estimation data of a polarity lower three-value FPRM circuit corresponding to the c-th bat displacement;representing a fitness amplification coefficient, and taking the value of an integer greater than or equal to 500;
D. recording the c-th bat displacement in the bat population as xc,dThe c th bat velocity is denoted as vc,dD represents the search space dimension of the c-th bat, d ∈ [1, b ]]The c th batsound wave loudness is marked as AcThe c th bat pulse rate is recorded as rcThe frequency of the c-th bat sound wave is recorded as fcInitializing the displacement, speed, loudness, pulse rate and frequency of the bat sound wave in the bat population, wherein the bat displacement is initialized to any value within a range of polarity values, ACInitialization is random number r between 1 and2cInitialized to random number more than 0 and less than or equal to 1, bat sound wave frequency fcInitialisation to fmin~fmaxA random number in between, wherein fminThe minimum value of the bat sound wave frequency is represented and is 100, fmaxThe maximum value of the bat sound wave frequency is represented, the value is 1200, and the variable h is initialized to 1;
E. respectively calculating delay estimation data of a polarity lower three-value FPRM circuit corresponding to each bat displacement in a bat group according to the steps (1) and (2), then calculating the fitness of each bat according to the delay estimation data, taking the bat displacement with the maximum fitness value as the current global optimal displacement of the bat group, and if a plurality of bat displacements with the maximum fitness values exist, randomly selecting one bat displacement with the maximum fitness value as the current global optimal displacement of the bat group;
F. the first update of the h-th round of evolutionary generations is carried out on the bat displacement and the bat speed of the bat group: firstly, a random function is adopted to generate uniformly distributed random variables alpha, and alpha belongs to [0,1 ]]Then updating the bat sound wave frequency f of the h-th round of evolution through the formula (1)cThen updating the bat displacement x by combining the formula (2) and the formula (3)c,dAnd bat velocity vc,d:
fc=fmin+(fmax-fmin)*α (1)
Wherein the content of the first and second substances,represents the first updated value of the c-th bat speed at the h-th generation,a first updated value representing the c-th bat displacement at the h-th generation;
if the current value of h is 1, thenIs the initial value of the c-th bat speed,is the initial value of the c-th bat displacement, Ph-1Is the initial value of the current global optimal displacement of the bat population;
if the current value of h is greater than 1, thenFor the updated value of the c-th bat speed in the h-1 th round of evolution,is an updated value of the c-th bat displacement, P, in the h-1 th round of evolutionh-1An updated value of the current global optimal position of the bat population in the h-1 th round of evolution;
G. the bat group is updated again, and the specific process is as follows:
g-1, generating a random number rand1 by using a random function, wherein rand1 belongs to [0,5000 ];
g-2, will rand1 and the c th bat pulse rate rcMaking a comparison if rand1 is less than rcIf the bat displacement of the bat does not need to be updated again, the first updated value of the c-th bat speed is taken as the updated value of the h-th generation, and the step G-1 is returned to, the next bat displacement is updated, if rand1 is greater than or equal to rcAdding 1 to the bat displacement with the maximum fitness value corresponding to the current global optimal displacement of the bat population to obtain a local optimal bat displacement, and recording the local optimal bat displacement as the local optimal bat displacementEntering the step G-3;
g-4, generating a random number rand2 by using a random function, wherein rand2 belongs to [0, 3000 ];
g-5 if rand2 is less than or equal to AcAnd bat displacementIf the corresponding fitness value is greater than or equal to the current fitness value of the c-th bat, the bat displacement is adoptedUpdating the bat displacement x againc,dTaking the re-updated value of the c-th bat speed as the updated value of the h-th generation, otherwise, the bat displacement xc,dNot updating, and taking the first updated value as the updated value of the h-th evolutionary generation;
g-6, completing the re-updating of the bat populations according to the methods of the steps G-1 to G-5, then recalculating the fitness values of all the bats in the updated bat populations, removing the current global optimal displacement of the updated bat populations by adopting the bat positions with the maximum fitness values, and if a plurality of bat displacements with the maximum fitness values exist, randomly selecting one of the bat positions with the maximum fitness values to remove the current global optimal displacement of the updated bat populations;
H. performing h-th round update on the bat sound wave loudness and the bat pulse rate of the bat population through formula (4) and formula (5):
wherein, the constant is any constant which is more than 0 and less than or equal to 1, gamma is a constant which is more than 0, exp represents an exponential function with a natural constant e as a base,represents the updated value of the c-th batsound wave loudness at the h-th round,the updated value of the c-th bat pulse rate at the h-th round;
if the current value of h is equal to 1,represents the initial value of the c-th batsound wave loudness,denotes the c thAn initial value of a bat pulse rate;
if the current value of h is greater than 1,represents an updated value of the loudness of the c-th bat sound wave of the h-1 th round,an updated value representing the mth bat pulse rate of the h-1 th round;
I. judging whether the current value of h is equal to the maximum evolution algebra, if not, updating the value of h by adding 1 to the current value of h, and returning to the step F to update the next round; and if the current value of h is equal to the maximum evolution algebra, taking the bat displacement with the maximum fitness value corresponding to the current global optimal displacement of the bat population as the optimal polarity of the delay, and taking the fitness value corresponding to the optimal polarity of the delay as the optimal delay.
In this embodiment, the specific process of obtaining the delay estimation data of the three-valued FPRM circuit under the q polarity in step (2) is as follows:
a. determining the number of modulo-3 multiplication terms which are not 0 in the ternary FPRM circuit under the q polarity according to the function expansion of the ternary FPRM circuit under the q polarity, and recording the number of the modulo-3 multiplication terms which are not 0 as M;
b. comparing the M coefficients of the modulo 3 multiplication terms to obtain delay estimation data of a three-value FPRM circuit under q polarity, and the specific process is as follows:
when M is equal to 1, taking the coefficient of the 1 modulo 3 multiplication term as delay estimation data of the three-value FPRM circuit under the q polarity;
when M is equal to 2, if the two coefficients are equal, selecting any one coefficient as delay estimation data of the three-value FPRM circuit under the q polarity, if the two coefficients are not equal, deleting the smaller coefficient of the two coefficients, keeping the larger coefficient of the two coefficients, updating the value of the coefficient by adopting the value obtained by adding 1 to the value of the larger coefficient of the two coefficients, and using the updated value as the delay estimation data of the three-value FPRM circuit under the q polarity;
when M is larger than 2, the specific comparison process is as follows:
randomly selecting any two coefficients of the modulo 3 multiplication term;
comparing the two coefficients: if the two are equal, returning to the step (i) to start a new round of selection; if the two are not equal, deleting the smaller coefficient of the two, keeping the larger coefficient of the two, and updating the value of the coefficient by adopting the value obtained by adding 1 to the value of the larger coefficient of the two;
randomly selecting a coefficient from the coefficients of the remaining modulo 3 multiplication items, and comparing the coefficient with the update value of the larger coefficient reserved in the previous step according to the method of the second step;
fourthly, repeating the step III until all the coefficients are compared;
using the last reserved updating value with a larger coefficient as the delay estimation data of the three-value FPRM circuit under the q polarity;
and when M is larger than 2, if the two coefficients in all the comparison processes are equal, selecting any one coefficient as delay estimation data of the three-value FPRM circuit under the q polarity.
And (3) randomly selecting 9 MCNC Benchmark circuits in an experiment, and testing the circuits respectively by using the method and the exhaustion method. The test environment is as follows: windows 10(64 bits), 3.20GHz Intel Pentium CPU, 4.00GB memory, Dev-C + + software. In the method of the present invention, the relevant parameters are: the bat population number is 100, the search space dimension is 30, and the maximum evolutionary algebra of the population is 3000. The experimental data are shown in table 1, wherein, column 1 and column 2 are the name of the test circuit and the number of its input variables, respectively; the column 3 and the column 4 are circuit area and delay data obtained by searching through an exhaustive method respectively; the column 5 and the column 6 are respectively circuit area and delay data obtained by searching by the method of the invention. According to the test data in table 1, the circuit area searched by the method of the present invention is increased by 26.7% on average, and the delay time is decreased by 11.3% on average.
TABLE 1
The experimental results of comparing the time delay and area optimization of the method (IWBA) and the PSO algorithm and the traditional bat algorithm (BA algorithm) on the three-value FPRM circuit are shown in the table 2, wherein, the column 1 and the column 2 are the name of the test circuit and the input variable number thereof respectively; the row 3 and the row 4 are respectively circuit area and delay data obtained based on PSO algorithm optimization; the column 5 and the column 6 are respectively circuit area and delay data obtained based on BA algorithm optimization; the column 7 and the column 8 are respectively circuit area and delay data obtained by the optimization of the method.
TABLE 2
Comparing the area and delay optimization results of the three methods in table 2, it can be seen that the optimization effect of the invention is obviously superior to that of the PSO algorithm and the BA algorithm. Compared with a PSO algorithm, the method saves the average area by 73.5 percent and saves the time delay by 16.5 percent; compared with the BA algorithm, the method saves the average area by 66.0 percent and saves the time delay by 14.3 percent.
Claims (2)
1. A three-value FPRM circuit delay optimization method utilizing a bat algorithm is characterized by comprising the following steps of:
(1) a ternary FPRM circuit with the polarity of q and n input variables is expressed by adopting a function expansion formula as follows:
wherein x is0,x1,...,xn-1Q represents the polarity of the ternary FPRM circuit for n input variables of the function expansion;modulo 3 plus operator, "·" is the multiply operator;is a modulo 3 multiplication term, aiIs a coefficient of modulo 3 multiplication, i being 0,1,2, …, 3n-1-1,ijE {0,1,2}, wherej=0,1,…,n-1;
(2) Decomposing the coefficient of a modulo 3 multiplication term which is not 0 in the function expansion of the ternary FPRM circuit under the q polarity by using a Huffman algorithm, and taking the finally decomposed coefficient as delay estimation data of the ternary FPRM circuit under the q polarity;
(3) the method comprises the following steps of utilizing a bat algorithm to carry out delay optimization on a three-value FPRM circuit under the q polarity:
A. establishing a mapping relation between a bat algorithm and a three-value FPRM circuit delay optimization under the q polarity:
the bat algorithm contains several key elements: bat displacement, bat speed, bat sound wave frequency, bat sound wave loudness, bat search space, bat fitness, maximum bat displacement and maximum fitness value;
the delay optimization of the ternary FPRM circuit comprises the following key elements: polarity, polarity conversion, polarity alternating current, polarity mutation, polarity search space, corresponding polarity delay, optimal polarity and optimal delay;
expressing the bat displacement as a polarity; representing the bat velocity as a polarity reversal; representing the bat acoustic wave frequency as a polar alternating current; expressing the loudness of the bat sound wave as a polarity mutation; representing the bat search space as a polar search space; representing the fitness of the bat as the time delay of the corresponding polarity; representing the bat displacement with the maximum fitness as the polarity with optimal delay; expressing the maximum fitness value as the optimal delay;
B. setting relevant parameters of the bat algorithm:
recording the bat population number as m, wherein m is an integer larger than or equal to 40, recording the bat search space dimension as b, wherein b is an integer larger than or equal to 30, recording the maximum evolution algebra of bat population evolution as N, wherein N is an integer larger than or equal to 3000, and setting the current evolution algebra of the bat population as a variable h;
C. setting a fitness function used for calculating the fitness of the bat in the bat algorithm:
setting a fitness function for calculating the fitness of the bat in a bat algorithm: in the bat algorithm, the higher the fitness is, the better the bat is located relative to the target, but the lower the delay required for searching the optimal delay of the three-value FPRM circuit is, the better, therefore, in order to combine the two effectively, the fitness is expressed by adopting the reciprocal of the delay, and the fitness function is obtained as follows:
wherein the symbol "/" represents a division operator; fitnesscRepresenting the fitness of the c-th bat, wherein c is an integer which is more than or equal to 1 and less than or equal to m; fitcDelay estimation data of a polarity lower three-value FPRM circuit corresponding to the c-th bat displacement;representing a fitness amplification coefficient, and taking the value of an integer greater than or equal to 500;
D. recording the c-th bat displacement in the bat population as xc,dThe c th bat velocity is denoted as vc,dD represents the search space dimension of the c-th bat, d ∈ [1, b ]]The c th batsound wave loudness is marked as AcThe c th bat pulse rate is recorded as rcThe frequency of the c-th bat sound wave is recorded as fcInitializing the displacement, speed, loudness, pulse rate and frequency of the bat sound wave in the bat population, wherein the bat displacement is initialized to any value within a range of polarity values, ACInitialization is random number r between 1 and2cInitialized to random number more than 0 and less than or equal to 1, bat sound wave frequency fcInitialisation to fmin~fmaxA random number in between, wherein fminThe minimum value of the bat sound wave frequency is represented and is 100, fmaxThe maximum value of the bat sound wave frequency is represented, the value is 1200, and the variable h is initialized to 1;
E. respectively calculating delay estimation data of a polarity lower three-value FPRM circuit corresponding to each bat displacement in a bat group according to the steps (1) and (2), then calculating the fitness of each bat according to the delay estimation data, taking the bat displacement with the maximum fitness value as the current global optimal displacement of the bat group, and if a plurality of bat displacements with the maximum fitness values exist, randomly selecting one bat displacement with the maximum fitness value as the current global optimal displacement of the bat group;
F. the first update of the h-th round of evolutionary generations is carried out on the bat displacement and the bat speed of the bat group: firstly, a random function is adopted to generate uniformly distributed random variables alpha, and alpha belongs to [0,1 ]]Then updating the bat sound wave frequency f of the h-th round of evolution through the formula (1)cThen updating the bat displacement x by combining the formula (2) and the formula (3)c,dAnd bat velocity vc,d:
fc=fmin+(fmax-fmin)*α (1)
Wherein the content of the first and second substances,represents the first updated value of the c-th bat speed at the h-th generation,a first updated value representing the c-th bat displacement at the h-th generation;
if the current value of h is 1, thenIs the initial value of the c-th bat speed,is the initial value of the c-th bat displacement, Ph-1Is the initial value of the current global optimal displacement of the bat population;
if the current value of h is greater than 1, thenFor the updated value of the c-th bat speed in the h-1 th round of evolution,is an updated value of the c-th bat displacement, P, in the h-1 th round of evolutionh-1An updated value of the current global optimal position of the bat population in the h-1 th round of evolution;
G. the bat group is updated again, and the specific process is as follows:
g-1, generating a random number rand1 by using a random function, wherein rand1 belongs to [0,5000 ];
g-2, will rand1 and the c th bat pulse rate rcMaking a comparison if rand1 is less than rcIf the bat displacement of the bat does not need to be updated again, the first updated value of the c-th bat speed is taken as the updated value of the h-th generation, and the step G-1 is returned to, the next bat displacement is updated, if rand1 is greater than or equal to rcAdding 1 to the bat displacement with the maximum fitness value corresponding to the current global optimal displacement of the bat population to obtain a local optimal bat displacement, and recording the local optimal bat displacement as the local optimal bat displacementEntering the step G-3;
g-4, generating a random number rand2 by using a random function, wherein rand2 belongs to [0, 3000 ];
g-5 if rand2 is less than or equal to AcAnd bat displacementIf the corresponding fitness value is greater than or equal to the current fitness value of the c-th bat, the bat displacement is adoptedUpdating the bat displacement x againc,dTaking the re-updated value of the c-th bat speed as the updated value of the h-th generation, otherwise, the bat displacement xc,dNot updating, and taking the first updated value as the updated value of the h-th evolutionary generation;
g-6, completing the re-updating of the bat populations according to the methods of the steps G-1 to G-5, then recalculating the fitness values of all the bats in the updated bat populations, removing the current global optimal displacement of the updated bat populations by adopting the bat positions with the maximum fitness values, and if a plurality of bat displacements with the maximum fitness values exist, randomly selecting one of the bat positions with the maximum fitness values to remove the current global optimal displacement of the updated bat populations;
H. performing h-th round update on the bat sound wave loudness and the bat pulse rate of the bat population through formula (4) and formula (5):
wherein, the constant is any constant which is more than 0 and less than or equal to 1, gamma is a constant which is more than 0, exp represents an exponential function with a natural constant e as a base,represents the updated value of the c-th batsound wave loudness at the h-th round,the updated value of the c-th bat pulse rate at the h-th round;
if the current value of h is equal to 1,represents the initial value of the c-th batsound wave loudness,an initial value representing a c-th bat pulse rate;
if the current value of h is greater than 1,represents an updated value of the loudness of the c-th bat sound wave of the h-1 th round,an updated value representing the mth bat pulse rate of the h-1 th round;
I. judging whether the current value of h is equal to the maximum evolution algebra, if not, updating the value of h by adding 1 to the current value of h, and returning to the step F to update the next round; and if the current value of h is equal to the maximum evolution algebra, taking the bat displacement with the maximum fitness value corresponding to the current global optimal displacement of the bat population as the optimal polarity of the delay, and taking the fitness value corresponding to the optimal polarity of the delay as the optimal delay.
2. The method as claimed in claim 1, wherein the step (2) of obtaining the delay estimation data of the three-valued FPRM circuit with q polarity comprises the following steps:
a. determining the number of modulo-3 multiplication terms which are not 0 in the ternary FPRM circuit under the q polarity according to the function expansion of the ternary FPRM circuit under the q polarity, and recording the number of the modulo-3 multiplication terms which are not 0 as M;
b. comparing the M coefficients of the modulo 3 multiplication terms to obtain delay estimation data of a three-value FPRM circuit under q polarity, and the specific process is as follows:
when M is equal to 1, taking the coefficient of the 1 modulo 3 multiplication term as delay estimation data of the three-value FPRM circuit under the q polarity;
when M is equal to 2, if the two coefficients are equal, selecting any one coefficient as delay estimation data of the three-value FPRM circuit under the q polarity, if the two coefficients are not equal, deleting the smaller coefficient of the two coefficients, keeping the larger coefficient of the two coefficients, updating the value of the coefficient by adopting the value obtained by adding 1 to the value of the larger coefficient of the two coefficients, and using the updated value as the delay estimation data of the three-value FPRM circuit under the q polarity;
when M is larger than 2, the specific comparison process is as follows:
randomly selecting any two coefficients of the modulo 3 multiplication term;
comparing the two coefficients: if the two are equal, returning to the step (i) to start a new round of selection; if the two are not equal, deleting the smaller coefficient of the two, keeping the larger coefficient of the two, and updating the value of the coefficient by adopting the value obtained by adding 1 to the value of the larger coefficient of the two;
randomly selecting a coefficient from the coefficients of the remaining modulo 3 multiplication items, and comparing the coefficient with the update value of the larger coefficient reserved in the previous step according to the method of the second step;
fourthly, repeating the step III until all the coefficients are compared;
and fifthly, taking the last reserved updating value with a larger coefficient as delay estimation data of the three-value FPRM circuit under the q polarity.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710820964.4A CN107748912B (en) | 2017-09-13 | 2017-09-13 | Three-value FPRM circuit delay optimization method utilizing bat algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710820964.4A CN107748912B (en) | 2017-09-13 | 2017-09-13 | Three-value FPRM circuit delay optimization method utilizing 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 | Three-value FPRM circuit delay optimization method utilizing bat algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107748912B (en) |
Citations (3)
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 |
-
2017
- 2017-09-13 CN CN201710820964.4A patent/CN107748912B/en active Active
Patent Citations (3)
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)
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 |
---|---|---|
Huddar et al. | Novel high speed vedic mathematics multiplier using compressors | |
AU2020103826A4 (en) | Whale dna sequence optimization method based on harmony search (hs) | |
CN109214509B (en) | High-speed real-time quantization structure and operation implementation method for deep neural network | |
CN108052696B (en) | Three-value FPRM circuit area and delay optimization method using particle swarm optimization | |
CN111985523A (en) | Knowledge distillation training-based 2-exponential power deep neural network quantification method | |
CN107748912B (en) | Three-value FPRM circuit delay optimization method utilizing bat algorithm | |
US7912891B2 (en) | High speed low power fixed-point multiplier and method thereof | |
Phan et al. | Efficiency enhancement of evolutionary neural architecture search via training-free initialization | |
CN110534154A (en) | Whale DNA sequence dna optimization method based on harmony search | |
CN115984025A (en) | Influence propagation estimation method and system based on deep learning graph network model | |
Agarkar et al. | Optimization of generalized regression neural networks using PSO and GA for non-performer particles | |
Chang et al. | Mixture models with entropy regularization for community detection in networks | |
CN112884117B (en) | RTID-PSO method and system for random topology | |
CN107679326A (en) | A kind of two-value FPRM circuit areas and delay comprehensive optimization method | |
Sun et al. | Best polarity searching for ternary FPRM logic circuit area based on whole annealing genetic algorithm | |
Hashemi et al. | Univariate marginal distribution algorithm in combination with extremal optimization (EO, GEO) | |
Bui | Pipelined FPGA design of the Goertzel algorithm for exon prediction | |
Zuo et al. | RL-MUL: Multiplier Design Optimization with Deep Reinforcement Learning | |
US20020083108A1 (en) | Method and apparatus for comparing two binary numbers with a power-of-two threshold | |
Wang et al. | Reducing Depth of Quantum Adder using Ling Structure | |
Azamimi et al. | Effect of chaos noise on the learning ability of back propagation algorithm in feed forward neural network | |
Garg et al. | Revisiting neural architecture search | |
CN111159968B (en) | Area optimization method of MPRM circuit | |
Oren et al. | Planning with uncertainty: Deep exploration in model-based reinforcement learning | |
CN109033506B (en) | Optimization method for area and power consumption of three-value fixed-polarity RM circuit |
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 |