The AND class implements a functioning logical AND gate for use with our CPU simulator.
AND myAndGate;
Function | Parameter(s) | Return value |
---|---|---|
AND() | none | pointer/variable instantiation of the newly allocated AND gate |
AND() is the parameterless constructor that is responsible for creating a new instance of an AND.
reset() will reset both inputs coming into the AND to FALSE values.
myAndGate.reset();
Function | Parameter(s) | Return value |
---|---|---|
void reset() | no parameters | none |
set(bool) will take the parameter and set both inputs to that value.
myAndGate.set(true);
Function | Parameter(s) | Return value |
---|---|---|
void set() | bool | none |
set(bool, bool) will take the parameter and set each input to a unique value.
bool a = true; bool b = false; ... myAndGate.set(a, b);
Function | Parameter(s) | Return value |
---|---|---|
void set() | bool, bool | none |
get() will retrieve the output of the AND.
bool output = myAndGate.get();
Function | Parameter(s) | Return value |
---|---|---|
bool get(int) | none | boolean value of gate's output |