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,16 +11,12 @@ 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);
}
}
else if (in1->getValue(evTime) == 0 && in2->getValue(evTime) == 0) {
if (out->getValue(evTime + delay) != 1) {
return Event(-1, 1, evTime + delay, out);
}
}
}
int NorGate::getDelay()
{

View File

@ -11,16 +11,12 @@ 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);
}
}
else if (in1->getValue(evTime) == 0 && in2->getValue(evTime) == 0) {
if (out->getValue(evTime + delay) != 0) {
return Event(-1, 0, evTime + delay, out);
}
}
}
int OrGate::getDelay()
{

View File

@ -12,17 +12,13 @@ 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);
}
}
else {
if (out->getValue(evTime + delay) != 0) {
return Event(-1, 0, evTime + delay, out);
}
}
}
}
int XnorGate::getDelay()
{

View File

@ -12,17 +12,13 @@ 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);
}
}
else {
if (out->getValue(evTime + delay) != 0) {
return Event(-1, 0, evTime + delay, out);
}
}
}
}
int XorGate::getDelay()
{