
The simplification problem of logical functions is investigated via the matrix method. First, necessary and sufficient conditions are put forward for the decomposition of logical matrices. Based on this, several criteria are proposed for the simplification of logical functions. Furthermore, an algorithm, which can derive simpler logical forms, is developed, and illustrative examples are given to verify the effectiveness. Finally, the obtained theoretical results are applied to the simplification of electric circuits.
Citation: Jun-e Feng, Rong Zhao, Yanjun Cui. Simplification of logical functions with application to circuits[J]. Electronic Research Archive, 2022, 30(9): 3320-3336. doi: 10.3934/era.2022168
[1] | Jin Wang . Least squares solutions of matrix equation AXB=C under semi-tensor product. Electronic Research Archive, 2024, 32(5): 2976-2993. doi: 10.3934/era.2024136 |
[2] | Caiwen Chen, Tianxiu Lu, Ping Gao . Chaotic performance and circuitry implement of piecewise logistic-like mapping. Electronic Research Archive, 2025, 33(1): 102-120. doi: 10.3934/era.2025006 |
[3] | Hankang Ji, Yuanyuan Li, Xueying Ding, Jianquan Lu . Stability analysis of Boolean networks with Markov jump disturbances and their application in apoptosis networks. Electronic Research Archive, 2022, 30(9): 3422-3434. doi: 10.3934/era.2022174 |
[4] | Fenggang Yuan, Cheng Tang, Zheng Tang, Yuki Todo . A model of amacrine cells for orientation detection. Electronic Research Archive, 2023, 31(4): 1998-2018. doi: 10.3934/era.2023103 |
[5] | Xinling Li, Xueli Qin, Zhiwei Wan, Weipeng Tai . Chaos synchronization of stochastic time-delay Lur'e systems: An asynchronous and adaptive event-triggered control approach. Electronic Research Archive, 2023, 31(9): 5589-5608. doi: 10.3934/era.2023284 |
[6] |
Jin Wang, Jun-E Feng, Hua-Lin Huang .
Solvability of the matrix equation |
[7] | Feibiao Zhan, Jian Song, Shenquan Liu . The influence of synaptic strength and noise on the robustness of central pattern generator. Electronic Research Archive, 2024, 32(1): 686-706. doi: 10.3934/era.2024033 |
[8] | Yan Xie, Rui Zhu, Xiaolong Tan, Yuan Chai . Inhibition of absence seizures in a reduced corticothalamic circuit via closed-loop control. Electronic Research Archive, 2023, 31(5): 2651-2666. doi: 10.3934/era.2023134 |
[9] | Weiran Ding, Jiansong Li, Yumeng Jia, Wanru Yang . Tractability of L2-approximation and integration over weighted Korobov spaces of increasing smoothness in the worst case setting. Electronic Research Archive, 2025, 33(2): 1160-1184. doi: 10.3934/era.2025052 |
[10] | Weishang Gao, Qin Gao, Lijie Sun, Yue Chen . Design of a novel multimodal optimization algorithm and its application in logistics optimization. Electronic Research Archive, 2024, 32(3): 1946-1972. doi: 10.3934/era.2024089 |
The simplification problem of logical functions is investigated via the matrix method. First, necessary and sufficient conditions are put forward for the decomposition of logical matrices. Based on this, several criteria are proposed for the simplification of logical functions. Furthermore, an algorithm, which can derive simpler logical forms, is developed, and illustrative examples are given to verify the effectiveness. Finally, the obtained theoretical results are applied to the simplification of electric circuits.
Logic algebra was first given by George Boole in 1854 to describe the laws of human thought [1], and that is why we call it Boolean algebra. Then, Boolean logic was used to design circuits by Claude Shannon in 1938 [2]. The functions used in circuits of computers and other electronic devices (e.g., switch devices and optical devices) are all logical (Boolean) ones, in which the input and output variables all belong to {0,1} with 0 and 1 representing "off" and "on", respectively. In all Boolean operations, there are three important ones, which are negation (complementation), disjunction (Boolean sum) and conjunction (Boolean product). Other operations in Boolean algebra can be expressed by these three ones, so the set of these three operations is called an adequate set [3]. Although there are some smaller adequate sets, the adequate set with these three operations is most commonly used. In practical circuits of a computer, these three operations are implemented by the Invertor logic gate, OR logic gate and AND logic gate, the number of which directly affects the efficiency of a combinational circuit. The circuits are usually implemented by the disjunctive normal form (also called the sum-of-products expansion) [2,5,6]. There are often some terms unnecessary in the disjunctive normal form. For example, (x∧y∧z)∨(x∧ˉy∧z) can be simplified to x∧z. Here, x,y,z∈{0,1} are logical variables, ˉy represents the complementation of logical variable y, and ∨,∧ are the operations disjunction and conjunction, respectively. It is obvious that the later one implemented by only one logic gate is simpler than the former one, which requires four logic gates, as shown in Figure 1. Therefore, the minimization or simplification of the disjunctive normal form is very important both to the cost and the efficiency of computers and other electronic devises.
Simplification of the disjunctive normal form means not only reduction of the number of the disjunction terms, but also reduction of the number of conjunctions in every disjunction term. The following is a review of the research status of minimizing logical functions. In 1953, Maurice Karnaugh proposed the Karnaugh map method to minimize the disjunctive normal form by hand [4]. However, the Karnaugh map method can simplify circuits with up to six variables. In fact, the method becomes rather complex even for five or six variables. Then, in the 1960s, the Quine-McCluskey method was invented to minimize circuits, which can be automatically done by a computer. Circuits with ten variables can be simplified via the Quine-McCluskey method. Since then, newer algorithms have been devised for minimizing circuits ([5] and [6]), and some of them can handle circuits with up to 25 variables. Some other new methods, such as by binary decision diagrams [7] and cube algebra [8], for the simplification of logical functions have also been proposed, but they are all graph-based approaches. It has been proved that the problem of minimizing circuits is an NP-complete problem [4]. In practice, it is enough to simplify circuits with a larger number of literals, and not necessary to minimize them.
On the other hand, Boolean functions can be expressed in algebraic forms via the semi-tensor product of matrices, which was first proposed by Prof. Cheng and his colleagues [9]. Based on the algebraic forms, investigations of Boolean networks have arrived at a new level. The earliest analysis and control on Boolean networks can be found in the literature [10]. Since then, a variety of research results on Boolean networks have been obtained. Here, we give some recent ones. Pinning controllability and set controllability of BNs were considered in [11] and [12], respectively. Via matrix equations, necessary and sufficient conditions for observability [13] were given, and then the minimum-time control for observability of BNs was studied in [14]. Note that observability aims to determine the initial state by the knowledge of input-output data. Correspondingly, detectability or reconstructibility of BNs, aiming to determine the current state by the knowledge of input-output data, was also discussed in [15,16]. Furthermore, state feedback control [17,18], output feedback control [19] and aperiodic sampled-data control [20] for stabilization of BNs were taken into consideration. In addition, the optimal control problem [21,22,23], the disturbance decoupling problem [24,25] and other control problems [26,27,28,29,30] have also achieved important research results one after another.
Since the Boolean network is studied via its algebraic form, the corresponding controllers or realizations are all obtained in terms of algebraic expressions. The algebraic expression should be transformed into its logical form, which only can be implemented in practice. [31] proposed a general method for the transformation from the algebraic form to the logical one. If the algebraic expression has some special structure, then its logical form often is complex only using the general transformation method of [31]. As analysis above, it is difficult to implement the complex logical function in practice, and it will take more cost. Therefore, in the process of transformation, we should simply the algebraic expressions if they have some special forms.
In this paper, we propose a matrix-based method to simplify logical functions. The main contributions of the paper are summarized as follows.
1) The decomposition conditions of a logical matrix into the Kronecker product of some (logical) matrices are first proposed.
2) Several criteria under which the algebraic expressions of logical functions can be simplified are presented. Combining with the method of [31], an algorithm is devised for the simplification of logical functions.
3) Moreover, the results of this paper are applicable to the design and simplification of circuits.
The rest of this paper is organized as follows: Some notations and necessary preliminaries are given in Section 2. In Section 3, the decomposition of logical matrices is addressed. Section 4 discusses the simplification of logical functions, and at the same time, several criteria and corresponding algorithm are presented. In Section 5, the results of this paper are applied to the design of circuits. Finally, Section 6 makes the conclusion to this paper.
In this section, we will introduce some notations and some necessary preliminaries, which will be used throughout this paper. First, we list the notations, most of which are from the literature [10].
● Mm×n: the set of m×n real matrices. Denote Mm=Mm×1.
● D:={0,1}, where 1∼T means "true" and 0∼F means "false". A logical variable A takes value from D, expressed as A∈D. Identify T=1∼δ12, F=0∼δ22.
● δin: the i-th column of the identity matrix In. Denote Δn:={δin|i=1,⋯,n} and Δ:=Δ2.
● 1n:=δ1n+δ2n+⋯+δnn.
● For a matrix L∈Mm×n, denote by Coli(L) and Col(L) the i-th column of L and the set of all columns of L, respectively.
● Matrix L∈Mm×n is called a logical matrix if Col(L)⊂Δn. In particular, L is called a logical vector when n=1. Denote by Lm×n the set of m×n logical matrices.
● If L∈Ln×r, by definition it can be expressed as L=[δi1n,δi2n,⋯,δirn]. For the sake of compactness, it is briefly denoted by L=δn[i1,i2,⋯,ir].
● For A=(aij)∈Mm×n,B=(bij)∈Mp×q, the Kronecker product of matrices A and B is defined as
A⊗B=(a11Ba12B…a1nBa21Ba22B…a2nB⋮⋮⋱⋮am1Bam2B…amnB)∈Mmp×nq. |
● Let A∈Mm×n,B∈Mp×q,t=lcm(n,p). Then, the semi-tensor product (STP) of A and B is
A⋉B:=(A⊗It/n)(B⊗It/p), |
where lcm(n,p) represents the least common multiple of n and p.
When n=p, A⋉B is the traditional matrix product, which means that STP is a generalization of the traditional matrix product. It is easy to check that STP keeps all the properties of hte traditional matrix product available.
Moreover, STP satisfies a pseudo commutative law. For any column vector x∈Mt and any matrix A∈Mm×n, we have
x⋉A=(It⊗A)⋉x. | (2.1) |
In this paper, the symbol "⋉" represents the semi-tensor product of matrices, which is often omitted in most places. We refer to [9] for the details.
Definition 1. Define a swap matrix as
W[m,n]=[Im⊗δ1n,Im⊗δ2n,⋯,Im⊗δnn]. |
The following properties are fundamental for swap matrices.
Lemma 1. Given two column vectors x∈Mn,y∈Mm,
W[m,n]⋉x⋉y=y⋉x. |
Definition 2. A power-reducing matrix is defined as
Prk=diag{δ1k, δ2k, ⋯, δkk}. |
Then, we have the following lemma.
Lemma 2. Given any column vector x∈Δk,
x2=Prkx. |
Using STP and vector expression of logical variables, any logical function can be equivalently converted into its algebraic form [9].
Lemma 3. If y=f(x1,x2,…,xn):Dn→D is a Boolean function, then there exists a unique matrix Mf∈L2×2n, called the structure matrix of f, such that in vector form y=Mf⋉ni=1xi, with y=δ2−y2∈Δ2 and xi=δ2−xi2∈Δ2.
To illustrate the lemma above, we give the structure matrices of the three commonly used logical operators.
Example 1. (i) Complementation:
ˉX:=1−X,X∈D. | (2.2) |
Its structure matrix is
Mn=δ2[2, 1]. |
(ii) Conjunction:
X∧Y:=min(X,Y),X,Y∈D. | (2.3) |
Its structure matrix is
Mc=δ2[1, 2, 2, 2]. | (2.4) |
(iii) Disjunction:
X∨Y:=max(X,Y),X,Y∈D. | (2.5) |
Its structure matrix is
Md=δ2[1, 1, 1, 2]. | (2.6) |
Remark 1. It is obvious that M0=δ2[2, 2] and M0=δ2[1, 1] are the structure matrices of constants 0 and 1, respectively.
Example 2. Given two logical functions F(X,Y)=(X∧Y)∨(ˉX∧Y)∨(X∧ˉY) and G(X,Y)=X∨(ˉX∧Y), compute their structure matrices.
Denote by x,y∈Δ and f,g:Δ2→Δ the vector forms of logical variables X,Y and logical functions F,G. Then, we have
f=M2dMcxyMcMnxyMcxMny=M2dMc(I4⊗McMn)Pr4(I4⊗Mc)xyxMny=M2dMc(I4⊗McMn)Pr4(I4⊗Mc)(I8⊗Mn)Pr4xy=δ2[1, 1, 1, 2]xy,g=MdxMcMnxy=Md(I2⊗McMn)x2y=Md(I2⊗McMn)Pr2xy=δ2[1, 1, 1, 2]xy. |
It is noticed that these three logical functions F, G and W=X∨Y do have the same structure matrix. In fact, they are different expressions of the same logical function. In the three logical functions, the simplest one is W=X∨Y, and the most complex one is F. The simpler one is easier to implement in practical circuits. However, it is often difficult to find the simplest one, since the computation complex. Hence, we hope to propose a general method to simplify logical functions.
On the other hand, from a given algebraic form of a logical function, we can get the corresponding logical form by the following lemma [31], which comes from Shannon's decomposition [32].
Lemma 4. Let Mf∈L2×2n be the structure matrix of logical function y=f(x1,x2,…,xn). Then,
y=[x1∧f1(x2,…,xn)]∨[ˉx1∧f2(x2,…,xn)], | (2.7) |
where the structure matrix of fi(⋅) is Mfδi2.
Finally, to simplify the logical function, we also need the following lemma, which will be used in the decomposition of logical matrices.
Lemma 5.
(A⊗B)(C⊗D)=(AC)⊗(BD). |
In this section, we will propose some decomposition results of logical matrices using Lemma 5.
Proposition 1. Consider logical matrix L=[L1 L2 … Lk] with Li∈Lm×l.
1) L=ˉL⊗1Tl with ˉL∈Lm×k if and only if
Col1(Li)=Col2(Li)=…=Coll(Li), i=1,2,…,k. | (3.1) |
Furthermore, if L=ˉL⊗1Tl then Coli(ˉL)=Colji(Li) for every 1≤ji≤l and i=1,2,…,k.
2) L=1Tk⊗ˉL with ˉL∈Lm×l if and only if
L1=L2=…=Lk. | (3.2) |
Furthermore, if L=1Tk⊗ˉL then ˉL=Li for every i=1,2,…,k.
Proof. We only prove the first item, and the other one can be proven via a similar method.
(Necessity) Since Li∈Lm×l and L=[L1 L2 … Lk], we have L∈Lm×kl. If L=ˉL⊗1Tl then ˉL has k columns. Denote ˉL⊗1Tl=[ˉL1 ˉL2 … ˉLk], where
ˉLi=Coli(ˉL)⊗1Tl, i=1,2,…,k. |
From L=ˉL⊗1Tl, we derive Li=ˉLi, which means that all columns of Li are equal for every i=1,2,…,k.
(Sufficiency) If L=[L1 L2 … Lk] satisfying
Col1(Li)=Col2(Li)=…=Coll(Li), i=1,2,…,k, |
then
L=[Colj1(L1)⊗1Tl Colj2(L2)⊗1Tl … Coljk(Lk)⊗1Tl], 1≤ji≤l, i=1,2,…,k, |
which means that L has the form L=ˉL⊗1Tl with
ˉL=[Colj1(L1) Colj2(L2) … Coljk(Lk)], |
with 1≤ji≤l, i=1,2,…,k. The proof is completed.
Example 3. i) Consider a logical matrix
L=[00111100]. |
Take m=k=l=2. It is easy to see L=[L1 L2] and Col1(Li)=Col2(Li),i=1,2. Thus, from item 1) of Proposition 1, we have L=ˉL⊗1T2 with
ˉL=[0110]. |
ii) Consider a logical matrix
L=[011011100100]. |
Take m=k and l=3. It is easy to see L=[L1 L2] and L1=L2. Thus, from item 2) of Proposition 1, we have L=1T2⊗ˉL with
ˉL=[011100]. |
Combining the two items of Proposition 1, we have the following corollary easily.
Corollary 1. Consider logical matrix L=[L1 L2 … Lk] with Li∈Lm×lh. Then, L=1Tk⊗ˉL⊗1Th with ˉL∈Lm×l if and only if
L1=L2=…=Lk, |
and
Colαh+1(Li)=Colαh+2(Li)=…=Colαh+h(Li), | (3.3) |
where α=0,1…,l−1 and i=1,2,…,k. Furthermore, if L=1Tk⊗ˉL⊗1Th then
ˉL=[Col1(Li),Colh+1(Li),⋯,Colh(l−1)+1(Li)] |
for every i=1,2,…,k.
Proposition 1 and Corollary 1 decompose a logic matrix into the Kronecker product of one logic matrix and row vector 1Tk. 1Tk can be seen as a special logical matrix which belongs to L1×k. Next, one more general decomposition case is proposed using a similar idea.
Proposition 2. Assume logical matrix L=[L1 L2 … Lk] with Li∈Lm×hl, and Li=[Li1 Li2 … Lih] with Lij∈Lm×l,j=1,2,…,h i=1,2,…,k. Then, L=ˉL(Ik⊗1Th⊗Il) with ˉL∈Lm×kl if and only if
Li1=Li2=…=Lih, i=1,2,…,k. | (3.4) |
Furthermore, if L=ˉL(Ik⊗1Th⊗Il), then
ˉL=[L1j1 L2j2 … Lkjk], 1≤ji≤h, i=1,2,…,k. | (3.5) |
Proof. Via computation, we have
Ik⊗1Th⊗Il=diag{k⏞N N⋯ N}∈Lkl×khl |
with N=[h⏞Il Il ⋯ Il]. Then, it follows that
ˉL(Ik⊗1Th⊗Il)=[ˉL1 ˉL2 … ˉLk] |
where ˉLi=[ˉLi1 ˉLi2 … ˉLih],i=1,2,…,k, and
ˉLi1=ˉLi2=…=ˉLih=[Colˉi+1(ˉL) Colˉi+2(ˉL) ⋯ Colˉi+l(ˉL)] |
with ˉi=(i−1)⋅l,i=1,2,…,k. Hence, it is obvious that L=ˉL(Ik⊗1Th⊗Il) with ˉL∈Lm×kl if and only if
Li1=Li2=…=Lih, i=1,2,…,k. |
Furthermore, it is easy to have ˉL=[L1j1 L2j2 … Lkjk]. The proof is completed.
Example 4. Consider the logical matrix
L=[1010000001011111]. |
Take m=k=h=l=2. It is easy to see L=[L1 L2], L1=[L11 L12], L2=[L21 L22], and
L11=L12=[1001], L21=L22=[0011]. |
It is obvious that L satisfies that condition of Proposition 2. Thus, we have L=ˉL(I2⊗1T2⊗I2) with
ˉL=[10000111]. |
Propositions 1 and 2 will take a key role in the simplification of logical functions.
From Lemma 5 of Section 3, it is easy to get the following results, which will be useful to the subsequent simplification.
Proposition 3. For x∈Δn1, y∈Δn2, z∈Δn3, L1∈Lm×n1, L2∈Lm×n2 and L3∈Lm×n1n3, we have the following
1)
L1x=(L1⊗1Tn2)xy. |
2)
L2y=(1Tn1⊗L2)xy. |
3)
L2yz=(1Tn1⊗L2⊗In3)xyz. |
4)
L3xz=L3(In1⊗1Tn2⊗In3)xyz. |
Combining Lemma 5 with xy=x⊗y and xyz=x⊗y⊗z, the results will be obtained, so it is omitted here for the brevity.
The function of Proposition 3 is to delete the redundant variables in a logic function. For a given algebraic form y=L⋉ni=1xi with xi∈Δ and L∈L2×2n, we could get its corresponding logical function using Lemma 4 repeatedly. However, we hope to get a simpler form of it. In order to derive a simpler logical function, we simplify the algebraic form in the process of using Lemma 4. The following corollary is obtained directly from Propositions 1 to 3 and Corollary 1.
Corollary 2. Considering a given algebraic form y=L⋉ni=1xi with xi∈Δ and L∈L2×2n, we have the following results.
1) If there exists positive integer l<n, satisfying L=ˉL⊗1T2l, then
y=ˉL⋉n−li=1xi. |
2) If there exist. positive integer k<n, satisfying L=1T2k⊗ˉL, then
y=ˉL⋉ni=k+1xi. |
3) If there exist positive integers k and l with k+l<n, satisfying L=1T2k⊗ˉL⊗1T2l, then
y=ˉL⋉n−li=k+1xi. |
4) If there exist positive integers k,h,l with k+h+l=n, satisfying L=ˉL(I2k⊗1T2h⊗I2l), then
y=ˉL⋉ki=1xi⋉ni=k+h+1xi. |
Based on the analysis above, we could derive a simpler logical form if we use repeatedly Lemma 4 together with Corollary 2. Next, we give the simplification algorithm of a given logical function y=f(x1,x2,…,xn).
Algorithm 1 Simplification of Logical Functions |
Input: A logical function f. Output: The simplified logical function f. Step 1: According to Lemma 3, write the structure matrix of logical function f. Step 2: Check whether L satisfies the conditions of Propositions 1–2 and Corollary 1. If yes, then simplify the algebraic form y=L⋉ni=1xi according to Corollary 2, and delete the redundant variables. If not, then go to the next step. Step 3: Use Lemma 4 to have where Li:=Lδi2 is the structure matrix fi(⋅), i=1,2. Step 4: If Li∈L2×2, end the algorithm. Otherwise, for i=1,2, taking L=Li with logical functions fi, return to Step 2. |
Remark 2. In Algorithm 1, the time complexity of Step 1 is O(2n). The number of iterations of Steps 2–4 is n−1. Then, the time complexity of Steps 2–4 is O(2n)+O(2n−1)+⋯+O(22)=O(2n). Consequently, the time complexity of Algorithm 1 is O(2n)+O(2n)=O(2n).
Remark 3. 1) In [33], two methods, including the K-maps and the Quine-McCluskey method, are introduced. However, K-maps are awkward to use when there are more than four variables. On the other hand, the K-maps is a graphical method, and the Quine-McCluskey method is based on tabular representation.
2) In this paper, a matrix-based method is proposed to simplify logical functions. It provides a new point of view for simplifying logical functions and is more convenient for programming by computers. On the other hand, our method is not limited to the number of variables and is only subject to the computer configuration. These are the main differences and innovations of this paper, compared with the K-maps and the Quine-McCluskey method.
The following example used to interpret the simplification of a logical function is from [33] (see Example 10, Chapter 12.4).
Example 5. Simplify the following logical function:
f=(w∧x∧y∧ˉz)∨(w∧ˉx∧y∧z)∨(w∧ˉx∧y∧ˉz)∨(ˉw∧x∧y∧z)∨(ˉw∧x∧ˉy∧z)∨(ˉw∧ˉx∧y∧z)∨(ˉw∧ˉx∧ˉy∧z). | (4.1) |
Take the variable order w,x,y and z. Denote by F,W,X,Y and Z the corresponding vectors of f,w,x,y and z, respectively. Then, we have the algebraic form F=LWXYZ of logical function f with
L=δ2[2 1 2 2 1 1 2 2 1 2 1 2 1 2 1 2]. |
Using Lemma 4, we have
f=(w∧f1(x,y,z))∨(ˉw∧f2(x,y,z)) | (4.2) |
with L1=δ2[2 1 2 2 1 1 2 2] and L2=δ2[1 2 1 2 1 2 1 2] being structure matrices of logical functions f1 and f2, respectively.
Using Lemma 4 again, it follows that
f1=(x∧f11(y,z))∨(ˉx∧f12(y,z)) | (4.3) |
with L11=δ2[2 1 2 2] and L12=δ2[1 1 2 2] being structure matrices of logical functions f11 and f12, respectively. Then,
f11=(y∧f111(z))∨(ˉy∧f112(z)) | (4.4) |
where the structure matrices of f111 and f112 are L111=δ2[2 1] and L112=δ2[2 2]. From L111 and L112, we have f111=ˉz and f112≡0, which implies that f11=y∧ˉz.
Notice L12=I2⊗1T2 and f12=y. Thus, we derive that
f1=(x∧y∧ˉz))∨(ˉx∧y). | (4.5) |
On the other hand, since L2=1T4⊗I2, we have L2XYZ=Z, which implies that f2=z.
Therefore, we obtain that
f=(w∧x∧y∧ˉz))∨(w∧ˉx∧y)∨(ˉw∧z). | (4.6) |
Using the Quine-McCluskey method, [33] derived that simplified functions are
f=(w∧y∧ˉz)∨(w∧ˉx∧y)∨(ˉw∧z) |
and
f=(w∧y∧ˉz)∨(ˉx∧y∧z)∨(ˉw∧z). |
It is easy to see that both (4.6) and [33] require seven logical gates to implement the logical function. Furthermore, our method is simpler than [33].
Remark 4. It should be noticed that the order of variables often affects the simplification of logical functions. Different orders often result in different forms, since different algebraic forms correspond to different orders.
We present a simple example to depict this point.
Example 6. Consider the following logical function:
f=(x∧y∨¯z)∨(x∧¯y∧¯z). | (4.7) |
Denote by F, X, Y and Z the corresponding vectors of f, x, y and z, respectively.
If we take the variable order x, y, z, then we can get the algebraic form F=L1XYZ of logical function f with
L1=δ2[1 1 2 1 2 1 2 1]. |
Using Algorithm 1, it is easy to simplify the logical function f as
f=(x∧y)∨(x∧¯y∧¯z)∨(¯x∧¯z). | (4.8) |
meanwhile, if we take the variable order y, z, x, then the algebraic form of f is F=L2YZX with
L2=δ2[1 2 2 2 1 1 1 1]. |
Using Algorithm 1, we obtain that
f=(y∧z∧x)∨¯y. | (4.9) |
It is clear that both (4.7) and (4.8) require six logic gates, while (4.9) requires three logic gates.
On the other hand, the method for simplifying logical functions is useful for constructing the logic forms of state feedback controllers. The following example is employed to give an explanation.
Example 7. Consider the example in [34], where three state feedback controllers were designed to make set stabilization for Markovian jump Boolean control networks. However, [34] only gave the algebraic forms of the controllers: ui(t)=Kix(t), i=0,1,2 with
K0=K1=δ2[1 1 1 1 1 1 1 1], |
K2=δ2[1 1 2 2 1 1 2 2]. |
It is easy to see that u0=u1=1 is the logical form of the former two. As for the third one u2, in light of Algorithm 1, its logical form is derived as u2=x2.
The efficiency and the cost of designing a combinational circuit depend on the number and arrangement of its logic gates. A circuit in computers or other electric devices is often implemented by three logic gates: "OR" logic gate, "And" logic gate and "Inverter" logic gate. The process of designing a combinational circuit requires the table specifying the output for the combination of inputs. In computers, we always use binary expansions to code decimal expansions. For instance, decimal number 7 is represented by 0111, and 256 is encoded as 100,000,000.
To illustrate the applications of our method on the design of circuits, we build a circuit about decimal numbers, and the following example is from [33] (Example 8 in Chapter 12.4).
Example 8. Using OR logic gates, AND logic gates and Inverter logic gates, build a circuit that produces an output 1 if the decimal digit is 5 or greater than 5 and an output 0 if the decimal digit is less than 5.
Since there are 16 combinations of four bits and only 10 decimal digits, there are 6 ones that are not used to encode digits. This gives us freedom in producing a simpler circuit with the desired output because the output values for all those combinations that never occur can be arbitrarily chosen.
Let f(w,x,y,z) denote the output of the circuit, where wxyz is a binary expansion of a decimal digit. The values of f are shown in Table 1. Take the variable order w,x,y and z. Denote by F,W,X,Y and Z the corresponding vectors of f,w,x,y and z, respectively. From TABLE 1, we have the algebraic form F=LWXYZ of logical function f with
L=δ2[∗ ∗ ∗ ∗ ∗ ∗ 1 1 1 1 1 2 2 2 2 2], |
Digit | w | x | y | z | f |
0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 1 | 0 |
2 | 0 | 0 | 1 | 0 | 0 |
3 | 0 | 0 | 1 | 1 | 0 |
4 | 0 | 1 | 0 | 0 | 0 |
5 | 0 | 1 | 0 | 1 | 1 |
6 | 0 | 1 | 1 | 0 | 1 |
7 | 0 | 1 | 1 | 1 | 1 |
8 | 1 | 0 | 0 | 0 | 1 |
9 | 1 | 0 | 0 | 1 | 1 |
where ∗ is freedom, which can either take 1 or 2.
We take all ∗ by 1, and then
f=(w∧f1(x,y,z))∨(ˉw∧f2(x,y,z)) |
with L1=δ2[1 1 1 1 1 1 1 1] and L2=δ2[1 1 1 2 2 2 2 2] being structure matrices of logical functions f1 and f2, respectively.
It is obvious that f1≡1 since L1=δ2[1 1 1 1 1 1 1 1]. Using Lemma 4 again, it follows that
f2=(x∧f21(y,z))∨(ˉx∧f22(y,z)) |
with L21=δ2[1 1 1 2] and L22=δ2[2 2 2 2] being structure matrices of logical functions f21 and f22, respectively. Then, f22≡0, and
f21=(y∧f211(z))∨(ˉy∧f212(z)). |
where the structure matrices of f211 and f212 are L211=δ2[1 1] and L212=δ2[1 2]. From L211 and L212, we have f211≡1 and f212=z. Thus, we derive that
f2=(x∧y)∨(x∧ˉy∧z). |
Hence, we derive that f=w∨(ˉw∧x∧y)∨(ˉw∧x∧ˉy∧z), which can be used to implement the circuit using 5 logic gates.
In fact, noticing the detailed form of logical function f, we can still simplify it slightly. If w=1, then f=w∨(x∧y)∨(x∧ˉy∧z)=w=1; if w=0, then f=w∨(x∧y)∨(x∧ˉy∧z)=(x∧y)∨(x∧ˉy∧z), which derives the simpler form
f=w∨(x∧y)∨(x∧ˉy∧z). | (5.1) |
Then, logical function (5.1) can be implemented by a circuit using only 4 logic gates, which is shown in Figure 2.
In [33], using the freedom of 6 combinations of four bits, [33] obtained three implementations. Two of them require 7 logic gates, and one needs 3 logic gates. Compared to the K-map method, our method could be more systematic. On the other hand, if we take other orders of variables w,x,y,z, or take value 2 for some ∗ in the structure matrix L, we can get other implementations.
Example 9. Consider a circuit which was given in [33] (see Example 4, Chapter 12), and the diagram of this circuit is shown in Figure 3. As we can see from Figure 3, to implement this circuit, 26 logic gates are needed. Next, we use Algorithm 1 to simplify this circuit.
First, we can convert f=(w∧x∧ˉy∧ˉz)∨(w∧ˉx∧y∧z)∨(w∧ˉx∧y∧ˉz)∨(w∧ˉx∧ˉy∧ˉz)∨(ˉw∧x∧ˉy∧ˉz)∨(ˉw∧ˉx∧y∧ˉz)∨(ˉw∧ˉx∧ˉy∧ˉz) into its algebraic form:
F=LWXYZ=δ2[2221112122212121]WXYZ, | (5.2) |
where L=δ2[2221112122212121].
Similar to the iteration in Example 5 or 8, it follows from Algorithm 1 that the simplified logical function f is
f=(x∧ˉy∧ˉz)∨(w∧ˉx∧y)∨(ˉx∧ˉz). | (5.3) |
Thus, the circuit can be simplified as Figure 4, which only needs 10 logic gates. In [33], using the K-maps method, f was simplified as f=(ˉy∧ˉz)∨(w∧ˉx∧y)∨(ˉx∧ˉz), which also needs 10 logic gates. This shows that our method is effective for the simplification of circuits. Compared with the K-maps that is a graphical method, our method is matrix-based, which provides a new perspective to simplify logical functions.
In this paper, the simplification problem of logical functions has been addressed. First, the decomposition conditions for logical matrices have been derived. Based on this, the simplification of logical functions has been investigated. Several criteria and an algorithm for simplifying logical functions have been proposed. Furthermore, the method in this paper has been applied to the design and simplification of circuits.
It has been mentioned in Remark 4 that the order of variables often affects the simplification of logical functions, which has been shown via Example 6. Therefore, in order to get a simpler form of a given logic function, we should try more different variable orders, even try all different orders to get the simplest one. However, it may lead to more computation complexity. Thus, how to get a simpler form with less computation complexity is of great significance in practice and worthy of further investigation in the future works.
This work was supported by the National Natural Science Foundation (NNSF) of China under Grant 61877036.
The authors declare that there are no conflicts of interest.
[1] |
K. Hilary, The laws of thought, Philoso. Phenomen. Res., 52 (1992), 895–911. https://doi.org/10.2307/2107916 doi: 10.2307/2107916
![]() |
[2] |
C. E. Shannon, A symbolic analysis of relay and switching circuits, Trans. Am. Inst. Electr. Eng., 57 (1938), 713–723. https://doi.org/10.1109/t-aiee.1938.5057767 doi: 10.1109/t-aiee.1938.5057767
![]() |
[3] |
D. Cheng, J. Feng, J. Zhao, S. Fu, On adequate sets of multi-valued logic, J. Franklin Inst., 358 (2021), 6705–6722. https://doi.org/10.1016/j.jfranklin.2021.07.003 doi: 10.1016/j.jfranklin.2021.07.003
![]() |
[4] |
M. Karnaugh, The map method for synthesis of combinational logic circuits, Trans. Am. Inst. Electr. Eng., 72 (1953), 593–599. https://doi.org/10.1109/TCE.1953.6371932 doi: 10.1109/TCE.1953.6371932
![]() |
[5] | J. P. Hayes, Introduction to digital logic design, Prent. Hall, 1993. https://doi.org/978-0-201-15461-0 |
[6] | R. H. Katz, G. Borriello, Contemporary logic design, Prent. Hall, 2004. https://doi.org/10.1016/0026-2692(95)90052-7 |
[7] | X. L. Wang, X. Y. Zhang, W. L. Wang, A new representation and simplification method of logic function, in International Conference on Computer & Automation Engineering, 2010. https://doi.org/10.1109/ICCAE.2010.5451556 |
[8] |
S. Kahramanli, S. Guenes, S. Sahan, F. Basciftci, A new method based on cube algebra for the simplification of logic functions, Arab. J. Sci. Eng., 32 (2007), 101–114. https://doi.org/10.1016/j.agee.2006.06.020 doi: 10.1016/j.agee.2006.06.020
![]() |
[9] |
D. Cheng, Semi-tensor product of matrices and its applications-a survey, Methods Appl. Anal., 3 (2007), 641–668. https://doi.org/10.1007/10984413_5 doi: 10.1007/10984413_5
![]() |
[10] | D. Cheng, H. Qi, Z. Li, Analysis and control of boolean networks: A semi-tensor product approach, London: Springer-Verlag, 2011. https://doi.org/10.3724/SP.J.1004.2011.00529 |
[11] |
F. Li, Y. Tang, Pinning controllability for a Boolean network with arbitrary disturbance inputs, IEEE Trans. Cybern., 51 (2019), 3338–3347. https://doi.org/10.1109/TCYB.2019.2930734 doi: 10.1109/TCYB.2019.2930734
![]() |
[12] |
Y. Li, H. Li, G. Xiao, Set controllability of Markov jump switching Boolean control networks and its applications, Nonlinear Anal. Hybri., 45 (2022), 101179. https://doi.org/10.1016/j.nahs.2022.101179 doi: 10.1016/j.nahs.2022.101179
![]() |
[13] |
Y. Yu, M. Meng, J. Feng, Observability of Boolean networks via matrix equations, Automatica, 111 (2020), 108621. https://doi.org/10.1016/j.automatica.2019.108621 doi: 10.1016/j.automatica.2019.108621
![]() |
[14] |
S. Zhu, J. Lu, L. Lin, Y. Liu, Minimum-time and minimum-triggering control for the observability of stochastic Boolean networks, IEEE Trans. Autom. Control, 67 (2022), 1558–1565. https://doi.org/10.1109/TAC.2021.3069739 doi: 10.1109/TAC.2021.3069739
![]() |
[15] |
B. Wang, J. Feng, H. Li, Y. Yu, On detectability of Boolean control networks, Nonlinear Anal. Hybri., 36 (2020), 100859. https://doi.org/10.1016/j.nahs.2020.100859 doi: 10.1016/j.nahs.2020.100859
![]() |
[16] |
Z. Gao, B. Wang, J. Feng, T. Li, Finite automata approach to reconstructibility of switched Boolean control networks, Neurocomputing, 454 (2021), 34–44. https://doi.org/10.1016/j.neucom.2021.05.019 doi: 10.1016/j.neucom.2021.05.019
![]() |
[17] |
C. V. A. Yerudkar, L. Glielmo, Feedback stabilization control design for switched Boolean control networks, Automatica, 115 (2020), 108934. https://doi.org/10.1016/j.automatica.2020.108934 doi: 10.1016/j.automatica.2020.108934
![]() |
[18] |
M. Meng, J. Lam, J. Feng, K. Cheung, Stability and stabilization of Boolean networks with stochastic delays, IEEE Trans. Autom. Control, 64 (2019), 790–796. https://doi.org/10.1109/TAC.2018.2835366 doi: 10.1109/TAC.2018.2835366
![]() |
[19] |
N. Bof, E. Fornasini, M. Valcher, Output feedback stabilization of Boolean control networks, Automatica, 57 (2015), 21–28. https://doi.org/10.1016/j.automatica.2015.03.032 doi: 10.1016/j.automatica.2015.03.032
![]() |
[20] |
J. Lu, L. Sun, D. W. C. Liu, Y. Ho, J. Cao, Stabilization of Boolean control networks under aperiodic sampled-data control, SIAM J. Control Optim., 56 (2018), 4385–4404. https://doi.org/10.1137/18M1169308 doi: 10.1137/18M1169308
![]() |
[21] |
Y. Wu, T. Shen, A finite convergence criterion for the discounted optimal control of stochastic logical networks, IEEE Trans. Autom. Control, 63 (2018), 262–268. https://doi.org/10.1109/TAC.2017.2720730 doi: 10.1109/TAC.2017.2720730
![]() |
[22] |
Y. Wu, X. Sun, X. Zhao, T. Shen, Optimal control of Boolean control networks with average cost: a policy iteration approach, Automatica, 100 (2019), 378–387. https://doi.org/10.1016/j.automatica.2018.11.036 doi: 10.1016/j.automatica.2018.11.036
![]() |
[23] |
Y. Wu, Y. Guo, M. Toyoda, Policy iteration approach to the infinite horizon average optimal control of probabilistic Boolean networks, IEEE Trans. Neural Netw. Learn. Syst., 32 (2021), 2910–2924. https://doi.org/10.1109/TNNLS.2020.3008960 doi: 10.1109/TNNLS.2020.3008960
![]() |
[24] |
S. Wang, H. Li, New results on the disturbance decoupling of Boolean control networks, IEEE Control Syst. Lett., 5 (2021), 1157–1162. https://doi.org/10.1109/LCSYS.2020.3017645 doi: 10.1109/LCSYS.2020.3017645
![]() |
[25] |
Y. Li, J. Zhu, B. Li, Y. Liu, J. Lu, A necessary and sufficient graphic condition for the original disturbance decoupling of Boolean networks, IEEE Trans. Autom. Control, 66 (2021), 3765–3772. https://doi.org/10.1109/TAC.2020.3025507 doi: 10.1109/TAC.2020.3025507
![]() |
[26] |
J. Zhang, J. Sun, Exponential synchronization of complex networks with continuous dynamics and Boolean mechanism, Neurocomputing, 307 (2018), 146–152. https://doi.org/10.1016/j.neucom.2018.03.061 doi: 10.1016/j.neucom.2018.03.061
![]() |
[27] |
R. Li, T. Chu, X. Wang, Bisimulations of Boolean control networks, SIAM J. Control Optim., 56 (2018), 388–416. https://doi.org/10.1137/17M1117331 doi: 10.1137/17M1117331
![]() |
[28] |
Q. Zhang, J. Feng, The solution and stability of continuous-time cross-dimensional linear systems, Front. Inf. Tech. El., 22 (2021), 210-221. https://doi.org/10.1631/FITEE.1900504 doi: 10.1631/FITEE.1900504
![]() |
[29] |
Y. Zheng, J. Feng, Output tracking of delayed logical control networks with multi-constraints, Front. Inf. Tech. El., 21 (2020), 316–323. https://doi.org/10.1631/FITEE.1900376 doi: 10.1631/FITEE.1900376
![]() |
[30] |
J. Yue, Y. Yan, Z. Chen, X. Jin, Identification of predictors of Boolean networks from observed attractor states, Math. Methods Appl. Sci., 42 (2019), 3848–3864. https://doi.org/10.1002/mma.5616 doi: 10.1002/mma.5616
![]() |
[31] |
D. Cheng, H. Qi, Controllability and observability of Boolean control networks, Automatica, 45 (2009), 1659–1667. https://doi.org/10.1007/s00034-014-9900-8 doi: 10.1007/s00034-014-9900-8
![]() |
[32] | M. D. Ciletti, Advanced digital design with the verilog HDL, Prent. Hall Upper Saddle River, 2003. https://doi.org/978-0-13-089161-7 |
[33] | K. H. Rosen, Discrete mathematics and its applications, New York: McGraw-Hill, 2002. https://doi.org/978-0-07-242434-8 |
[34] |
S. Zhu, J. Feng, The set stabilization problem for Markovian jump Boolean control networks: An average optimal control approach, Appl. Math. Comput., 402 (2021), 126133. https://doi.org/10.1016/j.amc.2021.126133 doi: 10.1016/j.amc.2021.126133
![]() |
Algorithm 1 Simplification of Logical Functions |
Input: A logical function f. Output: The simplified logical function f. Step 1: According to Lemma 3, write the structure matrix of logical function f. Step 2: Check whether L satisfies the conditions of Propositions 1–2 and Corollary 1. If yes, then simplify the algebraic form y=L⋉ni=1xi according to Corollary 2, and delete the redundant variables. If not, then go to the next step. Step 3: Use Lemma 4 to have where Li:=Lδi2 is the structure matrix fi(⋅), i=1,2. Step 4: If Li∈L2×2, end the algorithm. Otherwise, for i=1,2, taking L=Li with logical functions fi, return to Step 2. |
Digit | w | x | y | z | f |
0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 1 | 0 |
2 | 0 | 0 | 1 | 0 | 0 |
3 | 0 | 0 | 1 | 1 | 0 |
4 | 0 | 1 | 0 | 0 | 0 |
5 | 0 | 1 | 0 | 1 | 1 |
6 | 0 | 1 | 1 | 0 | 1 |
7 | 0 | 1 | 1 | 1 | 1 |
8 | 1 | 0 | 0 | 0 | 1 |
9 | 1 | 0 | 0 | 1 | 1 |
Algorithm 1 Simplification of Logical Functions |
Input: A logical function f. Output: The simplified logical function f. Step 1: According to Lemma 3, write the structure matrix of logical function f. Step 2: Check whether L satisfies the conditions of Propositions 1–2 and Corollary 1. If yes, then simplify the algebraic form y=L⋉ni=1xi according to Corollary 2, and delete the redundant variables. If not, then go to the next step. Step 3: Use Lemma 4 to have where Li:=Lδi2 is the structure matrix fi(⋅), i=1,2. Step 4: If Li∈L2×2, end the algorithm. Otherwise, for i=1,2, taking L=Li with logical functions fi, return to Step 2. |
Digit | w | x | y | z | f |
0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 1 | 0 |
2 | 0 | 0 | 1 | 0 | 0 |
3 | 0 | 0 | 1 | 1 | 0 |
4 | 0 | 1 | 0 | 0 | 0 |
5 | 0 | 1 | 0 | 1 | 1 |
6 | 0 | 1 | 1 | 0 | 1 |
7 | 0 | 1 | 1 | 1 | 1 |
8 | 1 | 0 | 0 | 0 | 1 |
9 | 1 | 0 | 0 | 1 | 1 |