Let us consider a logic function F has 8 logic variables. Hence, it has totally 256 combination. Now, we want to test the realized circuit of this function F, and we can try the 256 combination as the input. However, this is very inefficient :
Suppose that we want to change the input 00000000 to 11111111 , we have to turn on the 8 switches in reality. This is burdensome for the operation, the circuit, and the testing cost.
Therefore, we expect a method that testing a combinatorial circuit with minimum switching, equivalent to the minimum cost.
Now, the reduced, ordered and minimized BDD is the fastest and the best solution for combinatorial circuit testing.
[ f ] = AndOr()
{
1,-2,3,-4,-5,-6 ;
-1,-2,3,4,-5,6 ;
-1,2,3,-4,-5,6 ;
1,-2,3,4,5,6 ;
-1,-2,-3,4,-5,6 ;
1,2,-3,4,5,6 ;
1,2,-3,-4,-5,6 ;
1,2,-3,-4,5,6 ;
1,2,-3,4,5,6 ;
-1,2,-3,-4,5,6 ;
}
[ g1 ] = Convert.ToROBDD(f);
[ g2 ] = ShannonTree.ROBDD(f);
Print("result:", g1);
Print("result:", g2);
/*
The result should be :
//--------------------------------------------------//
/// Time for executing 'Convert.ToROBDD' : 3484ms
//--------------------------------------------------//
/// Time for executing 'ShannonTree.ROBDD' : 3921ms
"result:";
g1 = BDD[7]()
{
/// output: nodeIndex '->' (nodeVariable) '->' nodeIndex/value ';'
/// internal: nodeIndex '->' (nodeVariable) '->' THEN(nodeIndex/value) ',' ELSE(nodeIndex/value) ';'
/// value : T/F for TRUE/FALSE
/// nodeIndex : integer;
/// nodeVariable : integer; outputVariableIndex > inputVariableIndex
1->(7)->2;
2->(2)->3,13;
3->(3)->4,8;
4->(1)->F,5;
5->(4)->F,6;
6->(5)->F,7;
7->(6)->T,F;
8->(6)->9,F;
9->(1)->10,12;
10->(4)->11,T;
11->(5)->T,F;
12->(4)->F,11;
13->(1)->14,19;
14->(3)->15,F;
15->(4)->16,17;
16->(5)->7,F;
17->(5)->F,18;
18->(6)->F,T;
19->(4)->6,F;
}
"result:";
g2 = BDD[7]()
{
/// output: nodeIndex '->' (nodeVariable) '->' nodeIndex/value ';'
/// internal: nodeIndex '->' (nodeVariable) '->' THEN(nodeIndex/value) ',' ELSE(nodeIndex/value) ';'
/// value : T/F for TRUE/FALSE
/// nodeIndex : integer;
/// nodeVariable : integer; outputVariableIndex > inputVariableIndex
1->(7)->2;
2->(2)->3,13;
3->(3)->4,8;
4->(1)->F,5;
5->(4)->F,6;
6->(5)->F,7;
7->(6)->T,F;
8->(6)->9,F;
9->(1)->10,12;
10->(4)->11,T;
11->(5)->T,F;
12->(4)->F,11;
13->(1)->14,19;
14->(3)->15,F;
15->(4)->16,17;
16->(5)->7,F;
17->(5)->F,18;
18->(6)->F,T;
19->(4)->6,F;
}
*/