Optimization
Optimization with QB Logic
Logic Optimization Intro

For any two truth values X and Y, there exists 4 possible combined True/False states. There exists 16 possible operators that return T or F based on those 4 states.

In QB, there are only 5 such operators available: AND, OR, XOR, EQV, and IMP. There is, additionally, one operator that inverts all the bits of a single variable, which was somehow lumped in with the QB Help and therefore it is now lumped in here: NOT. :)


Operates on: X X,Y X,Y X,Y X,Y X,Y

X Y NOT AND OR XOR EQV IMP
-------------------------------------------------
T T F T T F T T
T F F F T T F F
F T T F T T F T
F F T F F F T T

(TRUE <> 0: FALSE = 0)

You are (I hope) familiar with AND and OR, but what about NOT, XOR, EQV, and IMP? Do they have any use? I will now give examples to demonstrate their use. In each case, the second one with one of the aforementioned operators is faster because there are fewer steps taken to reach a result.

-Agamemnus


LogicChapterA - page last edited 2003-08-16 04:40:52 by 172.130.131.204 (home) (edit)
Blast WIKI - by RoboticBoy - edited and tweaked for our evil purposes by Hexadecimal Disaster