radec/src/andGate.cpp
2017-04-10 19:38:54 -04:00

12 lines
311 B
C++

#include "andGate.h"
using namespace std;
andGate::andGate(wire* wire1 = nullptr, wire* wire2 = nullptr,
wire* wire3 = nullptr) : in1(wire1), in2(wire2), out(wire3) {}
int andGate::evaluate(int evTime) {
int bool1 = in1 -> getValue();
return ( in1 -> getValue(evTime) ) && ( in2 -> getValue(evTime) );
}