From 00dc0f3daab81e3a30b7fae3ec4f2c191fce114c Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 6 Apr 2007 08:01:00 -0700 Subject: Version abc70406 --- src/misc/extra/extra.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/misc') diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h index 06ba309d..5a98348a 100644 --- a/src/misc/extra/extra.h +++ b/src/misc/extra/extra.h @@ -530,6 +530,30 @@ static inline void Extra_TruthNand( unsigned * pOut, unsigned * pIn0, unsigned * for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- ) pOut[w] = ~(pIn0[w] & pIn1[w]); } +static inline void Extra_TruthAndPhase( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, int nVars, int fCompl0, int fCompl1 ) +{ + int w; + if ( fCompl0 && fCompl1 ) + { + for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- ) + pOut[w] = ~(pIn0[w] | pIn1[w]); + } + else if ( fCompl0 && !fCompl1 ) + { + for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- ) + pOut[w] = ~pIn0[w] & pIn1[w]; + } + else if ( !fCompl0 && fCompl1 ) + { + for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- ) + pOut[w] = pIn0[w] & ~pIn1[w]; + } + else // if ( !fCompl0 && !fCompl1 ) + { + for ( w = Extra_TruthWordNum(nVars)-1; w >= 0; w-- ) + pOut[w] = pIn0[w] & pIn1[w]; + } +} extern unsigned ** Extra_TruthElementary( int nVars ); extern void Extra_TruthSwapAdjacentVars( unsigned * pOut, unsigned * pIn, int nVars, int Start ); -- cgit v1.2.3