From b1a9b1b9b2f04efd6dc39bd2a02c544d34d1259c Mon Sep 17 00:00:00 2001 From: Prefetch Date: Sun, 1 Jan 2023 16:40:56 +0100 Subject: Change license, add Makefile, add image caching control --- source/know/concept/toffoli-gate/index.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'source/know/concept/toffoli-gate/index.md') diff --git a/source/know/concept/toffoli-gate/index.md b/source/know/concept/toffoli-gate/index.md index 9a99e69..23dc81e 100644 --- a/source/know/concept/toffoli-gate/index.md +++ b/source/know/concept/toffoli-gate/index.md @@ -16,29 +16,35 @@ of which it returns $$A$$ and $$B$$ unchanged, and flips $$C$$ only if both $$A$$ and $$B$$ are true. In circuit logic diagrams, its representation is: -{% include image.html file="toffoli.png" width="19%" alt="Toffoli gate symbol" %} +{% include image.html file="toffoli.png" width="19%" + alt="Toffoli gate symbol" %} This gate is reversible because $$A$$ and $$B$$ are preserved, and it is universal because we can make a NAND gate from it: -{% include image.html file="nand.png" width="38%" alt="NAND gate made of Toffoli gate" %} +{% include image.html file="nand.png" width="38%" + alt="NAND gate made of Toffoli gate" %} A NAND is enough to implement every conceivable circuit. That said, we can efficiently implement NOT, AND, and XOR using a single Toffoli gate too. Note that NOT is a special case of NAND: -{% include image.html file="not.png" width="32%" alt="NOT gate made of Toffoli gate" %} +{% include image.html file="not.png" width="32%" + alt="NOT gate made of Toffoli gate" %} -{% include image.html file="and.png" width="35%" alt="AND gate made of Toffoli gate" %} +{% include image.html file="and.png" width="35%" + alt="AND gate made of Toffoli gate" %} -{% include image.html file="xor.png" width="35%" alt="XOR gate made of Toffoli gate" %} +{% include image.html file="xor.png" width="35%" + alt="XOR gate made of Toffoli gate" %} Using these, we can, as an example, make an OR gate from three Toffoli gates, thanks to the fact that $$A \lor B = \neg (\neg A \land \neg B)$$, i.e. OR is NAND of NOT $$A$$ and NOT $$B$$: -{% include image.html file="or.png" width="50%" alt="OR gate made of Toffoli gates" %} +{% include image.html file="or.png" width="50%" + alt="OR gate made of Toffoli gates" %} Thanks to its reversibility and universality, the Toffoli gate is interesting for quantum computing. -- cgit v1.2.3