From WikiChip
Difference between revisions of "boolean algebra/truth-vector"
< boolean algebra

(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 18:39, 21 December 2015

A truth-vector is a vector representation of a truth table.

Equation upper F equals left-bracket f left-parenthesis 0 right-parenthesis comma f left-parenthesis 1 right-parenthesis comma ellipsis comma f left-parenthesis 2 Superscript n Baseline minus 1 right-parenthesis right-bracket Superscript upper T

Where the i-th element Equation f left-parenthesis i right-parenthesis element-of StartSet 0 comma 1 comma 2 comma ellipsis comma 2 Superscript n Baseline minus 1 EndSet 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.


Equation upper F equals left-bracket 1 comma 1 comma 0 comma 0 comma 0 comma 1 comma 0 comma 0 right-bracket Superscript upper T