Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 07:10, 19 February 2025 by Prd (talk | contribs) (Created page with "{{Documentation subpage}} {{lua|Module:2-ary truth table}} == Usage == This template is for articles like Exclusive or. The colors white and red correspond to Venn diagrams like File:Venn0110.svg, as well as other files like File:Variadic logical XOR.svg. <syntaxhighlight lang=wikitext>{{2-ary truth table|0|1|1|0|<math>A \oplus B</math>}}</syntaxhighlight> gives: {{2-ary truth table{{sandbox other|/sandbox}}|0|1|1|0|<math>A \oplus B</math>}} More complex...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Usage

This template is for articles like Exclusive or. The colors white and red correspond to Venn diagrams like File:Venn0110.svg, as well as other files like File:Variadic logical XOR.svg.

{{2-ary truth table|0|1|1|0|<math>A \oplus B</math>}}

gives:

ABAB
FFF
FTT
TFT
TTF

More complex tables can be created with the same styles:

Implications
{{2-ary truth table|A=P|B=Q
|1|1|0|1|<math> P \rightarrow Q</math>
|thick
|1|0|1|1|<math> P \leftarrow Q</math> (converse)
}}
PQPQPQ (converse)
FFTT
FTTF
TFFT
TTTT
Disjunction with implication
{{2-ary truth table
|1|1|0|1|<math>A \rightarrow B</math>
|thick
|0|1|1|1|<math>(A \rightarrow B) \rightarrow B</math>
|
|0|1|1|1|<math>A \or B</math>
}}
ABAB(AB)BAB
FFTFF
FTTTT
TFFTT
TTTTT
Disjunction with implication and negation
{{2-ary truth table
|1|1|0|0|<math>\neg A</math>
|thick
|0|1|1|1|<math>\neg A \rightarrow B</math>
|
|0|1|1|1|<math>A \or B</math>
}}
AB¬A¬ABAB
FFTFF
FTTTT
TFFTT
TTFTT

File:OOjs UI icon alert destructive black-darkred.svg In this template A is 0011, and B is 0101. In the corresponding Venn diagram files it is the other way round.
E.g. implication has to be entered as 1101. But the corresponding Venn diagram is File:Venn1011.svg


Contents