CN111259609A - Optimal implication logic representation method of digital circuit logic function - Google Patents

Optimal implication logic representation method of digital circuit logic function Download PDF

Info

Publication number
CN111259609A
CN111259609A CN202010052708.7A CN202010052708A CN111259609A CN 111259609 A CN111259609 A CN 111259609A CN 202010052708 A CN202010052708 A CN 202010052708A CN 111259609 A CN111259609 A CN 111259609A
Authority
CN
China
Prior art keywords
logic
formula
implication
cnf
constraint
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.)
Granted
Application number
CN202010052708.7A
Other languages
Chinese (zh)
Other versions
CN111259609B (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 CN202010052708.7A priority Critical patent/CN111259609B/en
Publication of CN111259609A publication Critical patent/CN111259609A/en
Application granted granted Critical
Publication of CN111259609B publication Critical patent/CN111259609B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an optimal implication logic representation method of a digital circuit logic function, which comprises the steps of describing constraint conditions in implication logic according to defined Boolean variables, obtaining a constraint file represented by a conjunctive normal form CNF, setting different substantial implication logic operands, coding to obtain the CNF constraint file, transmitting the CNF constraint file to an SAT solver until the SAT solver finds Boolean variable assignment meeting the constraint conditions and returns a result SAT representing an optimal solution, thereby ensuring that the optimal implication logic representation form of the digital circuit logic function is found. The method optimizes 74 functions in all logic functions of the three-input digital circuit. The method can effectively reduce the number of nodes in a logic graph structure taking the essential inclusion as a basic operation set, can reduce the number of memristors when being applied to a memristor circuit, reduces the design cost of the memristor circuit, and enriches the research method of the essential inclusion logic in logic synthesis.

Description

Optimal implication logic representation method of digital circuit logic function
Technical Field
The invention relates to an implication logic representation method, in particular to an optimal implication logic representation method of a digital circuit logic function.
Background
In 1971, professor zeisure speculates a novel basic circuit element on the basis of circuit theory and symmetry principle, and the basic circuit element is called as a memristor, namely a resistor with memorability. Subsequently, HP (hewlett-packard) laboratories developed nano memristors in developing molecular-scale products to replace transistor switches, and implemented substantial implications (IMP, logical expressions) using the switching characteristics of dual memristors
Figure BDA0002371761630000011
And (4) logical operation. The essence implication is one of two-variable basic logic operations, and can also form the complete basis of the logic operation together with a logic constant "0", which means that any logic operation can be realized by using the implication operation. If the memory function of the memristor is combined with the memory function of the memristor, a new calculation paradigm can be formed, namely, calculation tasks are executed when data are stored in the same chip, and therefore dynamic switching between storage and calculation is achieved.
Researchers previously obtain the implication logic representation of a circuit by using an academic logic synthesis tool ABC, firstly read in a circuit AND store the circuit as a logic graph structure (AND-observer Graphs, AIG) with 'AND, INV' as a basic operation set, AND then obtain the logic graph structure with 'IMP' as the basic operation set through mapping. However, the results obtained with this approach are not optimal because of the redundancy that is created by the fact that a substantial implication logic is required to implement the inverter one-to-one mapping in the AIG.
Disclosure of Invention
The invention aims to solve the technical problem that aiming at the defects of the prior art, the optimal implication logic expression of the logic function of the digital circuit is solved by utilizing a precise synthesis algorithm based on the Boolean Satisfiability (SAT) to obtain the optimal implication logic expression method of the logic function of the digital circuit.
The technical scheme adopted by the invention for solving the technical problems is as follows: a method for optimally implied logic representation of a digital circuit logic function, comprising the steps of:
step ①, define Boolean variables
Three boolean variables are defined: x is the number ofit、ghiAnd sijkWherein x isitRepresenting the ith logic gate x in a digital circuitiValues in the t-th row of the truth table of the logic function of the digital circuit; if logic gate xiIs the h-th original output g in the digital circuithThen the boolean variable ghiIs true, otherwise is false; if logic gate xiAre each xjAnd xkAnd logic gate xiPerforming a substantial implication logic operation, then the Boolean variable sijkIs true, otherwise is false; wherein, the value ranges of j and k are as follows: j is not less than 1<i,0≤k<i,j≠k;
Step ②, converting the constraint problem in the implication logic into conjunctive normal form formula, i.e. CNF formula
The logical graph structure containing only the "IMP" operation is taken as a logical function to represent, that is, in the logical graph structure taking the "IMP" as a basic operation set, except for an original input and an original output, each logic gate executes a substantial logic implication operation, so that the main constraint conditions in the implication logic are as follows:
Figure BDA0002371761630000021
in the formula (1), the symbol "→" represents a substantial logical operation, and the symbol
Figure BDA0002371761630000027
Indicates a strict equivalence; equation (1) shows if the logic gate xiAre each xjAnd xkAnd logic gate xiPerforming substantive implication logic operations, i.e. xit=xjt→xktThen logic gate xiValue of (a) xitIs shown as
Figure BDA0002371761630000022
Converting the logic gate in the digital circuit into the description form of the CNF formula by using the Tseytin conversion method to obtain the logic gate
Figure BDA0002371761630000023
CNF formula (i):
(xit→(xjt→xkt))∧((xjt→xkt)→xit) (2)
in the formula (2), the symbol Λ represents the conjunctive value (i.e. logical and), and only the combination of the assignments in the truth table of the logic gate satisfies the formula (2), the combination formula (2) and the equation
Figure BDA0002371761630000024
Wherein the horizontal line above the boolean variable represents a logical negation, expanding equation (1) to:
Figure BDA0002371761630000025
converting the formula (3) into a CNF form, and use
Figure BDA0002371761630000026
Wherein the symbol "V-V" represents a logical OR, resulting in a constraint of the CNF form:
Figure BDA0002371761630000031
for the NOR logic gate contained in equation (4)
Figure BDA0002371761630000032
Defining a Boolean variable
Figure BDA0002371761630000033
Rewriting formula (4) as:
Figure BDA0002371761630000034
the NOR logic gate contained in the formula (4) is converted by using the Tseytin conversion method
Figure BDA0002371761630000035
Conversion to CNF form:
Figure BDA0002371761630000036
in summary, the primary CNF constraint equations for the substantive implication logic are:
Figure BDA0002371761630000037
to ensure the original output g in digital circuitshMust be a logic gate xiDefining a constraint formula as:
Vighi(8)
"V" in the formula (8) represents a logical OR;
to ensure logic gates x in digital circuitsiMust have two inputs xjAnd xkDefining a constraint formula as follows:
Vj,ksijk(9)
in the formula (9), j is not equal to k, and j is not equal to 0;
to constrain the raw output values of a digital circuit to a specified logic gate, a constraint formula is defined as:
Figure BDA0002371761630000038
in the formula (10)
Figure BDA0002371761630000039
Represents a logical exclusive OR, (t)1,…,tn)2Binary coding representing line number t in a truth table of logic functions of the digital circuit;
③, on the basis of the constraint condition obtained in step ②, firstly setting the number of required essential implication logic gates as 0, coding to obtain a CNF constraint file, and transmitting the obtained CNF constraint file to an SAT solver;
step ④, an SAT solver assigns values to the Boolean variables in the received CNF constraint file, and finds a group of Boolean variable assignments satisfying the formulas (7) to (10) of true values;
if the SAT solver finds such a set of Boolean variable assignments, the returned result is SAT, which means that the optimal solution is found; otherwise, adding 1 to the required substance inclusion logic gate number, recoding and solving until the result returned by the SAT solver is SAT.
Compared with the prior art, the invention has the following advantages:
1. the invention discloses an optimal implication logic expression method of a digital circuit logic function, which solves the optimal implication logic expression of the digital circuit logic function by utilizing a precise comprehensive algorithm based on Boolean Satisfiability (SAT). The method of the invention does not pass intermediate steps such as other logic structure transformation, etc., but directly obtains the optimal substance implication logic expression form from the logic function of the digital circuit. The method comprises the steps of describing constraint conditions in the implication logic according to defined Boolean variables, obtaining a constraint file expressed by a Conjunctive Normal Form (CNF), setting different substantial implication logic operands, coding to obtain the CNF constraint file, and transmitting the CNF constraint file to an SAT solver until the SAT solver finds Boolean variable assignment meeting the constraint conditions and returns a result SAT representing an optimal solution, so that the optimal implication logic expression Form of a digital circuit logic function is ensured to be found.
2. The method of the invention obtains an optimal implication logic representation form of the logic function of the digital circuit on the premise of ensuring the consistent functions of the logic functions of the digital circuit in the whole solving process. The method of the invention is applied to all three-input digital circuit logic functions (in common)
Figure BDA0002371761630000041
One function), 74 functions were optimized. The method of the invention can be effectively usedThe number of nodes in a logic graph structure with the essential implication as a basic operation set is reduced, when the method is applied to a memristor circuit, the number of memristors can be reduced, the design cost of the memristor circuit is reduced, and meanwhile, the research method of the essential implication logic in logic synthesis is enriched.
Drawings
FIG. 1 is a structure of a virtual implication logic circuit consisting of dual memristors;
FIG. 2 is a truth table of logic functions for a virtual implication logic circuit consisting of dual memristors;
FIG. 3 is a diagram of a logic graph structure with "IMP" as a basic operation set obtained by one-to-one mapping of AIG for an exemplary digital circuit;
fig. 4 is a logic graph structure with IMP as a basic operation set obtained by the method of the present invention for an exemplary digital circuit.
Detailed Description
The invention is described in further detail below with reference to the accompanying examples.
Fig. 1 and 2 show a corresponding logic circuit structure and a truth table of logic functions of a substantially implicit logic circuit, respectively. Connecting a conventional resistor in series with two parallel memristors P, Q forms a digital switching circuit, the hybrid circuit may form a virtual implied operation. The initial resistance state of the memristor P, Q is the input of the logic gate, and the memristor Q is simultaneously used as the output of the logic gate through the voltage vset、vcondThe combined action of the two signals is that the resistance state of the memristor Q is changed and serves as the output of the logic gate, and the final result is written into the memristor Q to be stored.
Using a Boolean expression as
Figure BDA0002371761630000051
For example, the truth table of the logic function of the digital circuit is (00001011)2. For the digital circuit, fig. 3 is a schematic diagram of a conventional logic graph structure with IMP as a basic operation set obtained by AIG one-to-one mapping, and in fig. 3, all nodes are substantial implication logic gates (i.e., IMP nodes). FIG. 4 shows the present inventionThe method aims at the logic graph structure which is obtained by the digital circuit and takes IMP as a basic operation set. The method has the advantage that the optimal implication logic expression of the digital circuit logic function is obtained through an SAT-based precise comprehensive algorithm under the condition that the logic function of the digital circuit function is not changed.
For the Boolean expression of
Figure BDA0002371761630000052
The implementation process of solving the optimal implication logic expression of the logic function of the digital circuit by adopting the method comprises the following steps:
step ①, define Boolean variables
Three boolean variables are defined: x is the number ofit、ghiAnd sijkThe original input to the digital circuit is x, as shown in FIG. 41(i.e., variables a), x2(i.e., variables b), x3(i.e., variable c) with the middle logic gate being x4、x5、x6The original output is g1
Step ②, converting the constraint problem in the implication logic into conjunctive normal form formula, i.e. CNF formula
The constraint formula for the substantive implication logic is obtained as follows:
Figure BDA0002371761630000053
wherein i is more than or equal to 4 and less than or equal to 6, j is more than or equal to 1 and less than or equal to i, k is more than or equal to 0 and less than or equal to i, h is 1, and t is more than or equal to 0 and less than or equal to 7;
③, on the basis of the constraint condition obtained in step ②, firstly setting the number of required essential implication logic gates as 0, coding to obtain a CNF constraint file, and transmitting the obtained CNF constraint file to an SAT solver;
step ④, an SAT solver assigns values to Boolean variables in the received CNF constraint file, and finds a group of Boolean variable assignments which satisfy the constraint condition formula values of true;
if the SAT solver finds such a set of Boolean variable assignments, the returned result is SAT, which means that the optimal solution is found; otherwise, adding 1 to the required substance inclusion logic gate number, recoding and solving until the result returned by the SAT solver is SAT. The final results are shown in FIG. 4.
In the above simple digital circuit, the logic gate x4、x5、x6All are true inclusion logic gates whose true inclusion table is:
t=7 6 5 4 3 2 1 0
x4t=1 0 1 1 1 0 1 1
x5t=1 1 1 1 0 1 0 0
x6t=0 0 0 0 1 0 1 1
in the Boolean variable ghiIn (g)16Is 1, the remainder being ghiIs 0; in the Boolean variable sijkIn, s421、s543、s650Is 1, the remainder sijkIs 0.
For all three-input digital circuit logic functions (common)
Figure BDA0002371761630000062
Individual function) respectively adopting the method of the invention to obtain the optimal implied logic expression of the digital circuit logic function, and comparing the optimal implied logic expression with the existing AIG one-to-one mapping method, and the comparison result is shown in Table 1. In Table 1, Nimg(f) The number of nodes in the logic graph structure of digital circuit logic function f obtained by the method of the present invention and using IMP as basic operation set, Naig(f) The number of nodes of the logical graph structure which is transformed into AIG and then mapped into the basic operation set by IMP is represented. The second column in table 1 shows the same number of functions with the same number of nodes obtained in the two conversion modes, and the third column shows that the number of IMP nodes obtained by the method of the present invention is superior to that of functions obtained by the existing method, and the method of the present invention makes 74 functions out of 256 three-input digital circuit logic functions obtain the best substantial implication logic expression.
In FIG. 3Naig((00001011)2) (ii) 5; n in FIG. 4img((00001011)2) The number of nodes is reduced by two, 3. Accordingly, the present inventionThe method can effectively reduce the number of nodes in a logic graph structure taking IMP as a basic operation set to obtain the optimal inclusion logic expression of the logic function of the digital circuit, and when the method is applied to a memristor circuit, the cost can be reduced for the design of the memristor circuit, and meanwhile, the research method of the substantial inclusion logic in logic synthesis is enriched.
TABLE 1
Figure BDA0002371761630000061

