User Tools

Site Tools


notes:asm:orapi

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:asm:orapi [2011/01/30 02:26] – removed jr018429notes:asm:orapi [2011/01/30 02:33] (current) – [AND class] jr018429
Line 1: Line 1:
 +======OR class======
 +
 +The OR class implements a functioning logical OR gate for use with our CPU simulator.
 +
 +=====OR() constructor=====
 +
 +<code c++>
 +OR myOrGate;
 +</code>
 +
 +^  Function  ^  Parameter(s)  ^  Return value  |
 +|  OR()  |  none  |  pointer/variable instantiation of the newly allocated OR gate  |
 +
 +OR() is the parameterless constructor that is responsible for creating a new instance of an OR.
 +
 +=====reset()=====
 +reset() will reset both inputs coming into the OR to FALSE values.
 +
 +<code c++>
 +myOrGate.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++>
 +myOrGate.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;
 +
 +...
 +
 +myOrGate.set(a, b);
 +</code>
 +
 +^  Function  ^  Parameter(s)  ^  Return value  |
 +|  void set()  |  bool, bool  |  none  |
 +
 +=====setvalue()=====
 +get() will retrieve the output of the OR.
 +
 +<code c++>
 +bool output = myOrGate.get();
 +</code>
 +
 +^  Function  ^  Parameter(s)  ^  Return value  |
 +|  bool get(int)  |  none  |  boolean value of gate's output  |