Chapter 3 Previous Works
4.2 Solution Space Analysis
Assume the number of data signals is n. We analyze the exact number of the solutions if the fixed encoding is assigned for data signals. We can reorder the selection signals to search all possible decompositions. Hence, the number of the solutions is (log n)!. As the encoding is not specified for data signals in advance, we
can assign input position of the MUX arbitrary data signals. The number of the possible combinations of the data signals is n!. In Fig. 10, the combination of the data signals in case2 is generated by reversing selection signal S in case1. As well, the power dissipation of case1 is equal to the power dissipation of case2. That is, the number of the solutions should be divided by 2 for each level of the MUX tree.
Hence, as encoding is not specified for data signals, the number of the solutions is (n-1)!. The entire solution space is shown in Fig. 11. The solution space of the unfixed encoding is equal to the entire solution space. Additionally, as the number of the data signals increases, the ratio of the solution space of the fixed encoding to the entire solution space decreases significantly. The bottom up heuristic algorithm in [9]
searches the solution in the solution space of fixed encoding of Fig.11. The solution of our proposed algorithm in the next section is explored from the entire solution space of Fig. 11.
Fig. 10. Equal power dissipation in both cases
Fig. 11. Entire solution space
Chapter 5 Proposed Algorithm
In this Chapter, we describe the problem formulation of our proposed algorithm in the first section. In the second section, we give a detailed description of our proposed algorithm. In the third section, we summarize our proposed algorithm.
5.1 Problem Formulation of Proposed Algorithm
Our proposed algorithm tries to search a larger solution space than the bottom up heuristic algorithm, so different problem formulation is given. We solve the problem as following: Given the on probabilities (OP) of the data signals and the selection probabilities (SP) of the data signals, our proposed algorithm determines input positions for the data signals in a MUX tree. That is, the proposed algorithm assigns input selection encoding for data signals. According to the input selection encoding of the data signals, a power-minimized MUX tree is generated.
5.2 Proposed Algorithm
In this selection, we give a detailed description of our proposed algorithm.
5.2.1 Analysis of OP of MUX Output
The way to reduce the power dissipation of the MUX is to minimize the switch activity α of the MUX output. The α of the MUX output only depends on the OP of the MUX inputs. We discuss the relation between α and OP of the MUX further.
Consider a 2-to-1 MUX and the switching activity curve shown in Fig. 12. The curve represents the equation α = 2*OP(Q)*(1 - OP(Q)). As the OP(Q) is away from 0.5, the α decreases. If we want to reduce power dissipation of the 2-to-1 MUX, we should avoid the OP of the 2-to-1 MUX output approaching 0.5.
OP(Q) α
α = 2*OP(Q)*(1 - OP(Q))
Fig. 12. A 2-to-1 MUX and switching activity curve
The OP of the 2-to-1 MUX outputs can be computed by Equation(2) and the Equation(2) is actually an interpolation. A 2-to-1 MUX and illustration of Equation(2) are shown in Fig. 13. From the illustration of Equation(2) in Fig. 13, we make two observations. First, OP(Q) is bound between OP(D1) and OP(D0). Second, the position of OP(Q) between OP(D1) and OP(D0) is proportional to the position of OP(S) between 0 and 1.
Fig. 13. A 2-to-1 MUX and illustration of Equation(2)
5.2.2 2-to-1 MUX Inputs
In our proposed algorithm, we construct a MUX tree from the bottom level of MUX tree to the top level of MUX tree. We should minimize the power dissipation of 2-to-1 MUX at a level of MUX tree first. According to Equation(2), if we consider both SP and OP of data signals, the entire solution space must be explored exhaustively. Due to time complexity, an efficient approach must be applied.
In section 5.2.1, we have mentioned that the OP of the 2-to-1 MUX output is bound between two OP of 2-to-1 MUX inputs. If we determine 2-to-1 MUX inputs only by considering the OP of data signals, the OP of 2-to-1 MUX output must vary between two OP of the MUX inputs. For example, if we avoid 0.5 between two OP of the 2-to-1 MUX inputs, the OP of the 2-to-1 MUX output could be far from 0.5.Thus, we only consider the OP of the data signals first in our proposed algorithm.
Consider an example of different 2-to-1 MUX inputs shown in Fig. 14. Because we consider the OP of the data signals only, we assign four data signals with equal SP to the 2-to-1 MUX inputs in Fig. 14. The data signals with equal SP cause OP(S) to be 0.5, so the OP of the 2-to-1 MUX output is equal to the middle between two OP of the 2-to-1 MUX inputs. In case1 of Fig. 14, we see that the OP(Q1) is in the middle between OP(D0) and OP(D3), so OP(Q1) is 0.5. We also can see that the OP(Q2) is 0.5. In case2 of Fig. 14, the OP(Q1) is 0.15 and the OP(Q2) is 0.75. The sum of α in case1 is higher than the sum of α in case2. From case2, we can instinctively think that if the two data signals which both always have “on” conditions or both have “off”
conditions are in the same 2-to-1 MUX inputs, the α of the 2-to-1 MUX output is low.
Moreover, we can observe that the OP of the 2-to-1 MUX inputs in case2 avoid the OP of the 2-to-1 MUX outputs approaching 0.5. Thus, if we use 0.5 to partition the OP of the data signals into two groups and the data signals in the same group should
be in the same 2-to-1 MUX inputs, the OP of the 2-to-1 MUX outputs could be far from 0.5.
Fig. 14. An example of different 2-to-1 MUX inputs
However, only partitioning the data signals into two groups is not enough to determine all of 2-to-1 MUX inputs. We should find an efficient way to determine 2-to-1 MUX inputs in the n-to-1 MUX. Take the 8-to-1 MUX as example. An example of the different 2-to1 MUX inputs in the bottom level of the 8-to-1 MUX is shown in Fig. 15. The table presents the OP and SP of data signals. In the three cases, the data signals in the same group are in the same 2-to-1 MUX inputs. We can see that the sum of α in case3 is smallest among three cases. The approach of case3 uses the sorting order of the OP of the data signals to determine the 2-to-1 MUX inputs. In our proposed algorithm, we greedily adopt the approach of case3 to determine the 2-to-1 MUX inputs. If it has even number of the data signals in both groups, we also use the sorting order to determine 2-to-1 MUX inputs. Thus, our proposed algorithm can efficiently determine 2-to-1 MUX inputs by using sorting order of the OP of the data signals.
1/8
Fig. 15. An example of the different 2-to1 MUX inputs in the bottom level of the 8-to-1 MUX
5.2.3 Order of 2-to-1 MUX Inputs
Although our proposed algorithm determines 2-to-1 MUX inputs, the OP of the 2-to-1 MUX outputs are just bound between two OP of 2-to-1 MUX inputs. From section 5.2.1, the OP of selection probability can determine the position of the OP of the 2-to-1 MUX outputs between two OP of 2-to-1 MUX inputs. The Fig. 16 shows different orders of 2-to-1 MUX inputs. The different orders of 2-to-1 MUX inputs cause the different OP of the selection signal.
If we want to determine minimum power of 2-to-1 MUXes by changing the orders of the 2-to-1 MUX inputs, the solution space is too large. For example, if the number of the data signals is n, the number of all combinations of the data signals is 2 (n / 2). The example of the equal power dissipation condition is shown in Fig. 10. The number of all combinations of the data signals should be divided by 2. Thus, the total number of the solutions is 2 (n / 2) – 1. Due to time complexity, an efficient way must be proposed.
Fig. 16. Different orders of 2-to-1 MUX inputs
The OP of the 2-to-1 MUX outputs should be as far from 0.5 as possible. Assume that the 2-to-1 MUX inputs have the following ideal condition: the OP of the 2-to-1 MUX input port “1” is further from 0.5 than the OP of the 2- to-1 MUX input port “0”
and 2-to-1 MUX input port “1” has high selection probability. From illustration of Equation(2) in Fig.13, the OP of the 2-to-1 MUX output approaches the OP of the 2-to-1 MUX input port “1” and have low α. Fig. 17 shows the ideal condition of 2-to-1 MUX inputs. In Fig. 17, the OP of the 2-to-1 MUX input port “1” is further from 0.5 than the OP of the 2-to-1 MUX input port “0”. Moreover, the SP of the 2-to-1 MUX input port “1” is higher than the SP of the 2-to-1 MUX input port “0”.
Because OP(S) is 0.8, OP(Q1) approaches 0.9 between 0.5 and 0.9, OP(Q2) approaches 0.1 between 0.1 and 0.5. Thus, if the condition of 2-to-1 MUX inputs is the same as the ideal condition of 2-to-1 MUX inputs in Fig. 17, the higher SP of the 2-to-1 MUX input should be in the same input port. Then, the OP of the 2-to-1 MUX output approaches the OP of the MUX input which is further from 0.5 than another.
However, we can’t expect that all conditions of the 2-to-1 MUX inputs are the same as the ideal condition of the 2-to-1 MUX input pair in Fig. 17.
Fig. 17. Ideal condition of 2-to-1 MUX inputs
Next, we classify 2-to-1 MUX input pair into two types form the OP and the SP of the 2-to-1 MUX inputs. The two types of 2-to-1 MUX input pairs are referred as the ideal MUX and the unpredictable MUX. If the condition of the 2-to-1 MUX inputs is the same as the ideal condition of the 2-to-1 MUX inputs in Fig. 17, the 2-to-1 MUX is an ideal MUX. Fig. 18 shows an example of the ideal MUX. We can see that SP(D)
> SP(C) and OP(D) < OP(C) < 0.5. The MUX M2 is an ideal MUX. The MUX M2 of case2 has correct order of MUX inputs. The OP(Q1) and the OP(Q2) of case2 are further from 0.5 than the OP(Q1) and the OP(Q2) of case1.The order of the ideal MUX can be determined by the SP and OP of the ideal MUX inputs. Thus, the orders of the ideal MUX inputs can be fixed efficiently without considering other orders of MUX inputs.
Fig. 18. An example of the ideal MUX
The unpredictable MUX is described as following: the OP of the 2-to-1 MUX input port “1” is further from 0.5 than the OP of the 2- to-1 MUX input port “0” and the SP of the 2-to-1 MUX input port “1” is lower than the OP of the 2- to-1 MUX input port “0”. An example of the unpredictable MUX is shown in Fig. 19. The MUX
M2 is the unpredictable MUX. The OP(Q1) of case2 is further 0.5 than the OP(Q1) of case1. However, the OP(Q2) of case1 is further 0.5 than the OP(Q2) of case2. Both results must be computed to determine the order of the unpredictable MUX inputs.
Thus we can’t predict the order of the unpredictable MUX inputs only from the SP and the OP of the unpredictable MUX inputs. introduced. All of 2-to-1 MUXes belong to either the ideal MUX or the unpredictable MUX. All cases of the ideal MUX are shown in Fig. 20. And, two ideal MUX inputs conform the following equation:
{ |OP(A) - 0.5| ≧ |OP(B) - 0.5| } & { SP(A) SP(B) } ≧ (3)
All cases of the unpredictable MUX are shown in Fig. 21. And, two unpredictable MUX inputs conform the following equation:
{ |OP(A) - 0.5| > |OP(B) - 0.5| } & { SP(A) < SP(B) } (4)
Fig. 20. All cases of the ideal MUX
Fig. 21. All cases of the unpredictable MUX
5.2.4 Process of Fixing Order of MUX Inputs
After the 2-to-1 MUX inputs are given, we should find an efficient approach to fix orders of the 2-to-1 MUX inputs to minimize α of the MUX outputs in our proposed algorithm. First, we find all of the ideal MUXes and fix orders of the ideal MUX inputs. Fig. 22 shows the process of fixing orders of ideal MUX inputs.
Fig.22. Process of fixing orders of ideal MUX inputs
We can’t expect that all 2-to-1 MUXes are the ideal MUXes. After fixing the orders of the ideal MUX inputs, we have to fix the orders of the unpredictable MUX inputs. Due to time complexity, we can’t search all possible solutions exhaustively by swapping the unpredictable MUX inputs. According to Equation(2) and Equation(3), only the SP of the data signals affect the OP of the 2-to-1 MUX outputs after the 2-to-1 MUX inputs are given. Consequently, we greedily fix the order of the unpredictable MUX first which has the largest sum of the two SP of the unpredictable MUX inputs. The process of fixing orders of the unpredictable MUX inputs is shown in Fig. 24. The MUX M1 and the MUX M2 are the ideal MUXes, and their orders have been fixed. The MUX M3 and the MUX M4 are the unpredictable MUXes. The sum of the SP(E) and the SP(F) is larger than the sum of SP(G) and SP(H), so we fix the order of MUX M3 inputs first. As computing the OP(S), the only fixed MUX are considered. The different orders of the MUX M3 inputs cause the different OP(S).
The total power dissipation is the sum of the Q1, Q2, and Q3. We compute the two
different total power dissipations. Then we greedily choose the order of the MUX inputs which generates the lowest total power dissipation. In this example, the total power dissipation of case2 is lower than the total power dissipations of case1. Thus, the order of MUX M3 inputs of case2 is chosen. We use the same approach to fix all orders of the unpredictable MUX inputs iteratively. After fixing all orders of the unpredictable MUX inputs, the input positions of the data signals in a level of the MUX tree are determined.
Fig.24. Process of fixing orders of the unpredictable MUX inputs
In our proposed algorithm, we construct a MUX tree from the bottom level to the top level. From the previous steps, we have analyzed how to determine the input positions of the data signals in a level of the MUX tree. Then we can obtain the OP of the each 2-to-1 MUX output in a level of the MUX tree. It is easy to see that the SP of the 2-to-1 MUX output is the sum of the SP of the 2-to-1 MUX inputs. By using the
SP and the OP of the MUX outputs in a level of the MUX tree, we use the same approach to determine next level of a MUX tree. Finally, the input positions of the data signals in a MUX tree are determined. That is, input selection encoding is assigned to the data signals.
5.3 Summary of Proposed Algorithm
According to the main idea introduced in previous sections, the process of our proposed algorithm can be summarized in the following steps:
● Determine 2-to-1 MUX inputs in a level of the MUX tree greedily by using the sorting order of the OP of the data signals.
● Classify the 2-to-1 MUX inputs into two types from the SP and the OP of the 2-to-1 MUX inputs. The two types are the ideal MUX and the unpredictable MUX .
● Fix the orders of the ideal MUX inputs first. For example, all of the ideal MUX input port“1” are given 2-to-1 MUX input which has higher SP than another input.
● Fix the orders of the unpredictable MUX inputs one by one. The priority is given by the sum of the two SP of the unpredictable MUX inputs.
● After the orders of the 2-to-1 MUX inputs are fixed in the a level of the MUX tree, the SP and the OP of the 2-to-1 MUX outputs are known. Thus, apply the previous steps to determine each level of the MUX tree iteratively.
● Finally, the input positions of the data signals in a MUX tree are determined and the input selection encoding is assigned for the data signals.
Chapter 6 Experimental Results and Analysis
We implement both bottom up heuristic algorithm and our proposed algorithm in our experiments. We apply these algorithms on 4-to-1, 8-to-1, 16-to-1, 32-to-1, and 64-to-1 MUXes. The implementations are in C++. The different OP and SP of the data signals cause the different results. We randomly generate 100 different cases of the OP and the SP for data signals when we apply these algorithms on each n-to-1 MUX. Then, we recorder those results and get the average result.
We define that the better solution is the solution which is better than the reference solution in the entire solution space. Table 2 shows the average number of the better solutions in the 4-to-1 MUX. Table 3 shows the number of the better solutions in the 8-to-1 MUX. The “average solution” is the average result of 1000 random cases for different data signals. The better case ratio is calculated by the following equation:
(5) number of average better solutions
solutions total
of number ratio
solution = better
The number of the total solutions is 3! = 6 for a 4-to-1 MUX. The number of the total solutions is 7! = 5040 for an 8-to-1 MUX. The “variance” presents the variance of average number of better solutions. The variance is not great in 4-to-1 MUX and 8-to-1 MUX. The solutions of bottom up heuristic algorithm are near best solutions of MUX decomposition. However, about 20% of the total solutions are better than the best solution of MUX decomposition in 8-to-1 MUX due to small solution space. The solution of our proposed algorithm is better than over 95% of the total solutions in 8-to-1 MUX. If the size of the MUX is over 8, the total solution space is too large. We only search the total solutions of the both 4-to-1 MUX and 8-to-1 MUX to compare results.
Table 1. Average number of the better solutions in the 4-to-1 MUX
average number of 2.97
better solutions
average number of 2.97
better solutions
Table 2. Average number of the better solutions in the 8-to-1 MUX
46.06
The total solutions of the arbitrary n-to-1 MUX can’t be obtained. We analyze the results by using the following equation:
(6) solution
average
power averagesolution- referencesoultion rate
saving =
Moreover, we observe the each power saving rate at different ranges of OP of the data signals. The three different ranges are {0< OP <1}, {0.2 < OP < 0.8}, and {0.4 < OP
< 0.6}. The power saving rates at the three different ranges is shown in Table 3, Table 4, and Table 5. The solutions of the proposed algorithm are near the best solutions of entire solution space in the 4-to-1 MUX and 8-to-1 MUX. In our proposed algorithm, as the size of the MUX increases, the power saving rate increases. For example, the power saving rate of 64-to-1 MUX is up to about 24% at the range {0 < OP <1}. In the bottom up heuristic algorithm, as the size of the MUX increases, the power saving rate decreases. This is because that the ratio of the solution space of MUX
< 0.6}. The power saving rates at the three different ranges is shown in Table 3, Table 4, and Table 5. The solutions of the proposed algorithm are near the best solutions of entire solution space in the 4-to-1 MUX and 8-to-1 MUX. In our proposed algorithm, as the size of the MUX increases, the power saving rate increases. For example, the power saving rate of 64-to-1 MUX is up to about 24% at the range {0 < OP <1}. In the bottom up heuristic algorithm, as the size of the MUX increases, the power saving rate decreases. This is because that the ratio of the solution space of MUX