Claims (1)

1. A method for optimally implied logic representation of a logic function of a digital circuit, comprising the steps of:
step ①, define Boolean variables
Three boolean variables are defined: x is the number ofit、ghiAnd sijkWherein x isitRepresenting the ith logic gate x in a digital circuitiValues in the t-th row of the truth table of the logic function of the digital circuit; if logic gate xiIs the h-th original output g in the digital circuithThen the boolean variable ghiIs true, otherwise is false; if logic gate xiAre each xjAnd xkAnd logic gate xiPerforming a substantial implication logic operation, then the Boolean variable sijkIs true, otherwise is false; wherein, the value ranges of j and k are as follows: j is not less than 1<i,0≤k<i,j≠k;
Step ②, converting the constraint problem in the implication logic into conjunctive normal form formula, i.e. CNF formula
The logical graph structure containing only the "IMP" operation is taken as a logical function to represent, that is, in the logical graph structure taking the "IMP" as a basic operation set, except for an original input and an original output, each logic gate executes a substantial logic implication operation, so that the main constraint conditions in the implication logic are as follows:
Figure FDA0002371761620000011
in the formula (1), the symbol "→" represents a substantial logical operation, and the symbol
Figure FDA0002371761620000012
Indicates a strict equivalence; equation (1) shows if the logic gate xiAre each xjAnd xkAnd logic gate xiPerforming substantive implication logic operations, i.e. xit=xjt→xktThen logic gate xiValue of (a) xitIs shown as
Figure FDA0002371761620000013
Converting the logic gate in the digital circuit into the description form of the CNF formula by using the Tseytin conversion method to obtain the logic gate
Figure FDA0002371761620000014
CNF formula (i):
(xit→(xjt→xkt))∧((xjt→xkt)→xit) (2)
in the formula (2), the symbol Λ represents the conjunctive value, and only the combination of the assigned values in the truth table of the logic gate satisfies the formula (2), the conjunctive formula (2) and the equation
Figure FDA0002371761620000015
Wherein the horizontal line above the boolean variable represents a logical negation, expanding equation (1) to:
Figure FDA0002371761620000016
converting the formula (3) into a CNF form, and use
Figure FDA0002371761620000017
Wherein the symbol "V-V" represents a logical OR, resulting in a constraint of the CNF form:
Figure FDA0002371761620000021
for the NOR logic gate contained in equation (4)
Figure FDA0002371761620000022
Defining a Boolean variable
Figure FDA0002371761620000023
Rewriting formula (4) as:
Figure FDA0002371761620000024
the NOR logic gate contained in the formula (4) is converted by using the Tseytin conversion method
Figure FDA0002371761620000025
Conversion to CNF form:
Figure FDA0002371761620000026
in summary, the primary CNF constraint equations for the substantive implication logic are:
Figure FDA0002371761620000027
to ensure the original output g in digital circuitshMust be a logic gate xiDefining a constraint formula as:
Vighi(8)
"V" in the formula (8) represents a logical OR;
to ensure logic gates x in digital circuitsiMust have two inputs xjAnd xkDefining a constraint formula as follows:
Vj,ksijk(9)
in the formula (9), j is not equal to k, and j is not equal to 0;
to constrain the raw output values of a digital circuit to a specified logic gate, a constraint formula is defined as:
Figure FDA0002371761620000028
in the formula (10)
Figure FDA0002371761620000029
Represents a logical exclusive OR, (t)1,…,tn)2Binary coding representing line number t in a truth table of logic functions of the digital circuit;
③, on the basis of the constraint condition obtained in step ②, firstly setting the number of required essential implication logic gates as 0, coding to obtain a CNF constraint file, and transmitting the obtained CNF constraint file to an SAT solver;
step ④, an SAT solver assigns values to the Boolean variables in the received CNF constraint file, and finds a group of Boolean variable assignments satisfying the formulas (7) to (10) of true values;
if the SAT solver finds such a set of Boolean variable assignments, the returned result is SAT, which means that the optimal solution is found; otherwise, adding 1 to the required substance inclusion logic gate number, recoding and solving until the result returned by the SAT solver is SAT.
CN202010052708.7A 2020-01-17 2020-01-17 Optimal implication logic representation method for logic function of digital circuit Active CN111259609B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010052708.7A CN111259609B (en) 2020-01-17 2020-01-17 Optimal implication logic representation method for logic function of digital circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010052708.7A CN111259609B (en) 2020-01-17 2020-01-17 Optimal implication logic representation method for logic function of digital circuit

