From WikiChip
Difference between revisions of "boolean algebra/truth-vector"
(Created page with "{{ba title|Truth-vector}} A '''truth-vector''' is a vector representation of a truth table. ::<math>F = [f(0), f(1), \ldots, f(2^n - 1)]^T</math> Where the ''i''-th elem...") |
|||
Line 5: | Line 5: | ||
Where the ''i''-th element <math>f(i) \in \{0, 1, 2, \dots, 2^n-1\}</math> of the truth table is the value of a Boolean function of the i-th row in the truth table. | Where the ''i''-th element <math>f(i) \in \{0, 1, 2, \dots, 2^n-1\}</math> of the truth table is the value of a Boolean function of the i-th row in the truth table. | ||
+ | |||
+ | == Example == | ||
+ | {| class="wikitable" style="float: right;" | ||
+ | ! A !! B !! C !! Q | ||
+ | |- | ||
+ | | 0 || 0 || 0 || 1 | ||
+ | |- | ||
+ | | 0 || 0 || 1 || 1 | ||
+ | |- | ||
+ | | 0 || 1 || 0 || 0 | ||
+ | |- | ||
+ | | 0 || 1 || 1 || 0 | ||
+ | |- | ||
+ | | 1 || 0 || 0 || 0 | ||
+ | |- | ||
+ | | 1 || 0 || 1 || 1 | ||
+ | |- | ||
+ | | 1 || 1 || 0 || 0 | ||
+ | |- | ||
+ | | 1 || 1 || 1 || 0 | ||
+ | |} | ||
+ | For example, the following 3-variable [[truth table]] on the right has the following truth-vector. | ||
+ | |||
+ | |||
+ | ::<math>F = [1,1,0,0,0,1,0,0]^T</math> |
Latest revision as of 17:39, 21 December 2015
A truth-vector is a vector representation of a truth table.
Where the i-th element of the truth table is the value of a Boolean function of the i-th row in the truth table.
Example[edit]
A | B | C | Q |
---|---|---|---|
0 | 0 | 0 | 1 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 0 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 0 |
1 | 1 | 1 | 0 |
For example, the following 3-variable truth table on the right has the following truth-vector.