Read · 1 min
OR and XOR are two different operations, although they are similar in some ways. Here's how they work.
OR evaluates to True if one or more of the inputs are True, and False if they're all False.
\begin{matrix}
& & A\
& & False & True\
B & False & 0 & 1\
& True & 1 & 1
\end{matrix}
XOR is the same as OR, but it evaluates to False if both inputs are True.
\begin{matrix}
& & A\
& & False & True\
B & False & 0 & 1\
& True & 1 & 0
\end{matrix}
That's the difference between "OR" and "XOR"! :)
It may be useful to know for the sample problems below that is a logical OR and is a logical AND.