User Tools

Site Tools


notes:asm:andapi

Differences

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

Link to this comparison view

Next revision
Previous revision
notes:asm:andapi [2011/01/30 00:50] – created wedgenotes:asm:andapi [2011/02/04 01:57] (current) bh011695
Line 1: Line 1:
 +======AND class======
 +
 +The AND class implements a functioning logical AND gate for use with our CPU simulator.
 +
 +=====AND() constructor=====
 +
 +<code c++>
 +AND myAndGate;
 +</code>
 +
 +^  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()=====
 +reset() will reset both inputs coming into the AND to FALSE values.
 +
 +<code c++>
 +myAndGate.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++>
 +myAndGate.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;
 +
 +...
 +
 +myAndGate.set(a, b);
 +</code>
 +
 +^  Function  ^  Parameter(s)  ^  Return value  |
 +|  void set()  |  bool, bool  |  none  |
 +
 +=====getvalue()=====
 +get() will retrieve the output of the AND.
 +
 +<code c++>
 +bool output = myAndGate.get();
 +</code>
 +
 +^  Function  ^  Parameter(s)  ^  Return value  |
 +|  bool get(int)  |  none  |  boolean value of gate's output  |