diff options
Diffstat (limited to 'GateNot.cpp')
-rw-r--r-- | GateNot.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/GateNot.cpp b/GateNot.cpp new file mode 100644 index 0000000..c272022 --- /dev/null +++ b/GateNot.cpp @@ -0,0 +1,20 @@ +#include "GateNot.h" + +GateNot GateNot::instance(GateNot::type); + +SignalLevel GateNot::level() { + SignalLevel new_level = LOW; + for (int i = 0; i < this->inputs.size(); i++){ + SignalLevel l = this->inputs[i]->getLevel(); + + if (l == UNDEFINED) return UNDEFINED; + if (l == HIGH) new_level = HIGH; + } + return new_level; +} + +GateNot::GateNot(const GateNot * prototype) : Node() { } + +GateNot * GateNot::clone() const { + return new GateNot(this); +} |