From df4074b453d7d21973ec0606cc4272153cd60158 Mon Sep 17 00:00:00 2001 From: Erin Cold Date: Sat, 15 Oct 2022 04:12:07 -0400 Subject: [PATCH] fix: allow XOR and XNOR gates to have more than 2 inputs Signed-off-by: Erin Cold --- doc/generic/pgf/CHANGELOG.md | 2 ++ doc/generic/pgf/pgfmanual-en-library-circuits.tex | 10 +++++----- .../circuits/pgflibraryshapes.gates.logic.IEC.code.tex | 8 ++++---- .../circuits/pgflibraryshapes.gates.logic.US.code.tex | 8 ++++---- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/doc/generic/pgf/CHANGELOG.md b/doc/generic/pgf/CHANGELOG.md index 93d5b9faf..d36a308aa 100644 --- a/doc/generic/pgf/CHANGELOG.md +++ b/doc/generic/pgf/CHANGELOG.md @@ -83,6 +83,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 @@ -113,6 +114,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 diff --git a/doc/generic/pgf/pgfmanual-en-library-circuits.tex b/doc/generic/pgf/pgfmanual-en-library-circuits.tex index a0d29f60a..6b43e9430 100644 --- a/doc/generic/pgf/pgfmanual-en-library-circuits.tex +++ b/doc/generic/pgf/pgfmanual-en-library-circuits.tex @@ -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} @@ -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} diff --git a/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex b/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex index 4022cd605..02a0b9da0 100644 --- a/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex +++ b/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex @@ -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% @@ -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}% @@ -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}% @@ -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}% diff --git a/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex b/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex index 3f0d668ca..b3e0c863c 100644 --- a/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex +++ b/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex @@ -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% @@ -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}% @@ -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% @@ -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}%