
/***********************************************************************


        Copyright (C) 1991,
        Virginia Polytechnic Institute & State University


        This program was originally written by Mr. Hyung K. Lee
        under the supervision of Dr. Dong S. Ha, in the Bradley
        Department of Electrical Engineering, VPI&SU, in 1991.

        This program is released for research use only. This program,
        or any derivative thereof, may not be reproduced nor used
        for any commercial product without the written permission
        of the authors.

        For detailed information, please contact to

        Dr. Dong S. Ha
        Bradley Department of Electrical Engineering
        Virginia Polytechnic Institute & State University
        Blacksburg, VA 24061

        Ph.: (540) 231-4942
        Fax: (540) 231-3362
        E-Mail: ha@vt.edu
        Web: http://www.ee.vt.edu/ha

***********************************************************************/

/**************************** HISTORY **********************************

	atalanta & soprano: version 1.0

	Original: H. K. Lee, 8/15/1990
	Updated: H. K. Lee, 8/15/1991

***********************************************************************/

/*----------------------------------------------------------------------
	truthtable.h
	defines the truthtable of 1 and 2 input primitive gates
	should include atpg.h prior to include truthtable.h
----------------------------------------------------------------------*/

/* 1 input gates: */
level truthtbl1[MAXGTYPE][MAXLEVEL] = {
/*	   {	0	1	x	d	dbar	}	*/
/* and  */ {	ZERO,	ONE,	X,	D,	DBAR	},
/* nand */ {	ONE,	ZERO,	X,	DBAR,	D	},
/* or   */ {	ZERO,	ONE,	X,	D,	DBAR	},
/* nor  */ {	ONE,	ZERO,	X,	DBAR,	D	},
/* pi   */ {	ZERO,	ONE,	X,	D,	DBAR	},
/* xor  */ {	ZERO,	ONE,	X,	D,	DBAR	},
/* xnor */ {	ONE,	ZERO,	X,	DBAR,	D	}};

/* 2 input gates */
level truthtbl2[MAXGTYPE][MAXLEVEL][MAXLEVEL] = {
/*	   {	0	1	x	d	dbar	}	*/
/*and  */ {{	ZERO,	ZERO,	ZERO,	ZERO,	ZERO	},	/* 0 */
           {	ZERO,	ONE,	X,	D,	DBAR	},	/* 1 */
           {	ZERO,	X,	X,	X,	X	},	/* x */
           {	ZERO,	D,	X,	D,	ZERO	},	/* d */
           {	ZERO,	DBAR,	X,	ZERO,	DBAR	}},	/* dbar */
/*nand */ {{	ONE,	ONE,	ONE,	ONE,	ONE	},	/* 0 */
           {	ONE,	ZERO,	X,	DBAR,	D	},	/* 1 */
           {	ONE,	X,	X,	X,	X	},	/* x */
           {	ONE,	DBAR,	X,	DBAR,	ONE	},	/* d */
           {	ONE,	D,	X,	ONE,	D	}},	/* dbar */
/*or   */ {{	ZERO,	ONE,	X,	D,	DBAR	},	/* 0 */
           {	ONE,	ONE,	ONE,	ONE,	ONE	},	/* 1 */
           {	X,	ONE,	X,	X,	X	},	/* x */
           {	D,	ONE,	X,	D,	ONE	},	/* d */
           {	DBAR,	ONE,	X,	ONE,	DBAR	}},	/* dbar */
/*nor  */ {{	ONE,	ZERO,	X,	DBAR,	D	},	/* 0 */
           {	ZERO,	ZERO,	ZERO,	ZERO,	ZERO	},	/* 1 */
           {	X,	ZERO,	X,	X,	X	},	/* x */
           {	DBAR,	ZERO,	X,	DBAR,	ZERO	},	/* d */
           {	D,	ZERO,	X,	ZERO,	D	}},	/* dbar */
/*pi   */ {{	X,	X,	X,	X,	X	},	/* 0 */
           {	X,	X,	X,	X,	X	},	/* 1 */
           {	X,	X,	X,	X,	X	},	/* x */
           {	X,	X,	X,	X,	X	},	/* d */
           {	X,	X,	X,	X,	X	}},	/* dbar */
/*xor  */ {{	ZERO,	ONE,	X,	D,	DBAR	},	/* 0 */
           {	ONE,	ZERO,	X,	DBAR,	D	},	/* 1 */
           {	X,	X,	X,	X,	X	},	/* x */
           {	D,	DBAR,	X,	ZERO,	ONE	},	/* d */
           {	DBAR,	D,	X,	ONE,	ZERO	}},	/* dbar */
/*xnor */ {{	ONE,	ZERO,	X,	DBAR,	D	},	/* 0 */
           {	ZERO,	ONE,	X,	D,	DBAR	},	/* 1 */
           {	X,	X,	X,	X,	X	},	/* x */
           {	DBAR,	D,	X,	ONE,	ZERO	},	/* d */
           {	D,	DBAR,	X,	ZERO,	ONE	}}};	/* dbar */
