diff options
Diffstat (limited to 'GateNot.cpp')
-rw-r--r-- | GateNot.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/GateNot.cpp b/GateNot.cpp index c272022..a29744f 100644 --- a/GateNot.cpp +++ b/GateNot.cpp @@ -3,14 +3,10 @@ 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; + SignalLevel lvl = this->inputs[0]->getLevel(); + if (lvl == LOW) return HIGH; + if (lvl == HIGH) return LOW; + return UNDEFINED; } GateNot::GateNot(const GateNot * prototype) : Node() { } |