-1

I'm a bit confused. I need to make an example of using the ITE-Algorithm on every Boolean operation. But I actually don't know how much there are? As an example I mean, AND, OR, XOR, XNOR, NOR, NAND, NOT. And I don't know the other ones... I at least miss one because it cannot be seven operations. (2^n)

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58

1 Answers1

0

I need to make an example of using the ITE-Algorithm on every Boolean operation.

This is Exercise 1 from the Fascicle 1B of the Volume 4 of Knuth's The art of computer programming.

The answer is the following.

answer


But I actually don't know how much there are?

There are exactly 16 boolean functions of two variables (and 22ⁿ functions of n variables). Just permutate rows in functions' truth tables.

| F0 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | FA | FB | FC | FD | FE | FH |
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
|  0 |  0 |  0 |  0 |  0 |  0 |  0 |  0 |  1 |  1 |  1 |  1 |  1 |  1 |  1 |  1 |
|  0 |  0 |  0 |  0 |  1 |  1 |  1 |  1 |  0 |  0 |  0 |  0 |  1 |  1 |  1 |  1 |
|  0 |  0 |  1 |  1 |  0 |  0 |  1 |  1 |  0 |  0 |  1 |  1 |  0 |  0 |  1 |  1 |
|  0 |  1 |  0 |  1 |  0 |  1 |  0 |  1 |  0 |  1 |  0 |  1 |  0 |  1 |  0 |  1 |

F0 and FH do not depend on the values of both variables.
F3, F5, FA, FC depend on the value of only one variable.

The table below lists common names of these functions.

boolean functions

The above table is from the Fascicle 0B of the Volume 4.

I'd add that F8 and FE are also known as Pierce's arrow and Sheffer stroke respectively.

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58