This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:asm:orapi [2011/01/30 02:28] – [AND() constructor] jr018429 | notes: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; | ||
+ | </ | ||
+ | |||
+ | ^ Function | ||
+ | | OR() | none | pointer/ | ||
+ | |||
+ | 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(); | ||
+ | </ | ||
+ | |||
+ | ^ Function | ||
+ | | void reset() | ||
+ | |||
+ | =====set(bool)===== | ||
+ | set(bool) will take the parameter and set both inputs to that value. | ||
+ | |||
+ | <code c++> | ||
+ | myOrGate.set(true); | ||
+ | </ | ||
+ | |||
+ | ^ Function | ||
+ | | void set() | bool | none | | ||
+ | |||
+ | =====set(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, | ||
+ | </ | ||
+ | |||
+ | ^ Function | ||
+ | | void set() | bool, bool | none | | ||
+ | |||
+ | =====setvalue()===== | ||
+ | get() will retrieve the output of the OR. | ||
+ | |||
+ | <code c++> | ||
+ | bool output = myOrGate.get(); | ||
+ | </ | ||
+ | |||
+ | ^ Function | ||
+ | | bool get(int) | ||