# Which Boolean Math mode should I use?

I always find the description within Blender interface or in the docs confusing:

Mode

And: True when both inputs are true. (AND)

Or: True when at least one input is true. (OR)

Not: Opposite of the input. (NOT)

Not And: (True when at least one input is false. NAND)

Nor: True when both inputs are false. (NOR)

Equal: True when both inputs are equal. Also known as “exclusive nor”. (XNOR)

Not Equal: (XOR) True when both inputs are different. Also known as “exclusive or”.

Imply: True unless the first input is true and the second is false. (IMPLY)

Subtract: True when the first input is true and the second is false. Also known as “”not imply”. (NIMPLY)

...And for how ridiculously few combinations there are for 2 binary operands and one binary result, I just draw myself a table, decide which results I want in the table and see which mode achieves that. So I decided to prepare a tidy cheat-sheet to make this process easier for myself and others in the future.

Node tree used:

• Nice cheat sheet, although I don't find the descriptions confusing (admittedly I have never read them before). But studying maths and IT surely helps with understanding the variations. Commented Aug 11 at 15:09
• @GordonBrinkmann As for the "confusing" part - a typical situation is where I want to combine two boolean settings, like "use simple algorithm" and "make convex", and then decide to do something based on those two settings... The reasoning from design perspective alone can be non-obvious, so by far the easiest approach is to consider all 4 possible combinations of inputs. Once I have that, it's not obvious which option to pick, because the mapping in my head goes in the opposite way :D Commented Aug 12 at 11:27

Some possibilities are missing. Two of them you can achieve by reversing A↔B:

And the rest is trivial because it's either a constant value (no boolean math) or a NOT of either A or B:

These "cheat sheets" you have made are simply truth tables. Here is a diagram I found online:

I suggest you learn the correct terminology and get used to reading truth tables, it's very easy with a bit of practice and will save you a lot of time. Looking at these tables for each gate is slow and should really be a last resort. Also knowing how these tables work allows you to construct your own if you have a particularly complex output you need to construct an expression for.

I'm also not sure what's confusing about the Blender explanations, they are straightforward explanations in prose and could hardly be easier to understand!

• Just because those are truth tables, doesn't rule out that it's a cheat-sheet of them. Also you seem to contradict yourself in two consecutive sentences: "[...] get used to reading truth tables, it's very easy with a bit of practice and will save you a lot of time. Looking at these tables for each gate is slow and should really be a last resort." - so get used to doing it, or avoid doing it? And why would you need to construct your own truth table, do you mean more than 2 operands? Otherwise I literally assembled all possible combinations so no reason to construct more. Commented Aug 12 at 11:20
• I honestly don't see a reason for this answer as it does not show anything new compared to the previously existing answer - only that your truth tables are designed differently... Commented Aug 12 at 11:56
• @MarkusvonBroady I'm not contradicting myself. Learn how to read truth tables, memorise them, then never use them again, because using them is slow. I have never used such a diagram as a cheat-sheet because they're stored in my head, the diagram is purely to demonstrate that such diagrams already exist. As for making your own, if you have four input variables and two outputs then the easiest way to construct your boolean expression is via a 4-input/2-output truth table and/or a Karnaugh map. For this reason, learning how to read truth tables is valuable. But using them for 2 inputs is slow. Commented Aug 12 at 15:48
• @GordonBrinkmann Well I don't see a reason for the question as it's answered by Googling "truth table" or "Boolean logic", or within the first five minutes of any logic class, which is what I was trying to get across (albeit more politely). Commented Aug 12 at 15:50
• Okay, because you thought the question and answer were not worth posting you saw the need to post another answer instead of just commenting on it... Commented Aug 12 at 16:15