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