User Tools

Site Tools


notes:asm:xorapi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
notes:asm:xorapi [2011/01/30 02:37] jr018429notes:asm:xorapi [2011/05/13 13:35] (current) – [AND() constructor] jr018429
Line 1: Line 1:
 +======XOR class======
 +
 +The XOR class implements a functioning logical XOR gate for use with our CPU simulator.
 +
 +=====XOR() constructor=====
 +
 +<code c++>
 +XOR myXorGate;
 +</code>
 +
 +^  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()=====
 +reset() will reset both inputs coming into the XOR to FALSE values.
 +
 +<code c++>
 +myXorGate.reset();
 +</code>
 +
 +^  Function  ^  Parameter(s)  ^  Return value  |
 +|  void reset()  |  no parameters  |  none  |
 +
 +=====set(bool)=====
 +set(bool) will take the parameter and set both inputs to that value.
 +
 +<code c++>
 +myXorGate.set(true);
 +</code>
 +
 +^  Function  ^  Parameter(s)  ^  Return value  |
 +|  void set()  |  bool  |  none  |
 +
 +=====set(bool, bool)=====
 +set(bool, bool) will take the parameter and set each input to a unique value.
 +
 +<code c++>
 +bool a = true;
 +bool b = false;
 +
 +...
 +
 +myXorGate.set(a, b);
 +</code>
 +
 +^  Function  ^  Parameter(s)  ^  Return value  |
 +|  void set()  |  bool, bool  |  none  |
 +
 +=====setvalue()=====
 +get() will retrieve the output of the XOR.
 +
 +<code c++>
 +bool output = myXorGate.get();
 +</code>
 +
 +^  Function  ^  Parameter(s)  ^  Return value  |
 +|  bool get(int)  |  none  |  boolean value of gate's output  |