In order to fully understand truth tables with relation to Boolean functions, one must first consider the most general case, a Boolean function of N variables. What is the total number of unique truth tables that can be constructed for Boolean functions of N variables?
Step 1
Consider the total number of possible inputs. This will also tell you the total number of possible outputs.
With N inputs, there will be 2N possible inputs and therefore, 2N possible outputs.
Step 2
Next, consider that for each input there are two different possible outputs, true or false.
Step 3
In order to find the total number of unique truth tables, we must consider the total number of outputs AND that there are two distinct possibilities for the values of each of these outputs. Therefore, we arrive at our answer.
22^N
And now we will do an example of a truth table for a specific Boolean function. Let us look at the Boolean function XOR. A XOR gate takes n inputs and produces one output. The value of the output is false if all of the inputs are true or if all of the inputs are false, otherwise the output is true. Build a truth table for a 3-input XOR gate.
Step 1
Set up the truth table of three inputs, A,B,C, and one output, Y.
| A | B | C | Y |
| 0 | 0 | 0 | |
| 0 | 0 | 1 | |
| 0 | 1 | 0 | |
| 0 | 1 | 1 | |
| 1 | 0 | 0 | |
| 1 | 0 | 1 | |
| 1 | 1 | 0 | |
| 1 | 1 | 1 |
Step 2
Look at the combinations of inputs A, B, and C where all of them are equal to 0 or all of them are equal to 1. Set Y for these to be 0. All else are 1.
| A | B | C | Y |
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 |




