|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSFE.Compiler.Operator
SFE.Compiler.PrimitiveOperator
public class PrimitiveOperator
The PrimitiveOperator class represents a primitive operator in the program. A PrimitiveOperator contains from one up to three input bits and one output bit.
Field Summary | |
---|---|
static int |
AND_OP
An integer to send with the constructor to construct an and operator. |
static int |
ANDN_OP
An integer to send with the constructor to construct an andn operator. |
static int |
EQ_OP
An integer to send with the constructor to construct an eq operator. |
static int |
ID_OP
An integer to send with the constructor to construct a nmajn operator. |
static java.util.Vector |
inputFormat
|
static int |
MAJ_OP
An integer to send with the constructor to construct a maj operator. |
static int |
MAJN_OP
An integer to send with the constructor to construct a majn operator. |
static int |
MUX_OP
An integer to send with the constructor to construct a mux operator. |
static int |
MUXN_OP
An integer to send with the constructor to construct a muxn operator. |
static int |
NAND_OP
An integer to send with the constructor to construct an nand operator. |
static int |
NMAJ_OP
An integer to send with the constructor to construct a nmaj operator. |
static int |
NMAJN_OP
An integer to send with the constructor to construct a nmajn operator. |
static int |
NMUX_OP
An integer to send with the constructor to construct a nmux operator. |
static int |
NMUXN_OP
An integer to send with the constructor to construct a nmuxn operator. |
static int |
NOR_OP
An integer to send with the constructor to construct an nor operator. |
static int |
NOT_OP
An integer to send with the constructor to construct a not operator. |
int |
operator
|
static int |
OR_OP
An integer to send with the constructor to construct an or operator. |
static int |
ORN_OP
An integer to send with the constructor to construct an orn operator. |
static int |
XOR_OP
An integer to send with the constructor to construct a xor operator. |
Constructor Summary | |
---|---|
PrimitiveOperator(boolean[] truthTable)
Construct a new PrimitiveOperator from a given truth table. |
|
PrimitiveOperator(int truthTable)
Construct a new PrimitiveOperator from a given int that represents the operator. |
Method Summary | |
---|---|
int |
arity()
Returns the arity of the operator 1 for unary ops; 2 for binary ops; 3 for terinary ops; |
PrimitiveOperator |
combineLeftNLeft(PrimitiveOperator other)
same as combineRightNRight but on the this left and other left pins |
PrimitiveOperator |
combineLeftNLeftOnMid(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineLeftNLeftOnRight(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineLeftNRight(PrimitiveOperator other)
same as combineRightNRight but on the this left and other right pins |
PrimitiveOperator |
combineLeftNRightOnMid(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineLeftNRightOnRight(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineMidNLeftOnLeft(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineMidNLeftOnRight(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineMidNRightOnLeft(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineMidNRightOnRight(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineRightNLeft(PrimitiveOperator other)
same as combineRightNRight but on the this right and other left pin |
PrimitiveOperator |
combineRightNLeftOnLeft(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineRightNLeftOnMin(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
combineRightNRight(PrimitiveOperator other)
combines this op and other op on the right pin and returns the result. |
PrimitiveOperator |
combineRightNRightOnLeft(PrimitiveOperator other)
same as combineRightNRight but on the this right and other right pins |
PrimitiveOperator |
combineRightNRightOnMid(PrimitiveOperator other)
same as combineRightNRightOnLeft but on appropraite pins |
PrimitiveOperator |
equalLeftMid()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the left and the middle inputs are assumed to be equal. |
PrimitiveOperator |
equalLeftRight()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the left and the right inputs are assumed to be equal. |
PrimitiveOperator |
equalRightMid()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the right and the middle inputs are assumed to be equal. |
boolean |
isComplexIDOfLeft()
returns true if gate is Trinary or Binary and ID on the left pin. |
boolean |
isComplexIDOfMiddle()
same as isComplexIDOfLeft but on right pin |
boolean |
isComplexIDOfRight()
same as isComplexIDOfLeft but on right pin |
boolean |
isComplexNotOfLeft()
returns true if gate is Trinary or Binary and ID on the left pin. |
boolean |
isComplexNotOfMiddle()
same as isComplexNotOfLeft but on middle pin |
boolean |
isComplexNotOfRight()
same as isComplexNotOfLeft but on right pin |
boolean |
isID()
Returns true if this operator is unary operator and is the identity function. |
boolean |
isNot()
Returns true if this operator is unary operator and is the booelan function NOT. |
boolean |
isOne()
Returns true if this operator is unary operator and is the booelan function output is constant one. |
boolean |
isZero()
Returns true if this operator is unary operator and is the booelan function output is constant one. |
PrimitiveOperator |
negLeft()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table when the left input bit is negated. |
PrimitiveOperator |
negMid()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table when the middle input bit is negated. |
PrimitiveOperator |
negOut()
Creates a new PrimitiveOperator, from this PrimitiveOpertor, that represents the complete boolean function of this PrimitiveOpertor. |
PrimitiveOperator |
negRight()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table when the right input bit is negated. |
PrimitiveOperator |
oneLeft()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the left input bit is the constant one (true). |
PrimitiveOperator |
oneMid()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the middle input bit is the constant one (true). |
PrimitiveOperator |
oneRight()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the right input bit is the constant one (true). |
int |
priority()
Returns an int theat represents the priority of the operator |
PrimitiveOperator |
switchLeftMid()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the left and middle inputs are switched. |
PrimitiveOperator |
switchRightLeft()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the left anright inputs are switched. |
PrimitiveOperator |
switchRightMid()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the right and middle inputs are switched. |
void |
toCircuit(java.io.PrintWriter circuit)
Returns a string representing this object as it appear at the output circuit. |
java.lang.String |
toString()
Returns a string representation of the object. |
PrimitiveOperator |
zeroLeft()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the left input bit is the constant zero (false). |
PrimitiveOperator |
zeroMid()
|
PrimitiveOperator |
zeroRight()
Creates a new PrimitiveOperator from this PrimitiveOpertor's truth table where the right input bit is the constant zero (false). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int operator
public static final int NOT_OP
public static final int AND_OP
public static final int OR_OP
public static final int NAND_OP
public static final int NOR_OP
public static final int ANDN_OP
public static final int ORN_OP
public static final int XOR_OP
public static final int EQ_OP
public static final int MUX_OP
public static final int NMUX_OP
public static final int MUXN_OP
public static final int NMUXN_OP
public static final int MAJ_OP
public static final int NMAJ_OP
public static final int MAJN_OP
public static final int NMAJN_OP
public static final int ID_OP
public static final java.util.Vector inputFormat
Constructor Detail |
---|
public PrimitiveOperator(int truthTable) throws java.lang.IllegalArgumentException
truthTable
- the int that represents the truth table.
java.lang.IllegalArgumentException
public PrimitiveOperator(boolean[] truthTable) throws java.lang.IllegalArgumentException
truthTable
- the truth table that repesents the operator.
java.lang.IllegalArgumentException
Method Detail |
---|
public PrimitiveOperator negOut()
public PrimitiveOperator negLeft()
public PrimitiveOperator negMid()
public PrimitiveOperator negRight()
public PrimitiveOperator zeroRight()
public PrimitiveOperator oneRight()
public PrimitiveOperator zeroLeft()
public PrimitiveOperator oneLeft()
public PrimitiveOperator zeroMid()
public PrimitiveOperator oneMid()
public PrimitiveOperator equalLeftRight()
public PrimitiveOperator equalLeftMid()
public PrimitiveOperator equalRightMid()
public PrimitiveOperator switchRightLeft()
public PrimitiveOperator switchLeftMid()
public PrimitiveOperator switchRightMid()
public int arity()
arity
in class Operator
public int priority()
priority
in class Operator
public void toCircuit(java.io.PrintWriter circuit)
circuit
- the circuit output file.public java.lang.String toString()
toString
in class java.lang.Object
public boolean isID()
public boolean isNot()
public boolean isOne()
public boolean isZero()
public boolean isComplexIDOfLeft()
public boolean isComplexNotOfLeft()
public boolean isComplexIDOfRight()
public boolean isComplexNotOfRight()
public boolean isComplexIDOfMiddle()
public boolean isComplexNotOfMiddle()
public PrimitiveOperator combineRightNRight(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineRightNLeft(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineLeftNRight(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineLeftNLeft(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineRightNRightOnLeft(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineRightNLeftOnLeft(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineMidNRightOnLeft(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineMidNLeftOnLeft(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineRightNRightOnMid(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineRightNLeftOnMin(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineLeftNRightOnMid(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineLeftNLeftOnMid(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineMidNRightOnRight(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineMidNLeftOnRight(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineLeftNRightOnRight(PrimitiveOperator other)
other
- the op.
public PrimitiveOperator combineLeftNLeftOnRight(PrimitiveOperator other)
other
- the op.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |