Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow XOR and XNOR gates to have more than 2 inputs #1205

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/generic/pgf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ lot of contributed changes. Thanks to everyone who volunteered their time!
- Remove spurious spaces for `3d view` #1151
- Fix incorrectly placed matrix delimiters for implicitly positioned nodes #1102
- Use `/.append` to fix a wrong usage of `/.add` in pgfmanual #1201
- Allow XOR and XNOR gates to have more than 2 inputs #376

### Changed

Expand Down Expand Up @@ -114,6 +115,7 @@ lot of contributed changes. Thanks to everyone who volunteered their time!
- PhelypeOleinik
- QJLc
- Stefan Pinnow
- Erin Cold

## [3.1.9a] - 2021-05-15 Henri Menke

Expand Down
10 changes: 5 additions & 5 deletions doc/generic/pgf/pgfmanual-en-library-circuits.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1281,9 +1281,9 @@ \subsubsection{Implementation: The US-Style Logic Gates Shape Library}
\item |nand gate US|, two or more inputs
\item |nand gate CDH|, two or more inputs
\item |or gate US|, two or more inputs
\item |nor gate US|, two or more Inputs
\item |xor gate US|, two inputs
\item |xnor gate US|, two inputs
\item |nor gate US|, two or more inputs
\item |xor gate US|, two or more inputs
\item |xnor gate US|, two or more inputs
\item |not gate US|, one input
\item |buffer gate US|, one input
\end{itemize}
Expand Down Expand Up @@ -1428,8 +1428,8 @@ \subsubsection{Implementation: The IEC-Style Logic Gates Shape Library}
\item |nand gate IEC|, two or more inputs
\item |or gate IEC|, two or more inputs
\item |nor gate IEC|, two or more inputs
\item |xor gate IEC|, two inputs
\item |xnor gate IEC|, two inputs
\item |xor gate IEC|, two or more inputs
\item |xnor gate IEC|, two or more inputs
\item |not gate IEC|, one input
\item |buffer gate IEC|, one input
\end{itemize}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
%
\pgfdeclareshape{xor gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{2}% Maximum 1024 (!) inputs.
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
\pgfmathloop%
\ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
Expand All @@ -496,7 +496,7 @@
}{}%
\repeatpgfmathloop%
\ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
\pgferror{An xor gate must have two inputs}%
\pgferror{An xor gate must have at least two inputs}%
\fi%
}%
\savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
Expand Down Expand Up @@ -564,7 +564,7 @@
}{}%
\repeatpgfmathloop%
\ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
\pgferror{A xnor gate must have two inputs}%
\pgferror{A xnor gate must have at least two inputs}%
\fi%
}%
\savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
Expand Down Expand Up @@ -625,7 +625,7 @@
\pgf@lib@sh@logicgate@IEC@inputanchor{1}%
}%
\ifnum\pgf@lib@sh@logicgate@numinputs=0\relax%
\pgferror{A buffer gate must have one inputs}%
\pgferror{A buffer gate must have one input}%
\fi%
}%
\savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@
%
\pgfdeclareshape{xor gate US}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate US\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{2}%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
\pgfmathloop%
\ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
Expand All @@ -1166,7 +1166,7 @@
}{}%
\repeatpgfmathloop%
\ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
\pgferror{An xor gate must have at two inputs}%
\pgferror{An xor gate must have at least two inputs}%
\fi%
}%
\savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
Expand Down Expand Up @@ -1485,7 +1485,7 @@
%
\pgfdeclareshape{xnor gate US}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xnor gate US\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{2}%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
\pgfmathloop%
\ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
Expand All @@ -1497,7 +1497,7 @@
}{}%
\repeatpgfmathloop%
\ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
\pgferror{An xnor gate must have two inputs}%
\pgferror{An xnor gate must have at least two inputs}%
\fi%
}%
\savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
Expand Down