summaryrefslogtreecommitdiff
path: root/source/know/concept/toffoli-gate/index.md
diff options
context:
space:
mode:
authorPrefetch2023-01-01 16:40:56 +0100
committerPrefetch2023-01-01 17:02:29 +0100
commitb1a9b1b9b2f04efd6dc39bd2a02c544d34d1259c (patch)
tree1fd87919deee17e58f8ad19c09abd54bd4a70886 /source/know/concept/toffoli-gate/index.md
parent1d700ab734aa9b6711eb31796beb25cb7659d8e0 (diff)
Change license, add Makefile, add image caching control
Diffstat (limited to 'source/know/concept/toffoli-gate/index.md')
-rw-r--r--source/know/concept/toffoli-gate/index.md18
1 files changed, 12 insertions, 6 deletions
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.