start implementing fixes to account for oscillation

This commit is contained in:
Joel Beckmeyer 2017-04-25 10:51:14 -04:00
parent 848c471b14
commit ebd79657e7
2 changed files with 3 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include "NandGate.h"
#include <iostream>
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)
{
cout << evTime << " " << in1->getValue(evTime) << " " << in2->getValue(evTime) << endl;
if (in1->getValue(evTime) == 0 || in2->getValue(evTime) == 0) {
return Event(1, evTime + delay, out);
}

View File

@ -207,3 +207,4 @@ int Simulation::getDelay(string d)
d.resize(d.size() - 2);
return atoi(d.c_str());
}