remove old code
This commit is contained in:
parent
fe794c6725
commit
5e9932b1dd
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user