remove old code

This commit is contained in:
Joel Beckmeyer 2017-04-24 22:25:51 -04:00
parent fe794c6725
commit 5e9932b1dd
4 changed files with 8 additions and 24 deletions

View File

@ -11,15 +11,11 @@ NorGate::NorGate(int d, Wire* wire1, Wire* wire2, Wire* wire3) {
Event NorGate::evaluate(int evTime) { Event NorGate::evaluate(int evTime) {
if (in1->getValue(evTime) == 1 || in2->getValue(evTime) == 1) { 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) { 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);
} }
}
} }
int NorGate::getDelay() int NorGate::getDelay()

View File

@ -11,15 +11,11 @@ OrGate::OrGate(int d, Wire* wire1, Wire* wire2, Wire* wire3) {
Event OrGate::evaluate(int evTime) { Event OrGate::evaluate(int evTime) {
if (in1->getValue(evTime) == 1 || in2->getValue(evTime) == 1) { 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) { 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);
} }
}
} }
int OrGate::getDelay() int OrGate::getDelay()

View File

@ -12,16 +12,12 @@ XnorGate::XnorGate(int d, Wire* wire1, Wire* wire2, Wire* wire3) {
Event XnorGate::evaluate(int evTime) { Event XnorGate::evaluate(int evTime) {
if (in1->getValue(evTime) != -1 && in2->getValue(evTime) != -1) { if (in1->getValue(evTime) != -1 && in2->getValue(evTime) != -1) {
if (in1->getValue(evTime) == in2->getValue(evTime)) { 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 { else {
if (out->getValue(evTime + delay) != 0) {
return Event(-1, 0, evTime + delay, out); return Event(-1, 0, evTime + delay, out);
} }
} }
}
} }
int XnorGate::getDelay() int XnorGate::getDelay()

View File

@ -12,16 +12,12 @@ XorGate::XorGate(int d, Wire* wire1, Wire* wire2, Wire* wire3) {
Event XorGate::evaluate(int evTime) { Event XorGate::evaluate(int evTime) {
if (in1->getValue(evTime) != -1 && in2->getValue(evTime) != -1) { if (in1->getValue(evTime) != -1 && in2->getValue(evTime) != -1) {
if (in1->getValue(evTime) != in2->getValue(evTime)) { 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 { else {
if (out->getValue(evTime + delay) != 0) {
return Event(-1, 0, evTime + delay, out); return Event(-1, 0, evTime + delay, out);
} }
} }
}
} }
int XorGate::getDelay() int XorGate::getDelay()