start implementing fixes to account for oscillation
This commit is contained in:
parent
848c471b14
commit
ebd79657e7
@ -1,4 +1,5 @@
|
|||||||
#include "NandGate.h"
|
#include "NandGate.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
NandGate::NandGate(int d, Wire * wire1, Wire * wire2, Wire * wire3)
|
NandGate::NandGate(int d, Wire * wire1, Wire * wire2, Wire * wire3)
|
||||||
{
|
{
|
||||||
@ -10,6 +11,7 @@ NandGate::NandGate(int d, Wire * wire1, Wire * wire2, Wire * wire3)
|
|||||||
|
|
||||||
Event NandGate::evaluate(int evTime)
|
Event NandGate::evaluate(int evTime)
|
||||||
{
|
{
|
||||||
|
cout << evTime << " " << in1->getValue(evTime) << " " << in2->getValue(evTime) << endl;
|
||||||
if (in1->getValue(evTime) == 0 || in2->getValue(evTime) == 0) {
|
if (in1->getValue(evTime) == 0 || in2->getValue(evTime) == 0) {
|
||||||
return Event(1, evTime + delay, out);
|
return Event(1, evTime + delay, out);
|
||||||
}
|
}
|
||||||
|
@ -207,3 +207,4 @@ int Simulation::getDelay(string d)
|
|||||||
d.resize(d.size() - 2);
|
d.resize(d.size() - 2);
|
||||||
return atoi(d.c_str());
|
return atoi(d.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user