二元決策圖, BDD

讓我們研究一下 的用法。

讓我們考慮一個邏輯函數 F 有 8 個邏輯變量。因此,共有256種組合。現在,我們要測試這個函數F的實現電路,我們可以嘗試256組合作為輸入。然而,這是非常低效的 :

  • 太多組合無法測試。
  • 太多無用的組合需要測試。
  • 開關太多,無法操作。
假設我們要將輸入 00000000 更改為 11111111 ,實際上我們必須打開 8 個開關。這對於操作、電路和測試成本來說都是負擔。

因此,我們期望一種以最小的開關測試組合電路的方法,相當於最小的成本。

現在,減少、有序和最小化的 BDD 是組合電路測試最快、最好的解決方案。

測試算子的計算速度NOT

[ 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);

/*
結果應該是 :
//--------------------------------------------------//
/// 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;
}
*/



IsBiUnateFunction IsBlankFunction IsPositiveFunction IsSelfAntiDualFunction IsSelfDualFunction BDD BCD NineComplement StringToBinaryNumber TwoComplement ToOrAnd ToVariableInvertedFunction ToXORP FeedbackSystem Imply logicvardef Nand NumberSystem MantissaToPositiveNumber PositiveDecimalToMantissa OrAnd To2LayerOrAnd SAT Backwardly StateVariables ToDigitalSystem Compatibility IndependentBase XORP Zero

搜索本網站 :

 
Buy website traffic cheap