A Novel Graphical Technique for Combinational Logic Representation and Optimization

We present a new technique for defining, analysing, and simplifying digital functions, through hand-calculations, easily demonstrable therefore in the classrooms. It can be extended to represent discrete systems beyond the Boolean logic. The method is graphical in nature and provides complete “implementation-free” description of the logical functions, similar to binary decision diagrams (BDDs) and Karnaugh-maps (K-maps). Transforming a function into the proposed representations (also the inverse) is a very intuitive process, easy enough that a person can hand-calculate these transformations. The algorithmic nature allows for its computing-based implementations. Because the proposed technique effectively transforms a function into a scatter plot, it is possible to represent multiple functions simultaneously. Usability of the method, therefore, is constrained neither by the number of inputs of the function nor by its outputs in theory. This, being a new paradigm, offers a lot of scope for further research. Here, we put forward a few of the strategies invented so far for using the proposed representation for simplifying the logic functions. Finally, we present extensions of the method: one that extends its applicability to multivalued discrete systems beyond Boolean functions and the other that represents the variants in terms of the coordinate system in use.


Introduction and Literature Overview
Combinational logic optimization is one of the first steps when designing any digital circuit. This practice helps chip designer save on number of transistors, chip area, and helps reduce logic delays and power requirements. It is no surprise therefore that many efforts have been made to develop fully functional, interactive programs for the industry even in the 80s, such as MIS [1] and SOCRATES [2] and the field has only grown ever since with the advent of many companies competing in this domain. In this section, we discuss various logic optimization methods. Advantages and drawbacks associated with each of these popular methods, especially the ones that offer graphical representation of a function or are simple enough for humans to hand-calculate, is the primary focus of this section. In view of the listed advantages and drawbacks, characteristic features of an ideal methodology are then presented.
A Karnaugh-map (K-map) [3,4] is a graphical technique for combinational logic optimization, which offers a very intuitive way to hand-calculate the proposed graphical representation of a Boolean function and its reduction. Using different colour schemes, multiple output functions involving the same inputs can be represented on a single K-map. However, it is only ideal for a function where the number of inputs is less than five. To represent functions involving more than four variables, one of the proposed implementations splits the graph into subgraphs-each subgraph representing only four variables at a time [5]. Another extension of the Kmaps does not require splitting the graph into smaller units to represent functions with more than four variables, but some of the variable inversions can no longer remain adjacent to each other [6]-like in the case of K-maps for four inputs.
2 Complexity A binary decision diagram (BDD) [7][8][9][10] is also a graphical method that is easy enough to implement and visualise. BDDs are often put to use as a data structure to both represent the Boolean functions and to perform the operations efficiently. Unlike K-maps, usability of this approach is not constrained by the number of inputs. Optimization is primarily about choosing the correct ordering of input variables and about reducing the number of "nodes" by merging equivalent nodes and by removing redundant ones. Diagram complexity depends a lot on the ordering of the input variables and the respectively applied decomposition type [7,11], and it is not always easy to devise the correct order by mere visual inspection. This however, to a limited extent, is also a downside of the graphical approaches presented in this paper. As for BDDs, moreover, one cannot translate a given graphical representation back to its Boolean expression just by a quick visual skimming through-it is imperative to trace the entire paths starting from the output nodes back to the first input in order.
Typed decision graphs (TDGs) [12] offer reduction of BDDs into a graph with a lot fewer nodes and connections. The advantages and drawbacks of the method are therefore mostly similar to those of BDDs, including dependence of the size/complexity of the representation on the ordering of the variables. Also closely related to BDDs are graphical techniques called "implicit graph based method" [13][14][15] and signal transition graphs (STGs) [16].
The Quine-McCluskey algorithm [17][18][19] (or method of prime implicants) is functionally identical to Karnaugh mapping and is a deterministic way to check that the minimal form of a Boolean function has been reached. The tabular form makes it more efficient for use in computer algorithms, but, not being graphical, it is not as simple or as intuitive as Karnaugh-maps for use by the designer himself/herself. Petrick's method (the branch-and-bound method) [20] is a technique for determining all minimum sum-of-products solutions from a prime implicant chart and could be looked upon as an extension to the Quine-McCluskey algorithm. The process gets tedious for a human for a large number of inputs and does not scale well on computers likewise. The Espresso algorithm [21] uses a radically different approach by applying heuristics, manipulating the "cubes" representing the product terms in the ON-, DC-, and OFF-covers iteratively, instead of expanding the minterms. Recently, a new paradigm has been proposed called "Majority-Inverter Graph" [22], which is a directed acyclic graph consisting of three-input majority nodes and direct/negated edges.
Keeping classroom education of Boolean functions at the focus, several methodologies [23][24][25][26][27] that are mostly nongraphical and can best be demonstrated with systems with only a limited number of inputs have been proposed, in addition to more generalised software implementations [28][29][30][31][32] not directly useful for demonstrating the concepts through easy hand-calculations. Karnaugh-maps-due to the method's graphical nature-continue to be used as the first method to explain the optimization process in the switching theory textbooks [33] still today.
In the context of the comparison of the methods noted so far, we propose that the following are the desired characteristics of an ideal logic representation methodology: (i) It is not constrained by the number of inputs or outputs and can in theory handle an infinite number of inputs and outputs. That is to say, multiple output functions can be represented simultaneously. (ii) The optimization process should be intuitive; ideally visual inspection should be enough to establish inputoutput relationship. Or it should be based on a paradigm that is intuitive enough for a human to simply hand-calculate. Graphical methods like Kmaps do offer that advantage. (iii) If it is graphical, an equivalent numerical method should exist, which can effectively be used as a data structure to optimally represent combinational logic through conventional programming. The proposed technique satisfies all of the desired characteristics listed, except the very last one. Ordering of variables contributes to the ease with which a human can optimize a function without using any computing resources.

