From ebd79657e7e55b0c909813c84ab830a88783f0d1 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Tue, 25 Apr 2017 10:51:14 -0400 Subject: [PATCH] start implementing fixes to account for oscillation --- src/NandGate.cpp | 2 ++ src/Simulation.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/NandGate.cpp b/src/NandGate.cpp index 13f9dc6..7f428dd 100644 --- a/src/NandGate.cpp +++ b/src/NandGate.cpp @@ -1,4 +1,5 @@ #include "NandGate.h" +#include 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); } diff --git a/src/Simulation.cpp b/src/Simulation.cpp index c05520f..37026bd 100644 --- a/src/Simulation.cpp +++ b/src/Simulation.cpp @@ -207,3 +207,4 @@ int Simulation::getDelay(string d) d.resize(d.size() - 2); return atoi(d.c_str()); } +