disjunction

OR is the truth-functional operator of disjunction. Its logical connective is represented , written \vee.

Boolean disjunction is an operation which takes as input two logical truth values; it returns a value of false if and only if both of its operands are false, and true otherwise.

Visually,

\documentclass{standalone}
\usepackage{tikz}
%
\definecolor{fillcolor}{HTML}{8A5CF5}
%
\tikzset{truthy/.style n args={1}{%
    fill=#1,draw,%
    inner sep=0,minimum size=1cm}}
%
\begin{document}
\begin{tikzpicture}
	\path (-2,-2) rectangle (2,2);
	\node at (0,0.5) {Disjunction};
	\node at (0,-0.5) {$P\vee Q$};
\end{tikzpicture}
\begin{tikzpicture}
	\node at (-1.5,0.5) {$P$};
	\node at (0.5,2.5) {$Q$};
	\node at (-1,0) {\small$1$};
	\node at (-1,1) {\small$0$};
	\node at (0,2) {\small$0$};
	\node at (1,2) {\small$1$};
    \node[truthy={fillcolor}] at (0,0) {$1$}; % bottom left
    \node[truthy={fillcolor}] at (1,0) {$1$}; % bottom right
    \node[truthy={none}] at (0,1) {$0$}; % top left
    \node[truthy={fillcolor}] at (1,1) {$1$}; % top right
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}
	\path (-3,-2) rectangle (3,2);
	% P
	\fill[fillcolor] (-1,0) circle (1.5);
	% Q
	\fill[fillcolor] (1,0) circle (1.5);
	%
    \draw (-1,0) circle (1.5);
    \draw (1,0) circle (1.5);
    \node at (-1.25,0) {$P$};
    \node at (1.25,0) {$Q$};
\end{tikzpicture}
\end{document}

Notation

The disjunction of propositions P and Q is generally written PQ, read "P or Q".

In a logic circuit, the OR gate looks like

\documentclass[tikz]{standalone}
\usetikzlibrary{shapes.gates.logic.US}
%
\begin{document}
\begin{tikzpicture}
	\node[draw,or gate US,logic gate inputs=nn] (gate) at (0,0) {};
	%
	\foreach \i in {1,2} {
	    \draw (gate.input \i) --++ (-0.25,0);
	}
	\draw (gate.output) --++ (0.25,0);
\end{tikzpicture}
\end{document}
Powered by Forestry.md