diff options
Diffstat (limited to 'GateAnd.cpp')
-rw-r--r-- | GateAnd.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/GateAnd.cpp b/GateAnd.cpp new file mode 100644 index 0000000..e48b21c --- /dev/null +++ b/GateAnd.cpp @@ -0,0 +1,39 @@ +#include <iostream> + +#include "GateAnd.h" + +using std::cout; +using std::endl; + +GateAnd GateAnd::instance(GateAnd::type); + +GateAnd::GateAnd(const char * type) : Node(type) { + cout << __PRETTY_FUNCTION__ << endl; +} + +// Concrete Nodes: +void GateAnd::compare() { + SignalLevel new_out = HIGH; +// TODO fix segfault somewhere below +// for (int i = 0; i < this->inputs.size(); i++){ +// switch (this->inputs[i]->getLevel()){ +// case LOW: +// new_out = LOW; +// break; +// case HIGH: +// continue; +// break; +// case UNDEFINED: +// default: +// new_out = UNDEFINED; +// exit; +// break; +// } +// } + +// if (this->output->getLevel() == new_out){ +// /* do nothing */ +// } else { +// this->output->setLevel(new_out); +// } +} |