Πίνακας αληθείας: Διαφορά μεταξύ των αναθεωρήσεων

Περιεχόμενο που διαγράφηκε Περιεχόμενο που προστέθηκε
μ Ρομπότ: Αλλαγή Κατηγορία:Επιστήμη υπολογιστών σε Κατηγορία:Πληροφορική
Χωρίς σύνοψη επεξεργασίας
Γραμμή 1:
{[σε χρήση}}
{{επιμέλεια|ορθογραφία, μορφοποίηση}}
{{πηγές|16|10|2012}}
Πίνακας αλήθειας είναι ένας "λογικός" πίνακας που χρησιμοποιείται ευρέως στην Επιστήμη της [[Πληροφορική]]ς και των [[Μαθηματικά|Μαθηματικών]]. Χρησιμοποιείται για τον υπολογισμό των λογικών πράξεων όπως: AND, OR, NOT, NOR, XOR και άλλων λογικών πυλών. Χρησιμοποιώντας τις πράξεις ΛΑΘΟΣ (FALSE-0) ή ΣΩΣΤΟ (TRUE-1) ελέγχουμε το αποτέλεσμα της λογική πράξης. Σχεδιαστικά ο πίνακας αληθείας αποτελείτε από στήλες που περιέχουν τις τιμές των μεταβλητών και ακόμη μια με το αποτέλεσμα. Έτσι κάθε γραμμή έχει τις πράξεις για Α, Β και Γ μεταβλητές για παράδειγμα και στην τελευταία το ΑΠΟΤΕΛΕΣΜΑ. Το αποτέλεσμα εξαρτάται από το τι υλοποιεί η λογική πύλη.
===Λογική πύλη ΚΑΙ (and)===
[[Logical conjunction]] is an [[logical operation|operation]] on two [[logical value]]s, typically the values of two [[proposition]]s, that produces a value of ''true'' if both of its operands are true.
 
Ο πίνακας αληθείας για την '''p AND q''' (επίσης γράφεται '''p ∧ q''', '''Kpq''', '''p & q''', or '''p''' <math>\cdot</math> '''q''') είναι ο παρακάτω:
 
{| class="wikitable" style="margin:1em auto; text-align:center;"
|+ '''Logical Conjunction'''
|-
! style="width:15%" | ''p''
! style="width:15%" | ''q''
! style="width:15%" | ''p'' ∧ ''q''
|-
| T || T || T
|-
| T || style="background:papayawhip" | F || style="background:papayawhip" | F
|-
| style="background:papayawhip" | F || T || style="background:papayawhip" | F
|-
| style="background:papayawhip" | F || style="background:papayawhip" | F || style="background:papayawhip" | F
|}
 
===Λογική πύλη OR (ή)===
 
 
Ο πίνακας αληθείας για την παράσταση '''p OR q''' (γράφεται επίσης '''p ∨ q''', '''Apq''', '''p || q''', or '''p + q''') είναι ο παρακάτω:
 
{| class="wikitable" style="margin:1em auto; text-align:center;"
|+ '''Logical Disjunction'''
|-
! style="width:15%" | ''p''
! style="width:15%" | ''q''
! style="width:15%" | ''p'' ∨ ''q''
|-
| T || T || T
|-
| T || style="background:papayawhip" | F || T
|-
| style="background:papayawhip" | F || T || T
|-
| style="background:papayawhip" | F || style="background:papayawhip" | F || style="background:papayawhip" | F
|}
 
 
 
===Logical implication===
Logical implication or the [[material conditional]] are both associated with an [[logical operation|operation]] on two [[logical value]]s, typically the values of two [[proposition]]s, that produces a value of ''false'' just in the singular case the first operand is true and the second operand is false.
 
The truth table associated with the material conditional '''if p then q''' (symbolized as '''p&nbsp;→&nbsp;q''') and the logical implication '''p implies q''' (symbolized as '''p&nbsp;⇒&nbsp;q''', or '''Cpq''') is as follows:
 
{| class="wikitable" style="margin:1em auto; text-align:center;"
|+ '''Logical Implication'''
|-
! style="width:15%" | ''p''
! style="width:15%" | ''q''
! style="width:15%" | ''p'' → ''q''
|-
| T || T || T
|-
| T || style="background:papayawhip" | F || style="background:papayawhip" | F
|-
| style="background:papayawhip" | F || T || T
|-
| style="background:papayawhip" | F || style="background:papayawhip" | F || T
|}
 
It may also be useful to note that '''p&nbsp;→&nbsp;q''' is equivalent to '''¬p&nbsp;∨&nbsp;q'''.
 
===Logical equality===
[[Logical equality]] (also known as biconditional) is an [[logical operation|operation]] on two [[logical value]]s, typically the values of two [[proposition]]s, that produces a value of ''true'' if both operands are false or both operands are true.
 
The truth table for '''p XNOR q''' (also written as '''p ↔ q''', '''Epq''', '''p = q''', or '''p ≡ q''') is as follows:
 
{| class="wikitable" style="margin:1em auto; text-align:center;"
|+ '''Logical Equality'''
|-
! style="width:15%" | ''p''
! style="width:15%" | ''q''
! style="width:15%" | ''p'' ≡ ''q''
|-
| T || T || T
|-
| T || style="background:papayawhip" | F || style="background:papayawhip" | F
|-
| style="background:papayawhip" | F || T || style="background:papayawhip" | F
|-
| style="background:papayawhip" | F || style="background:papayawhip" | F || T
|}
 
So p EQ q is true if p and q have the same [[truth value]] (both true or both false), and false if they have different truth values.
 
===Exclusive disjunction===
[[Exclusive disjunction]] is an [[logical operation|operation]] on two [[logical value]]s, typically the values of two [[proposition]]s, that produces a value of ''true'' if one but not both of its operands is true.
 
The truth table for '''p XOR q''' (also written as '''p ⊕ q''', '''Jpq''', or '''p ≠ q''') is as follows:
 
{| class="wikitable" style="margin:1em auto; text-align:center;"
|+ '''Exclusive Disjunction'''
|-
! style="width:15%" | ''p''
! style="width:15%" | ''q''
! style="width:15%" | ''p'' ⊕ ''q''
|-
| T || T || style="background:papayawhip" | F
|-
| T || style="background:papayawhip" | F || T
|-
| style="background:papayawhip" | F || T || T
|-
| style="background:papayawhip" | F || style="background:papayawhip" | F || style="background:papayawhip" | F
|}
 
For two propositions, '''XOR''' can also be written as (p = 1 ∧ q = 0) ∨ (p = 0 ∧ q = 1).
 
===Logical NAND===
The [[logical NAND]] is an [[logical operation|operation]] on two [[logical value]]s, typically the values of two [[proposition]]s, that produces a value of ''false'' if both of its operands are true. In other words, it produces a value of ''true'' if at least one of its operands is false.
 
The truth table for '''p NAND q''' (also written as '''p ↑ q''', '''Dpq''', or '''p | q''') is as follows:
 
{| class="wikitable" style="margin:1em auto; text-align:center;"
|+ '''Logical NAND'''
|-
! style="width:15%" | ''p''
! style="width:15%" | ''q''
! style="width:15%" | ''p'' ↑ ''q''
|-
| T || T || style="background:papayawhip" | F
|-
| T || style="background:papayawhip" | F || T
|-
| style="background:papayawhip" | F || T || T
|-
| style="background:papayawhip" | F || style="background:papayawhip" | F || T
|}
 
[[Κατηγορία:Μαθηματικά]]