Publications (2)

Publication Number Publication Date
CN111259609A true CN111259609A (en) 2020-06-09
CN111259609B CN111259609B (en) 2023-05-02

Family

ID=70944054

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010052708.7A Active CN111259609B (en) 2020-01-17 2020-01-17 Optimal implication logic representation method for logic function of digital circuit

Country Status (1)

Country Link
CN (1) CN111259609B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117494622A (en) * 2023-12-29 2024-02-02 深圳鸿芯微纳技术有限公司 Logic function decomposition method and device for exclusive or majority logic and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070044045A1 (en) * 2005-08-19 2007-02-22 Nan Zhuang Method and apparatus for optimizing a logic network in a digital circuit
US7386828B1 (en) * 2006-02-23 2008-06-10 Altera Corporation SAT-based technology mapping framework
US20090235216A1 (en) * 2008-03-11 2009-09-17 Arizona Board of Regents, a body Corporate of the State of Arizona, Acting for and on Behalf of Ariz Combinational Equivalence Checking for Threshold Logic Circuits
CN109994139A (en) * 2019-03-15 2019-07-09 北京大学 A kind of complete non-volatile logic implementation method and its application based on unipolarity memristor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070044045A1 (en) * 2005-08-19 2007-02-22 Nan Zhuang Method and apparatus for optimizing a logic network in a digital circuit
US7386828B1 (en) * 2006-02-23 2008-06-10 Altera Corporation SAT-based technology mapping framework
US20090235216A1 (en) * 2008-03-11 2009-09-17 Arizona Board of Regents, a body Corporate of the State of Arizona, Acting for and on Behalf of Ariz Combinational Equivalence Checking for Threshold Logic Circuits
CN109994139A (en) * 2019-03-15 2019-07-09 北京大学 A kind of complete non-volatile logic implementation method and its application based on unipolarity memristor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117494622A (en) * 2023-12-29 2024-02-02 深圳鸿芯微纳技术有限公司 Logic function decomposition method and device for exclusive or majority logic and electronic equipment
CN117494622B (en) * 2023-12-29 2024-03-01 深圳鸿芯微纳技术有限公司 Logic function decomposition method and device for exclusive or majority logic and electronic equipment