Proposed Technique (Pandit-Plot)
Every Boolean equation is represented by a scatter plot in two dimensions. In effect, in its simplest version, corresponding to four quadrants, four Boolean expressions can simultaneously be represented and optimized on a single plane. By using different markers, one for each function, multiple logic functions may be represented in a single plane and subsequently reduced.

Coordinate System and Input
Correspondence. Every integer coordinate " " corresponds to an input combination 1 , 2 , . . . , such that One axis (say -axis) represents a condition where the designated inputs are all True (T) (also called High (H) or logic level 1), while the other represents a case where those inputs are all False (F) (also called Low (L) or logic level 0). There is, therefore, a one-to-one correspondence between the set of all of combinations of the inputs and the set of points on the plane with integer coordinates. With such a representation system in place, every point on the plot with integer coordinates signifies a single product (in a SOP representation) or a single sum (in a POS representation). As an example, for a system with three inputs ( 0 , 1 , and 2 ), the template of the plot that is restricted to the first quadrant ( ≥ 0) will be as shown in Figure 1.
Throughout the discussion henceforth, we only consider the template in the first quadrant. The templates in four quadrants are symmetric to each other, with -and -axes and the " = " and " = − " lines as the axes of symmetry. We observe that, in the scatter plot from Figure 1, certain datapoints have been marked distinctively using the filled circles. These will be called "redundant" input combinations-for the reasons that will be explained in Section 3.3.

Representing an Input Combination.
Representation of the combinational function " " in graphical form may be done for " " either in POS or in SOP form; the choice lies with the logic designer/user of the plot.
To represent a function in SOP form, every constituent product term is separated into two products, one containing exclusively the direct inputs and the other only the negated inputs. The overall product is represented by a point ( , ), where, for example, the -coordinate corresponds to the set of input combinations coming only from the direct inputs, while the -coordinate corresponds to the set of input combinations from only the negated inputs, using (1). The absence of inputs implies that the corresponding coordinate is 0. As an example, let us consider the following sum of products: represented by points (3, 0) and (5, 2), shown in Figure 2.
(i) For the first product " 0 1 " to be True, both 0 and 1 need to be True. Therefore, the -coordinate = 2 0 + 2 1 = 3, as per (1). Because there are no negated inputs in the first product, no needs to be False for to be True. Therefore, the -coordinate is 0. The product " 0 1 " is, therefore, represented by point (3, 0).
Points (3, 0) and (5, 2) will be called "data-points" as they summarise the function by transforming it into numerical data, corresponding to the chosen coordinate system.
Similarly, for a POS-based representation, we look for False (0/F/L) logic outputs to mark the points transforming every sum in the expression.
Every Boolean function can therefore be represented by only two parameters alone in this way, namely, the coordinates of the representative points, irrespective of the number of inputs. This is a huge data compression in itself, where instead of storing the entire truth table, or even all of the combinations for which the output is either T or F (whichever count is less), we can simply represent a function with a few data-points. The system can further be optimized to remove extraneous information as will be explained in Sections 3.3, 3.5, and 3.6.

