View Single Post
Old Jun 3rd, 2006, 10:12 AM   #7
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,013
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
Okay. I have an example of what the program would do for my original truth table.

Y = OR(A, NOR(OR(AND(NOT(C), AND(B, D)), AND(OR(NOR(E, F), AND(AND(NOT(E), F), NOT(B))), AND(C, NOT(D)))), AND((AND(AND(NOT(C), D), OR(E, F))), NOT(B))))

That's what it would output for the first logical expression. As each number in the first output column can be satisfied by these conditions.

I figured it out in my head, and I couldn't even start explaining how I did it. It would be very tough to program this I think. I would think someone has already though.

If you'd like to test that equation, it is wrtten in Python using these functions...
def AND(x, y):
    return (x and y)
def NAND(x, y):
    return not AND(x, y)
def OR(x, y):
    return (x or y)
def NOR(x, y):
    return not OR(x, y)
def XOR(x, y):
    return (x or y) and (not (x and y))
def XNOR(x, y):
    return not XOR(x, y)
def NOT(x):
    return not x
Sane is offline   Reply With Quote