Also Published As

Publication number Publication date
CN111259609B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
Branicky Multiple Lyapunov functions and other analysis tools for switched and hybrid systems
Kohavi et al. Switching and finite automata theory
Wang et al. On the system algebra foundations for granular computing
Inuiguchi et al. Satisficing solutions and duality in interval and fuzzy linear programming
US20120078605A1 (en) Methods and Apparatuses for Circuit Simulation
Dueck et al. Reversible function synthesis with minimum garbage outputs
US7432738B1 (en) Reversible sequential apparatuses
Taha Reversible logic synthesis methodologies with application to quantum computing
Unger Tree realizations of iterative circuits
CN113051867A (en) Method for automated design of integrated circuits
CN111259609A (en) Optimal implication logic representation method of digital circuit logic function
Gruber et al. Sparsity-aware finite abstraction
Pang et al. Positive Davio-based synthesis algorithm for reversible logic
CN109753685B (en) Logic error rate calculation method
TaŞiran et al. Language containment of non-deterministic ω-automata
Rosenbloom Monotone real circuits are more powerful than monotone boolean circuits
Joy et al. Implementation of a FIR filter model using reversible Fredkin Gate
Bandyopadhyay et al. ESOP-based synthesis of reversible circuit using improved cube list
CN109359334B (en) Method for converting combined circuit gate-level netlist into AIGER format file
Borowik et al. Cost-efficient synthesis for sequential circuits implemented using embedded memory blocks of FPGA's
Pang et al. A novel method of synthesizing reversible logic
KR102568174B1 (en) Ternary-to-binary converter and ternary-to-binary conversion method thereof, and binary-to-ternary converter and binary-to-ternary conversion method thereof
Jiang BDD-based logic synthesis of MEM relay circuits
Siddiqui et al. Variable ordering of BDD mapped multi-input multi-output adders using modified genetic algorithm
Chen et al. Towards Optimal Logic Representations for Implication-Based Memristive Circuits

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