Search code examples
booleanboolean-logicboolean-expressionboolean-operations

Boolean function for True only if last True


Is there any way how to get true only if second value is true?

| A | B | Result |
|---|---|--------|
| 0 | 0 | 0      |
| 0 | 1 | 1      |
| 1 | 0 | 0      |
| 1 | 1 | 0      |

Solution

  • Looks like ~A & B would suffice.