diff --git a/src/NorGate.cpp b/src/NorGate.cpp index cf8906c..45c5001 100644 --- a/src/NorGate.cpp +++ b/src/NorGate.cpp @@ -11,14 +11,10 @@ NorGate::NorGate(int d, Wire* wire1, Wire* wire2, Wire* wire3) { Event NorGate::evaluate(int evTime) { if (in1->getValue(evTime) == 1 || in2->getValue(evTime) == 1) { - if (out->getValue(evTime + delay) != 0) { - return Event(-1, 0, evTime + delay, out); - } + return Event(-1, 0, evTime + delay, out); } else if (in1->getValue(evTime) == 0 && in2->getValue(evTime) == 0) { - if (out->getValue(evTime + delay) != 1) { - return Event(-1, 1, evTime + delay, out); - } + return Event(-1, 1, evTime + delay, out); } } diff --git a/src/OrGate.cpp b/src/OrGate.cpp index 0decdeb..7015261 100644 --- a/src/OrGate.cpp +++ b/src/OrGate.cpp @@ -11,14 +11,10 @@ OrGate::OrGate(int d, Wire* wire1, Wire* wire2, Wire* wire3) { Event OrGate::evaluate(int evTime) { if (in1->getValue(evTime) == 1 || in2->getValue(evTime) == 1) { - if (out->getValue(evTime + delay) != 1) { - return Event(-1, 1, evTime + delay, out); - } + return Event(-1, 1, evTime + delay, out); } else if (in1->getValue(evTime) == 0 && in2->getValue(evTime) == 0) { - if (out->getValue(evTime + delay) != 0) { - return Event(-1, 0, evTime + delay, out); - } + return Event(-1, 0, evTime + delay, out); } } diff --git a/src/XnorGate.cpp b/src/XnorGate.cpp index 8642e5c..3e6d33f 100644 --- a/src/XnorGate.cpp +++ b/src/XnorGate.cpp @@ -12,14 +12,10 @@ XnorGate::XnorGate(int d, Wire* wire1, Wire* wire2, Wire* wire3) { Event XnorGate::evaluate(int evTime) { if (in1->getValue(evTime) != -1 && in2->getValue(evTime) != -1) { if (in1->getValue(evTime) == in2->getValue(evTime)) { - if (out->getValue(evTime + delay) != 1) { - return Event(-1, 1, evTime + delay, out); - } + return Event(-1, 1, evTime + delay, out); } else { - if (out->getValue(evTime + delay) != 0) { - return Event(-1, 0, evTime + delay, out); - } + return Event(-1, 0, evTime + delay, out); } } } diff --git a/src/XorGate.cpp b/src/XorGate.cpp index 14b6f23..f19f86b 100644 --- a/src/XorGate.cpp +++ b/src/XorGate.cpp @@ -12,14 +12,10 @@ XorGate::XorGate(int d, Wire* wire1, Wire* wire2, Wire* wire3) { Event XorGate::evaluate(int evTime) { if (in1->getValue(evTime) != -1 && in2->getValue(evTime) != -1) { if (in1->getValue(evTime) != in2->getValue(evTime)) { - if (out->getValue(evTime + delay) != 1) { - return Event(-1, 1, evTime + delay, out); - } + return Event(-1, 1, evTime + delay, out); } else { - if (out->getValue(evTime + delay) != 0) { - return Event(-1, 0, evTime + delay, out); - } + return Event(-1, 0, evTime + delay, out); } } }