Merge branch 'master' of https://gitlab.com/AluminumTank/radec
This commit is contained in:
commit
bf8d3c78a5
@ -10,15 +10,12 @@ AndGate::AndGate(int d, Wire* wire1, Wire* wire2, Wire* wire3) {
|
|||||||
}
|
}
|
||||||
Event AndGate::evaluate(int evTime) {
|
Event AndGate::evaluate(int evTime) {
|
||||||
if (in1->getValue(evTime) == 0 || in2->getValue(evTime) == 0) {
|
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);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(in1->getValue(evTime) == 1 && in2->getValue(evTime) == 1){
|
else 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);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int AndGate::getDelay()
|
int AndGate::getDelay()
|
||||||
|
@ -11,15 +11,11 @@ NandGate::NandGate(int d, Wire * wire1, Wire * wire2, Wire * wire3)
|
|||||||
Event NandGate::evaluate(int evTime)
|
Event NandGate::evaluate(int evTime)
|
||||||
{
|
{
|
||||||
if (in1->getValue(evTime) == 0 || in2->getValue(evTime) == 0) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
if (out->getValue(evTime + delay) != 0) {
|
|
||||||
return Event(-1, 0, evTime + delay, out);
|
return Event(-1, 0, evTime + delay, out);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int NandGate::getDelay()
|
int NandGate::getDelay()
|
||||||
|
@ -10,15 +10,11 @@ NotGate::NotGate(int d, Wire* wire1, Wire* wire2) {
|
|||||||
|
|
||||||
Event NotGate::evaluate(int evTime) {
|
Event NotGate::evaluate(int evTime) {
|
||||||
if (in1->getValue(evTime) == 0) {
|
if (in1->getValue(evTime) == 0) {
|
||||||
if (out->getValue(evTime + delay) != 0) {
|
|
||||||
return Event(-1, 0, evTime + delay, out);
|
return Event(-1, 0, evTime + delay, out);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else{
|
else{
|
||||||
if (out->getValue(evTime + delay) != 1) {
|
|
||||||
return Event(-1, 1, evTime + delay, out);
|
return Event(-1, 1, evTime + delay, out);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int NotGate::getDelay()
|
int NotGate::getDelay()
|
||||||
|
Loading…
Reference in New Issue
Block a user