diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2007-04-06 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2007-04-06 08:01:00 -0700 |
commit | 00dc0f3daab81e3a30b7fae3ec4f2c191fce114c (patch) | |
tree | 0db78ea60c485e8bc52886031edc9ab2a9dce2f6 /src/misc | |
parent | 028138a76eb74eee80f1d9592f43bdbe0d4c3d6c (diff) | |
download | abc-00dc0f3daab81e3a30b7fae3ec4f2c191fce114c.tar.gz abc-00dc0f3daab81e3a30b7fae3ec4f2c191fce114c.tar.bz2 abc-00dc0f3daab81e3a30b7fae3ec4f2c191fce114c.zip |
Version abc70406
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/extra/extra.h | 24 |
1 files changed, 24 insertions, 0 deletions
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 ); |