Boolean functions are used regularly throughout this thesis, as they feature heavily in design methodologies for asynchronous circuits. Here we briefly introduce some notations for Boolean functions which we will use.
Boolean functions consist of variables, constants and logic operations. The constants are the logic values of true or false, represented by 1 and 0 respectively. Variables can take on one of these values, but can be negated or inverted, which provides the opposite value than the current value for this variable. For example, a variable x can have value
0 or 1. If we it is said to have the value of 1, but is negated, indicated as x, then the
value is 0.
x=1, y=0
x=0, y=1
Logic operations are mathematical operations performed on the values of the variables.
Boolean values, and depending on the operator, combine in certain ways. AND will return 1 if both input values are 1, and will return 0 otherwise. OR will take in two values and output 1 if at least one of the input values is 1, returning 0 when both inputs are 0.
Asynchronous Concepts utilise Boolean functions in several forms, and in this section we will discuss these. Two forms primarily used are Conjunctive Normal Form (CNF) and
Disjunctive Normal Form (DNF). We use both forms in order to represent behaviours
in Asynchronous Concepts in some way, and thus need to be able to convert between these. However, not every Boolean function is in either of these forms initially, and thus we need to be able to convert any function into one of these forms, which can then be converted to the other form if necessary.
CNF can be described as a form where the top-level logic operation is an AND. There are sub-functions within a CNF function which feature OR operations of variables. All sub-functions are ANDed at the top-level [30]. CNF functions are used to represent concepts, and thus, we provide an algorithm to convert from any Boolean function to CNF, discussed in Section 2.6.1.
DNF is the dual of CNF, the top-level logic operation is OR. Sub-functions are all ANDs of variables, and all sub-functions are ORed at the top-level [31]. DNF functions are used less than CNF in the language of Asynchronous Concepts, but are still used within the design flow, and we include a conversion method from CNF to DNF, discussed in Section 2.6.2.
2.6.1
Converting any Boolean function to CNF
Algorithm 1 details how a function is converted into CNF form. Consider the following example Boolean function:
f unction= (a∧b) ∨c
Using this function, we will follow Algorithm 1, and perform the operations manually to show the operation of this algorithm.
The algorithm begins by generating a table of all possible combination of true (1)
and false (0) values for all the variables, a, b and c. Each of these combinations are
then applied in turn to the function and evaluated, finding the true or false resulting value of the whole function.
Algorithm 1Algorithm to convert a Boolean function to CNF 1: functionCONVERT-TO-CNF(function)
2: //Generate a list of all combinations of true/false for all variables
3: values←genVals(variables) in function
4: for allvalues do
5: //Evaluate each function. If it is true, ignore it.
6: if evaluate(function, value) is false then
7: for eachvalue do
8: //For the value of each variable
9: iftrue then
10: //If true, OR the negated variable with the function
11: newFunction←newFunction OR (NOT variable)
12: else iffalse then
13: //If false, OR the non-negated variable with the function
14: newFunction←newFunction OR variable
15: end if
16: end for
17: //AND the new function with the function in CNF form.
18: //This provides the top-level AND
19: cnfFunction←cnfFunction AND newFunction
20: end if
21: end for
22: //Simplify for a more compact function.
23: cnfFunction←simplify(cnfFunction)
24: end function
If the first set of values for the variables is to set all variables to 0, then it is evaluated as follows. First, by replacing all of the variables with their value:
(a∧b) ∨c= (0∧0) ∨0
The evaluation of this function with the given values will be 0. The truth table in Table 2.1, shows all combinations of values for the variables, and the evaluation values. The algorithm then aims to use any values which are false to generate the function in CNF form.
This section of the algorithm then uses the value of each variable used in the evalua- tion and uses it to generate a small function. Each variable is then inverted with respect to the values stated, and OR with the remaining function. For example, for false false
f unction is empty a=0, therefore f unction∨a f unction=a b=0, therefore f unction∨b f unction=a∨b c=0, therefore f unction∨c f unction=a∨b∨c
This is then ANDed with the whole CNF form of the set function. After this cn f Function
will contain a∨b∨c only. Each individual function for the different combinations can
be found in Table 2.1.
Table 2.1: Truth table for function(a∧b) ∨c
a value b value c value evaluation value sub function if 0
0 0 0 0 a∨b∨c 0 0 1 1 N/A 0 1 0 0 a∨b∨c 0 1 1 1 N/A 1 0 0 0 a∨b∨c 1 0 1 1 N/A 1 1 0 1 N/A 1 1 1 1 N/A
The full CNF function, following the completion of the evaluation of all possible combinations of values, will include all of these sub functions ANDed as follows:
cn f Function = (a∨b∨c) ∧ (a∨b∨c) ∧ (a∨b∨c)
This function can be used in it’s current form. However, as the number of variables increases, the size of the function may also increase, leading to a higher-level of com- plexity than necessary. We therefore simplify the function on line 16. The simplified CNF function will be:
cn f Function= (a∨c) ∧ (b∨c)
2.6.2
Converting CNF functions to DNF functions
While different in form, the CNF and DNF functions are similar and related. A CNF function can be converted to DNF using the Cartesian Product. Each sub-function in a
CNF function is part of the Cartesian product, each ORed variable in these is ANDed with each variable in every other sub-function. Each sub-function produced is then ORed, which is the top-level, producing the DNF form.
Using the CNF function from the previous example, we can convert this to DNF. Applying the Cartesian product results in the following function:
dn f Function= (a∧b) ∨ (a∧c) ∨ (c∧b) ∨ (c∧c)
This is a correct DNF function, but as with the conversion to CNF, if there are many variables, this could be much longer and more complex. We can simplify this however,
for example, (c∧c) simplifies to c. The simplified DNF function for this function is:
dn f Function= (a∧b) ∧c
This result is the same as the function we initially converted to CNF. This helps to show that these conversions are correct, but also that we can use Algorithm 1 in order to convert DNF functions, as well as any other Boolean functions to CNF. This is is the process used by tools developed for Asynchronous Concepts, as discussed in Chapter 5