Disjunció exclusiva: diferència entre les revisions

Contingut suprimit Contingut afegit
m Format
m Bot elimina espais sobrants
Línia 3:
| [[Fitxer:Venn0110.svg|220px|A⊕B]]
|-
| [[Diagrama de Venn]] per <math>~A \oplus B</math><br>
[[Fitxer:Venn0111.svg|35px|OR]] <math>~\oplus~</math> [[Fitxer:Venn0001.svg|35px|AND]] <math>~\Leftrightarrow~</math> [[Fitxer:Venn0110.svg|35px|XOR]]
<br><br>
Línia 19:
 
: <math>
\begin{matrix}
p \oplus q & = & (p \land \lnot q) \lor (\lnot p \land q)
\end{matrix}
</math>
La disjunció exclusiva <math>p \oplus q</math> pot ser expressada de la següent manera:
 
: <math>
\begin{matrix}
p \oplus q & = & \lnot (p \land q) \land (p \lor q)
\end{matrix}
</math>
 
Aquesta representació del XOR pot ser útil en la construcció d'un circuit o una xarxa, ja que només té un operador <math> \lnot </math> i un nombre reduït d'operadors <math>p \oplus q</math> i <math > \lor </math>. La prova d'aquesta identitat és la següent:
: <math>
\begin{matrix}
p \oplus q & = & (p \land \lnot q) & \lor & (\lnot p \land q) \\
& = & ((p \land \lnot q) \lor \lnot p) & \land & ((p \land \lnot q) \lor q) \\
& = & ((p \lor \lnot p) \land (\lnot q \lor \lnot p)) & \land & ((p \lor q) \land (\lnot q \lor q)) \\
& = & (\lnot p \lor \lnot q) & \land & (p \lor q) \\
& = & \lnot (p \land q) & \land & (p \lor q)
\end{matrix}
</math>
 
De vegades és útil escriure <math>p \oplus q</math> de les següents formes:
: <math>
\begin{matrix}
p \oplus q & = & \lnot ((p \land q) \lor (\lnot p \land \lnot q))
\end{matrix}
</math>