Existence of Redundant Data-Points.
It can easily be observed that there exist points on the plot with integer coordinates that correspond to a Boolean product or a Boolean sum that can never occur in a reduced SOP or a reduced POS expression, respectively.
As an example, point (1, 1) corresponds to the ( 0 ¬ 0 ) product in SOP which evaluates to 0/F, and the same point corresponds to the ( 0 + ¬ 0 ) sum in POS which evaluates to 1/T. These input combinations do not have any effect on the final expression evaluation, as the output corresponding to these input combinations is preknown and therefore redundant to be included as part of any Boolean expression (e.g., + 0 ¬ 0 = ). We therefore discard such input cases and term these as "redundant points" in the discussions below, while the rest will be called "valid" points, except the origin, which falls into neither of the two categories, representing simply the trivial case of the output being independent of the inputs.

Generation of the Template.
To translate any logic function to this plot, the first step is to build the necessary template or the canvas with all the input redundancies indicated (Figure 1). Such a template may be generated by exploiting patterns for which the redundancies appear (Algorithm 1).
For example, we note the following for a system with inputs: (i) The -and -axes extend from 0 to 2 − 1.
(ii) The points on the line = are redundant points.
(iii) All of the upper diagonal elements are redundant points.
(iv) Redundant points because of the 0 input's logic level extend along both the and directions skipping every other point, that is, skipping the odd integer coordinates. The redundant points associated with 0 input are therefore of the form (2 + 1, 2 + 1), where , are integers.
(v) Alternatively, the template may be generated using cellular automata rules on a brick-wall-like automata template as devised in Figure 3 (in contrast to the Rule P a t t e r n Pattern Rule typical cellular automata template as used in Conway's game of life [34,35]-where the borders of the individual cells coincide). This gives rise to the Sierpinski triangle [36,37] pattern, as desired. The captions for the individual blocks indicate the ( , ) coordinates of the points that the blocks represent.

Logic
Laws. The logic optimization process is visual, intuitive, and simple-just as for Karnaugh-maps. It may alternatively be easily implemented using a computer program by understanding the strategies in place numerically. The basic idea of optimization is to get rid of excess of Complexity 5 information by inspecting the scatter plot and bring the datapoints as close to the axes as possible. There exist patterns that need to be utilised to effectively carry out this "reduction." These patterns need to be formulated into a compilation of "logic laws." A few examples of a logic law or an optimization strategy follow.
Theorem 1 ( √ 2-integer-multiple hypotenuse rule). If two of the data-points are vertices of an upright right angled isosceles triangle with its equal sides having length = 2 ( ∈ N) and if the third vertex is not to the right of any of those two datapoints, then the two data-points could effectively be represented by that third vertex alone, so long as the third vertex is not a redundant point.
Because none of the three points, ( 1 , 1 ), ( 2 , 2 ), and ( 2 , 1 ), is a redundant point and because 1 + 2 = 2 , it follows that where ind( ) is set of suffixes corresponding to inputs associated with coordinate " ." Similarly, it follows that Therefore, the point ( 2 , 2 ) represents both the direct and negated inputs corresponding to the point ( 1 , 2 ), along with the input ¬ . Similarly, the point ( 1 , 1 ) represents both the direct and negated inputs corresponding to the point ( 1 , 2 ), along with the input . The two points, and , therefore, effectively represent the inputs corresponding to the point and, in addition, either the direct or the negated version of the input .
Therefore, in SOP form, and, in POS form, where fl function associated with point . Thus, as per (5) and (6), this rule is simply a manifestation of the two well-known equalities (1) ( ) + (¬ ) = and (2) ( + )( + ¬ ) = for the template we present here-where and are, respectively, the product terms and the summation terms consisting of variables excluding .
As an illustration, if the plot in Figure 4 represents a Boolean function in SOP form with the points and as its "data-points," then per the definitions earlier This is because point (5, 2) translates to " 0 ¬ 1 2 ," while point (1, 6) represents " 0 ¬ 1 ¬ 2 ." Per the law proposed, points and are represented together by point (1, 2) alone, since the right angled triangle is an isosceles triangle with its congruent sides having length 2 , ∈ N( ( ) = ( ) = 4).
We find here that the hypothesis is true, since If the scatter plot in Figure 4 were to correspond to a POS representation, then the plot would have been represented as Effectively, In either case, points (5, 2) and (1, 6) are together represented by (1, 2) alone.
For a system with just two inputs, the "⋆" operator represents simply an "XOR" (⊕) operation, while the "⋆" operator represents an "XNOR" (⊙) operation. The "NAND-only" implementation of "⋆/⋆" operation is shown in Figure 5. This newly defined logic gate can then be optimized for given fanin and fan-out values as necessary to be used as a building block in the subsequent logic design.

Process of Optimization.
While there is much scope for further research in this area for effective algorithm development in terms of logic optimization, including the ones targeted to novel topologies such as the ones involving IMPLY (¬ + ) gates alone, for example (instead of SOP/POS forms presented here, effectively implemented using "NAND alone" and "NOR alone" topologies, resp.), one of the most likely logic flows for such optimization is presented next.
Steps involved in this example algorithm are as follows: Figure 5: "NAND-only" implementation of the newly defined logical operations "⋆ and⋆" that are essentially ⊕ (XOR) and ⊙ (XNOR) operations, respectively, for a two-input system.
(i) "Generate" the template and plot the function.
(ii) "Expand" the expression to include every possible product in SOP form (every possible sum for a POS form).
(iii) "Reduce" the expression using logic laws.
(iv) "Repeat" the above two steps in iteration until no further reduction is possible, as illustrated in Figure 6.
As an example, let = (¬ 1 + 0 1 2 ), and let the representation form chosen be SOP-based as well. ultimately gets reduced to = ¬ 1 + 0 2 as shown in Figure 6.
(3) Reduce: reduce the expression using logic laws. If a new data-point, replacing one or some of the original data-points, is obtained through this process and if this data point cannot be further reduced, then it is noted and kept for the next iteration. (We note an example of such data-point with a label "NEW" in Figure 6(c).) (4) Repeat: repeat steps (2) and (3) until no new replacement data-point closer to the origin can be obtained ( Figure 6(d)).
Similar to the Karnaugh-maps, the "do not care" input combinations could be exploited for logic reduction [3,38].

As a Data Structure.
Because the individual Boolean terms are represented by only two coordinates (irrespective of the number of inputs), any combinational logic may be represented by two parameters alone. This can be viewed as a conversion of a graphical scheme to an equivalent nongraphical numerical scheme, to be handled by computing systems efficiently. The two coordinates may be stored in the memory as a single unit.
Because one can represent any logic expression through a set of coordinates alone, we now investigate the number of bits required to store each of the numbered coordinates. While a proposed template for inputs consists of 4 points (including the origin), the number of valid coordinates is only 3 − 1. This is because a variable can manifest itself in an input combination in its original form ( ) or as a negated version (¬ ) or it could simply be absent. Thus, there are three possibilities for every input . The number of valid points is, therefore, 3 − 1 (excluding the origin indicative of a trivial case where the output is independent of all of the inputs under consideration). Both the total number of points ( = 4 − 1) in a template and the number of valid points ( = 3 − 1) grow exponentially with . The ratio of the number of bits thus required (with and without considering the redundant points) = ceil(log 2 (3 − 1))/ceil(log 2 (4 − 1)) which varies between 0.75 and 0.85 and eventually converges to 0.8 for large . As an example, for = 3, = 26, and 8 Complexity = 63, while, for = 6, = 728, and = 4095. Memory savings, thus, grow with if we effectively take into account the redundancies in the template.
However, in comparison to K-maps (= 2 cells for aninput system), our proposed method requires a much higher number of points (= 3 −1, if we consider only the valid input combinations, excluding the origin). This is because the Kmaps do not take into account all of the input combinations, but only the ones where each of the inputs manifests itself by its presence in its original or in its negated form (thus, 2 possibilities). In the proposed method, we explicitly take into account also the reduced input combinations where some of the inputs are absent.

Possible Extensions and Further Research Scope
(i) Beyond SOP/POS paradigms: more patterns and the resulting optimization strategies need to be investigated in different logic gate methodologies, for example, SOP ("AND-OR", which is "NAND-only"), POS ("OR-AND", which is "NOR-only"), and "IMPLYonly" realisations.
(ii) Multilevel logic: the concept could be extended to three dimensions to represent a ternary logic system, where both inputs and outputs can have three possible logic levels (0, 1, 2). The resulting representation is, thus, in the form of a "logic lattice" instead of the two-dimensional grid presented here, where the third dimension would serve a dual purpose. First, it represents a condition where all the inputs are logical level "2" (just as and represented states "1" and "0," resp.). Secondly, the -axis may also represent an output logic level within such a "logic slice." As an example, output level-1 may correspond to a point with integer ( , , ) coordinates, level-0 may correspond to a point just beneath this point, and level-2 just above ( Figure 7).
(iii) Alternate coordinate systems: every data-point symbolises a huge degree of information, but with only two or three parameters (coordinates). Because this information need not necessarily come about using a Cartesian coordinate system alone, one can choose to alternatively employ some other coordinate system and look for patterns and laws for optimization within such schemes. For example, a 2D polar system may be used, where the ( , ) to ( , ) transformation is governed by the equations = , = 2 /(2 − 1), and , ∈ [0, 2 − 1]. Note that remains in the range [0, 2 ] irrespective of the number of inputs ( Figure 8). The logic laws for such alternate coordinate systems-where every coordinate of interest follows the equation = (∑ =1 2 ), ∈ N-can be devised by recognising the inherent patterns, which remains an open problem with further scope for research.

Implications to Other Fields of Study.
One can use the template to establish three algebraic equalities, as will be discussed in detail in this section. The method, in general, z-axis x-axis y-axis p l a n e z = z0 + d z p l a n e ( x 0 , y 0 , z 0 + Δ z ) ( x 0 , y 0 , z 0 − Δ z ) ( x 0 , y 0 , z 0 ) z = z − d z p l a n e   is useful for alternative representation and processing of data whenever there is representation of information (i.e., encoding or decoding) in the form of distinct or discrete states. The basic representation strategy can therefore be extended to represent and optimize operations on qubits [39] or to represent codon tables [40,41] or design digital synthetic gene circuits [42]. Using the template used in the method proposed, we have derived the following three equalities in relation to (4 − 3 ). The method gives practical evidence of the equalities invented and presented next.

(18)
Let us first establish that the equalities being discussed are true, using induction.
Proof. For Theorem 3, we observe that the equalities presented in (15) or (16) are true for = 2 and = 3.
Proof. For Theorem 4 similarly, we observe that the equality presented in (17) Because the statement is true for = 2, it is true for every ∈ N and ≥ 2.
In the context of the template for the method proposed, the two theorems can be proven graphically by simply counting the number of valid and redundant points, via different formulations. If 3 + ( ) = 4 for all ∈ N, we know the following: (i) 4 = 2 2 = (axis range) 2 = total number of points.
(ii) 3 = total number of "valid" data-points, including the origin.
(∵ Every input can manifest itself in the input combination represented by ( , ), either in its original form (input combination represented by thcoordinate) or as a negated input (input combination represented by the -coordinate) or may not manifest itself at all.) (iii) ( ) = total number of redundant points.
(∵ Total number of points = total number of "valid" points including the origin + total number of "redundant" points).
Proof. To establish equality presented in the Theorem 3, we use the formulation of ( ) as presented in Figure 9. From Figure 9, it is evident that The exponent of 3 translates to a multiplier that represents the frequency of occurrence of the constituent triangle of that specific size in the template. Proof. Alternately, Theorem 4 can be proven using a recursive formula for ( ), as obtained from Figure 10.
This method can be used in classrooms to quickly handcalculate an optimized form of the logic function using a ruler and a compass alone (Figure 11).

Conclusion
A novel graphical technique for digital logic representation and optimization has been proposed, which makes optimization algorithm much more instinctive and easy. Multiple equations can be optimized simultaneously using the template presented. One can, theoretically, therefore optimize simultaneously multiple combinational logic circuits with any number of inputs or outputs. We propose a data structure transformation that can compress a truth table into a few parameters. The approach and the fundamentals involved are likely to generate many novel solutions applicable to other disciplines. A new paradigm is being proposed, which opens up new avenues for research in terms of new methodologies and pattern identification towards better logic reduction  Figure 11: A compass and a ruler (marked with 2 units) can be effectively used to quickly find the points that can be merged together to generate a more optimized logic representation using the logic laws proposed earlier (Section 3.5).
tailored to different implementation topologies such as SOP ("AND-OR"/"NAND-only"), POS ("OR-AND"/"NORonly"), and "IMPLY-only" realisations or the newer methodologies such as "reconfigurable asynchronous logic automata (RALA)" [43] and the search for most suited template for each in terms of the coordinate system of choice and the template generation rules. Our proposed technique currently establishes a one-toone mapping between all of the possible variable combinations and the corresponding output states-representing the absence and presence of every variable (in its original and the negated form) for each of the variable combinations. One possible future research direction is to investigate the relationship between the proposed technique herein and other representation techniques-such as QMDDs which, too, rely on quadrants and one-to-one mappings and which rather extend way beyond the proposed technique to represent transformation matrices featuring complex entries useful for logic involving qubits. Further research may also be targeted towards multilevel discrete systems beyond Boolean algebra and reversible [44,45] and hazard-free logic synthesis [9].