//public NAND(Node Input1, Node Input2, Node Out) //{ // Input[0] = Input1; // Input[1] = Input2; // Output = Out; //} public override short? calculateMinInputs(short? x, short? y) { short? result = null; AND and = new AND(x, y, result); NOT not = new NOT(result, result); return result; }
private void createGateDueToType(object sender, PaintEventArgs e) { //switch can be replaced by a one line of code using runtime Creation ((gotta GOOGLE it)) Gate g; switch (gateType) { case "OR": g = new OR(); break; case "NOT": g = new NOT(); break; case "AND": g = new AND(); break; case "NAND": g = new NAND(); break; default: g = null; break; } g.Draw(sender, e); }
public override void calculate() { Node tempOut = new Node(); AND and = new AND(InputNodesList[0], InputNodesList[1], tempOut); and.validate(); NOT not = new NOT(tempOut, Output); not.validate(); }
//public NAND(Node Input1, Node Input2, Node Out) //{ // Input[0] = Input1; // Input[1] = Input2; // Output = Out; //} public override short?calculateMinInputs(short?x, short?y) { short?result = null; AND and = new AND(x, y, result); NOT not = new NOT(result, result); return(result); }