I connettivi logici – 3

I connettivi logici applicati a 3 clausole.
Dall’osservazione delle tabelle successive si può dedurre che gli operatori OR, AND, XOR, XNOR sono associativi.


OR


  p q r   p OR q   q OR r   (p OR q) OR r   p OR (q OR r)
+-------+--------+--------+---------------+---------------+
| 0 0 0 | 0      | 0      | 0             | 0             |
| 0 0 1 | 0      | 1      | 1             | 1             |
| 0 1 0 | 1      | 1      | 1             | 1             |
| 0 1 1 | 1      | 1      | 1             | 1             |
| 1 0 0 | 1      | 0      | 1             | 1             |
| 1 0 1 | 1      | 1      | 1             | 1             |
| 1 1 0 | 1      | 1      | 1             | 1             |
| 1 1 1 | 1      | 1      | 1             | 1             |
+-------+--------+--------+---------------+---------------+

  • OR: vero se almeno una clausola è vera
  • (p OR q) OR r = p OR (q OR r) = p OR q OR r

AND


  p q r   p AND q   q AND r   (p AND q) AND r   p AND (q AND r)
+-------+---------+---------+-----------------+-----------------+
| 0 0 0 | 0       | 0       | 0               | 0               |
| 0 0 1 | 0       | 0       | 0               | 0               |
| 0 1 0 | 0       | 0       | 0               | 0               |
| 0 1 1 | 0       | 1       | 0               | 0               |
| 1 0 0 | 0       | 0       | 0               | 0               |
| 1 0 1 | 0       | 0       | 0               | 0               |
| 1 1 0 | 1       | 0       | 0               | 0               |
| 1 1 1 | 1       | 1       | 1               | 1               |
+-------+---------+---------+-----------------+-----------------+

  • AND: vero se tutte le clausole sono vere
  • (p AND q) AND r = p AND (q AND r) = p AND q AND r

XOR


  p q r   p XOR q   q XOR r   (p XOR q) XOR r   p XOR (q XOR r)
+-------+---------+---------+-----------------+-----------------+
| 0 0 0 | 0       | 0       | 0               | 0               |
| 0 0 1 | 0       | 1       | 1               | 1               |
| 0 1 0 | 1       | 1       | 1               | 1               |
| 0 1 1 | 1       | 0       | 0               | 0               |
| 1 0 0 | 1       | 0       | 1               | 1               |
| 1 0 1 | 1       | 1       | 0               | 0               |
| 1 1 0 | 0       | 1       | 0               | 0               |
| 1 1 1 | 0       | 0       | 1               | 1               |
+-------+---------+---------+-----------------+-----------------+

  • XOR: vero se il numero di clausole vere è dispari
  • (p XOR q) XOR r = p XOR (q XOR r) = p XOR q XOR r



NOR


  p q r   p NOR q   q NOR r   (p NOR q) NOR r   p NOR (q NOR r)
+-------+---------+---------+-----------------+-----------------+
| 0 0 0 | 1       | 1       | 0               | 0               |
| 0 0 1 | 1       | 0       | 0               | 1               |
| 0 1 0 | 0       | 0       | 1               | 1               |
| 0 1 1 | 0       | 0       | 0               | 1               |
| 1 0 0 | 0       | 1       | 1               | 0               |
| 1 0 1 | 0       | 0       | 0               | 0               |
| 1 1 0 | 0       | 0       | 1               | 0               |
| 1 1 1 | 0       | 0       | 0               | 0               |
+-------+---------+---------+-----------------+-----------------+

Attenzione!

  • (p NOR q) NOR<> p NOR (q NOR r)

NAND


  p q r   p NAND q   q NAND r   (p NAND q) NAND r   p NAND (q NAND r)
+-------+----------+----------+-------------------+-------------------+
| 0 0 0 | 1        | 1        | 1                 | 1                 |
| 0 0 1 | 1        | 1        | 0                 | 1                 |
| 0 1 0 | 1        | 1        | 1                 | 1                 |
| 0 1 1 | 1        | 0        | 0                 | 1                 |
| 1 0 0 | 1        | 1        | 1                 | 0                 |
| 1 0 1 | 1        | 1        | 0                 | 0                 |
| 1 1 0 | 0        | 1        | 1                 | 0                 |
| 1 1 1 | 0        | 0        | 1                 | 1                 |
+-------+----------+----------+-------------------+-------------------+

Attenzione!

  • (p NAND q) NAND r <> p NAND (q NAND r)

XNOR


  p q r   p XNOR q   q XNOR r   (p XNOR q) XNOR r   p XNOR (q XNOR r)
+-------+----------+----------+-------------------+-------------------+
| 0 0 0 | 1        | 1        | 0                 | 0                 |
| 0 0 1 | 1        | 0        | 1                 | 1                 |
| 0 1 0 | 0        | 0        | 1                 | 1                 |
| 0 1 1 | 0        | 1        | 0                 | 0                 |
| 1 0 0 | 0        | 1        | 1                 | 1                 |
| 1 0 1 | 0        | 0        | 0                 | 0                 |
| 1 1 0 | 1        | 0        | 0                 | 0                 |
| 1 1 1 | 1        | 1        | 1                 | 1                 |
+-------+----------+----------+-------------------+-------------------+

  • XNOR: vero se il numero di clausole vere è dispari
  • (p XNOR q) XNOR r = p XNOR (q XNOR r) = p XNOR q XNOR r
Notice: This work is licensed under a BY-NC-SA. Permalink: I connettivi logici – 3

Comments are closed.