public void KmapFromMinterms() { int[] mintermArray = new[] { 1, 2, 3, 4, 8, 9, 0, 4, 5, 10 }; List <int> mintermList = new List <int>(mintermArray); KarnaughMap kmap1 = new KarnaughMap(mintermList, 4); Console.WriteLine(kmap1.ToString()); Console.WriteLine(mintermList.ToString()); }
public void CreateKMap() { //BooleanExpression expression1 = new BooleanExpression("a'*b'*c*d+a'*b*c'*e+a*b'*c'*e'+a'*b*c*d'+a*b'*c*e+a*c'*d'*e+a*c*d'*e'"); BooleanExpression expression1 = new BooleanExpression("b'*d' +a'*d + c'*d"); BooleanExpression expression2 = new BooleanExpression("a'b'cd + a'bc'e + ab'c'e' + a'bcd' + ab'ce + ac'd'e + acd'e'"); KarnaughMap kmap1 = new KarnaughMap(expression2); Console.WriteLine(kmap1.ToString()); }
protected override void interpretInput(String input) { switch (input) { case "new": newKmap(); break; case "print": if (this.hasCurrentObject()) { Console.WriteLine(currentObject.ToString()); } break; case "minterms": if (this.hasCurrentObject()) { Console.WriteLine(currentObject.MintermString()); } break; case "expression": if (this.hasCurrentObject()) { Console.WriteLine(currentObject.getSimpleExpression()); } break; case "exit": break; default: Console.WriteLine("Invalid command, please enter a new command, type 'help' for options"); break; } }