Difference between revisions of "Template:Logic functions"

From blackwiki
Jump to navigation Jump to search
imported>Sardanaphalus
m (typo)
imported>Sardanaphalus
(table syntax/formatting)
Line 1: Line 1:
{| class="wikitable" style="text-align:center; margin: 1em auto 1em auto"
+
{| class="wikitable" style="margin:1.0em auto;text-align:center;"
 
|-  
 
|-  
!rowspan=2 |''INPUT''|| A
+
!rowspan="2" style="width:6.0em;"| ''INPUT''
!width=20|0
+
!style="width:6.0em;"| A !!style="width:20px;"| 0 !!style="width:20px;"| 0 !!style="width:20px;"| 1 !!style="width:20px;"| 1
!width=20|0
+
|rowspan="2"| <!--(empty col)-->
!width=20|1
+
!rowspan="2"| Meaning
!width=20|1
 
|rowspan=2 |<!-- Empty col -->
 
!rowspan=2 | Meaning
 
 
|-
 
|-
! B || 0 || 1 || 0 || 1
+
! B !! 0 !! 1 !! 0 !! 1
 
 
 
|-  
 
|-  
|colspan=8|<!-- Empty line -->
+
|colspan="8"| <!--(empty line)-->
 
|-
 
|-
!rowspan=16 | ''OUTPUT''  
+
!rowspan="16"| ''OUTPUT''
 
| FALSE || 0 || 0 || 0 || 0
 
| FALSE || 0 || 0 || 0 || 0
|rowspan=16 |
+
|rowspan="16"|
|align=left|Whatever ''A'' and ''B'', the output is false. [[Contradiction_(logic)|Contradiction]].
+
|style="text-align:left;"| &nbsp;Whatever ''A'' and ''B'', output is false. [[Contradiction]].
 
|-  
 
|-  
 
| A AND B || 0 || 0 || 0 || 1
 
| A AND B || 0 || 0 || 0 || 1
|align=left|Output is true if and only if ([[iff]]) both ''A'' and ''B'' are true.
+
|style="text-align:left;"| &nbsp;Output is true [[If and only if|if and only if (iff)]] both ''A'' and ''B'' are true.&nbsp;
 
|-
 
|-
 
| A <math>\not\rightarrow</math> B || 0 || 0 || 1 || 0
 
| A <math>\not\rightarrow</math> B || 0 || 0 || 1 || 0
|align=left|''A'' [[Material nonimplication|doesn't imply]] ''B''. True if ''A'' but not ''B''.
+
|style="text-align:left;"| &nbsp;''A'' [[Material nonimplication|doesn't imply]] ''B''. True if ''A'' but not ''B''.
 
|-
 
|-
 
| A || 0 || 0 || 1 || 1
 
| A || 0 || 0 || 1 || 1
|align=left|True whenever ''A'' is true.
+
|style="text-align:left;"| &nbsp;True whenever ''A'' is true.
 
|-
 
|-
 
| A <math>\not\leftarrow</math> B|| 0 || 1 || 0 || 0
 
| A <math>\not\leftarrow</math> B|| 0 || 1 || 0 || 0
|align=left|''A'' [[Converse nonimplication|is not implied by]] ''B''. True if not ''A'' but ''B''.
+
|style="text-align:left;"| &nbsp;''A'' [[Converse nonimplication|is not implied by]] ''B''. True if not ''A'' but ''B''.
 
|-  
 
|-  
 
| B || 0 || 1 || 0 || 1
 
| B || 0 || 1 || 0 || 1
|align=left|True whenever ''B'' is true.
+
|style="text-align:left;"| &nbsp;True whenever ''B'' is true.
 
|-  
 
|-  
 
| A XOR B || 0 || 1 || 1 || 0
 
| A XOR B || 0 || 1 || 1 || 0
|align=left|True if ''A'' is not equal to ''B''.
+
|style="text-align:left;"| &nbsp;True if ''A'' is not equal to ''B''.
 
|-  
 
|-  
 
| A OR B || 0 || 1 || 1 || 1
 
| A OR B || 0 || 1 || 1 || 1
|align=left|True if ''A'' is true, or ''B'' is true, or both.
+
|style="text-align:left;"| &nbsp;True if ''A'' is true, or ''B'' is true, or both.
 
|-  
 
|-  
 
| A NOR B || 1 || 0 || 0 || 0
 
| A NOR B || 1 || 0 || 0 || 0
|align=left|True if neither ''A'' nor ''B''.
+
|style="text-align:left;"| &nbsp;True if neither ''A'' nor ''B''.
 
|-  
 
|-  
 
| A XNOR B || 1 || 0 || 0 || 1
 
| A XNOR B || 1 || 0 || 0 || 1
|align=left|True if ''A'' is equal to ''B''.
+
|style="text-align:left;"| &nbsp;True if ''A'' is equal to ''B''.
 
|-  
 
|-  
 
| NOT B || 1 || 0 || 1 || 0
 
| NOT B || 1 || 0 || 1 || 0
|align=left|True if ''B'' is false.
+
|style="text-align:left;"| &nbsp;True if ''B'' is false.
 
|-  
 
|-  
 
| A <math>\leftarrow</math> B|| 1 || 0 || 1 || 1
 
| A <math>\leftarrow</math> B|| 1 || 0 || 1 || 1
|align=left|''A'' [[Converse implication|is implied by]] ''B''. False if not ''A'' but ''B'', otherwise true.
+
|style="text-align:left;"| &nbsp;''A'' [[Converse implication|is implied by]] ''B''. False if not ''A'' but ''B'', otherwise true.&nbsp;
 
|-  
 
|-  
 
| NOT A || 1 || 1 || 0 || 0
 
| NOT A || 1 || 1 || 0 || 0
|align=left|True if ''A'' is false.
+
|style="text-align:left;"| &nbsp;True if ''A'' is false.
 
|-  
 
|-  
 
| A <math>\rightarrow</math> B || 1 || 1 || 0 || 1
 
| A <math>\rightarrow</math> B || 1 || 1 || 0 || 1
|align=left|''A'' [[Material conditional|implies]] ''B''. False if ''A'' but not ''B'', otherwise true.
+
|style="text-align:left;"| &nbsp;''A'' [[Material conditional|implies]] ''B''. False if ''A'' but not ''B'', otherwise true.
 
|-  
 
|-  
 
| A NAND B || 1 || 1 || 1 || 0
 
| A NAND B || 1 || 1 || 1 || 0
|align=left|''A'' and ''B'' are not both true.
+
|style="text-align:left;"| &nbsp;''A'' and ''B'' are not both true.
 
|-  
 
|-  
 
| TRUE || 1 || 1 || 1 || 1
 
| TRUE || 1 || 1 || 1 || 1
|align=left|Whatever ''A'' and ''B'', the output is true. [[Tautology_(logic)|Tautology]].
+
|style="text-align:left;"| &nbsp;Whatever ''A'' and ''B'', output is true. [[Tautology (logic)|Tautology]].
 
|-
 
|-
 
|}<noinclude>
 
|}<noinclude>

Revision as of 11:57, 28 November 2014

INPUT A 0 0 1 1 Meaning
B 0 1 0 1
OUTPUT FALSE 0 0 0 0  Whatever A and B, output is false. Contradiction.
A AND B 0 0 0 1  Output is true if and only if (iff) both A and B are true. 
A <math>\not\rightarrow</math> B 0 0 1 0  A doesn't imply B. True if A but not B.
A 0 0 1 1  True whenever A is true.
A <math>\not\leftarrow</math> B 0 1 0 0  A is not implied by B. True if not A but B.
B 0 1 0 1  True whenever B is true.
A XOR B 0 1 1 0  True if A is not equal to B.
A OR B 0 1 1 1  True if A is true, or B is true, or both.
A NOR B 1 0 0 0  True if neither A nor B.
A XNOR B 1 0 0 1  True if A is equal to B.
NOT B 1 0 1 0  True if B is false.
A <math>\leftarrow</math> B 1 0 1 1  A is implied by B. False if not A but B, otherwise true. 
NOT A 1 1 0 0  True if A is false.
A <math>\rightarrow</math> B 1 1 0 1  A implies B. False if A but not B, otherwise true.
A NAND B 1 1 1 0  A and B are not both true.
TRUE 1 1 1 1  Whatever A and B, output is true. Tautology.