真理値表の作成ツール

Truth table of a Boolean expression in up to 6 variables, with the canonical sum of products, product of sums, minterms and maxterms.

更新日 検証済みの例:8

Operators: not (! ~ ¬ or a trailing '), and (& ·), nand, xor (^ ⊕), or (| +), nor, implies (->), iff (<->). Constants 0 and 1.
試す
Canonical sum of products
A'·B'·C' + A'·B·C' + A·B'·C' + A·B·C' + A·B·C
Canonical sum of products: A'·B'·C' + A'·B·C' + A·B'·C' + A·B·C' + A·B·C
Canonical product of sums
(A + B + C')·(A + B' + C')·(A' + B + C')
Minterms (rows that are 1)
Σm(0, 2, 4, 6, 7)
Maxterms (rows that are 0)
ΠM(1, 3, 5)
Rows that are true
5
Classification
Contingent

The expression is true in 5 of 8 rows (minterms 0, 2, 4, 6, 7), so its value depends on the inputs.

Columns of the truth table (row 0 on the left)

A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
F
1
0
1
0
1
0
1
1
真理値表 行数:8
RowABCF
00001
10010
20101
30110
41001
51010
61101
71111
計算方法 S
  1. Read with operator precedence

    (A∧B)∨¬C\left(A \land B\right) \lor \lnot C

    not binds tightest, then and/nand, xor, or/nor, implies (grouped from the right), and iff last.

  2. Evaluate all 8 rows

    Each row sets A, B, C to one combination of 0s and 1s, counting in binary with A as the most significant bit; the row number is the minterm index.

  3. Minterms and maxterms

    F=∑m(0,2,4,6,7)=∏M(1,3,5)F = \sum m(0, 2, 4, 6, 7) = \prod M(1, 3, 5)
  4. Canonical sum of products

    F=A‾B‾C‾+A‾BC‾+AB‾C‾+ABC‾+ABCF = \overline{A} \overline{B} \overline{C} + \overline{A} B \overline{C} + A \overline{B} \overline{C} + A B \overline{C} + A B C

    One product term for each row where F = 1; a bar means the variable is 0 in that row.

  5. Canonical product of sums

    F=(A+B+C‾)(A+B‾+C‾)(A‾+B+C‾)F = (A + B + \overline{C})(A + \overline{B} + \overline{C})(\overline{A} + B + \overline{C})

    One sum term for each row where F = 0; each term is 0 only in its own row.

真理値表の作成ツールについて

A truth table lists the value of a Boolean expression for every combination of its inputs: 2ⁿ rows for n variables, so 8 rows for A, B and C. Each row where the expression is 1 is a minterm, and the OR of those minterms is the canonical sum of products; each row where it is 0 is a maxterm, and the AND of the maxterms is the canonical product of sums. Both describe the same function.

Digital logic and computer science students use it to check circuit designs, simplify conditions and verify logic laws. The default, (A and B) or not C, is true in 5 of 8 rows, minterms 0, 2, 4, 6 and 7, and false in rows 1, 3 and 5.

Up to 6 variables (64 rows) are accepted. Precedence runs not, and/nand, xor, or/nor, implies (grouped from the right), then iff; symbols such as !, &, | and ^ also work. An expression true in every row is a tautology, and one false in every row is a contradiction.

計算例

A and B

Boolean expression
A and B
Canonical sum of products
A·B
Minterms (rows that are 1)
Σm(3)
Rows that are true
1
Classification
Contingent

照合元:Python itertools.product over (A, B): only A=1, B=1 is true

A xor B

Boolean expression
A xor B
Canonical sum of products
A'·B + A·B'
Minterms (rows that are 1)
Σm(1, 2)
Canonical product of sums
(A + B)·(A' + B')

照合元:Python itertools.product with a != b

A implies B

Boolean expression
A -> B
Minterms (rows that are 1)
Σm(0, 1, 3)
Maxterms (rows that are 0)
ΠM(2)
Canonical product of sums
(A' + B)

照合元:Python itertools.product with (not a) or b

Tautology: A or not A (edge case)

Boolean expression
A or not A
Classification
Tautology
Canonical product of sums
1
Rows that are true
2

照合元:Law of excluded middle; Python check over A in (0, 1)

よくある質問

How do you make a truth table?

List every combination of the inputs by counting in binary: 2 variables give 4 rows, 3 give 8, and 6 give 64. Then evaluate the expression in each row, working from the innermost operation outward. For (A and B) or not C, the row A = 1, B = 1, C = 1 gives (1 and 1) or 0 = 1, while A = 0, B = 0, C = 1 gives 0 or 0 = 0.

What are minterms and maxterms?

A minterm is an AND of every variable, each plain or negated, that is 1 in exactly one row; a maxterm is an OR of every variable that is 0 in exactly one row. Row numbers index them: for A, B and C, minterm 6 is A·B·C′ and maxterm 1 is (A + B + C′). A function is the OR of its minterms and, equally, the AND of its maxterms.

What is the difference between sum of products and product of sums?

A sum of products (SOP) ORs together AND terms, one for each row where the function is 1; a product of sums (POS) ANDs together OR terms, one for each row where it is 0. A xor B is A′·B + A·B′ as a sum of products and (A + B)·(A′ + B′) as a product of sums. Both are complete; the shorter one is whichever has fewer rows to cover.

What is a tautology in logic?

An expression that is true in every row of its truth table, whatever the inputs. A or not A, the law of excluded middle, is the simplest; (A → B) or (B → A) is another. The opposite, false in every row, is a contradiction, such as A and not A, and anything true in some rows but not others is called contingent.

When is A implies B true?

A → B is false only when A is true and B is false; in the other three rows it is true. Its truth table therefore has minterms 0, 1 and 3 and a single maxterm, 2, and it is equivalent to not A or B and to its contrapositive, not B → not A. A chain such as A → B → C groups from the right, as A → (B → C).

「真理値表の作成ツール」の精度はどのくらいですか?

精度は入力値と計算方法の前提に依存します。十進演算には有効数字50桁を使いますが、推定、数値計算手法、元データの精度はそれより低い場合があります。表示の丸め処理でこれらの制約がなくなるわけではありません。 独立した出典の解答と照合した計算例:8。 例えば、「A and B」はPython itertools.product over (A, B): only A=1, B=1 is trueと照合しています。

この計算方法の出典は何ですか?

Wolfram MathWorld — Truth Table; Wikipedia — Canonical normal form (minterms and maxterms).

この計算機について

F=∑F(m)=1m(sum of minterms)=∏F(M)=0M(product of maxterms)\begin{aligned} F &= \sum_{F(m)=1} m \quad \text{(sum of minterms)} \\[4pt] &= \prod_{F(M)=0} M \quad \text{(product of maxterms)} \end{aligned}

出典

  1. Wolfram MathWorld — Truth Table
  2. Wikipedia — Canonical normal form (minterms and maxterms)

出典と照合済み

この計算機には、独立した出典の解答を使った計算例が 8 件あります。テストに組み込まれており、ここでも実行できます。

関連する計算ツール