|
|
(One intermediate revision by one other user not shown) |
Line 1: |
Line 1: |
| [[Image:Fredkin gate.svg|150px|thumb|Circuit representation of Fredkin gate]]
| | Hello from Switzerland. I'm glad to came across you. My first name is Jodi. <br>I live in a small town called Pohlern in western Switzerland.<br>I was also born in Pohlern 32 years ago. Married in February year 2008. I'm working at the college.<br><br>Here is my weblog; how to get free fifa 15 coins ([http://Www.Wikigle.com/User:WinstonEUVM just click the next site]) |
| The '''Fredkin gate''' (also '''CSWAP gate''') is a computational circuit suitable for [[reversible computing]], invented by [[Ed Fredkin]]. It is ''universal'', which means that any logical or arithmetic operation can be constructed entirely of Fredkin gates. The Fredkin gate is the three-bit gate that swaps the last two bits if the first bit is 1.
| |
| | |
| == Definition ==
| |
| | |
| The basic Fredkin gate<ref>Brown, Julian, [http://books.google.com/books?id=ECWm59h2pLAC&pg=PAS8 The Quest for the Quantum Computer], New York : Touchstone, 2000.</ref> is a [[Quantum_gate#Controlled_gates|controlled]] [[Quantum_gate#Swap_gate|swap gate]] that [[function (mathematics)|maps]] three inputs (''C'', ''I''<sub>1</sub>, ''I''<sub>2</sub>) onto three outputs (''C'', ''O''<sub>1</sub>, ''O''<sub>2</sub>). The ''C'' input is mapped directly to the ''C'' output. If ''C'' = 0, no swap is performed; ''I''<sub>1</sub> maps to ''O''<sub>1</sub>, and ''I''<sub>2</sub> maps to ''O''<sub>2</sub>. Otherwise, the two outputs are swapped so that ''I''<sub>1</sub> maps to ''O''<sub>2</sub>, and ''I''<sub>2</sub> maps to ''O''<sub>1</sub>. It is easy to see that this circuit is reversible, i.e., "undoes itself" when run backwards. A generalized ''n''×''n'' Fredkin gate passes its first ''n''-2 inputs unchanged to the corresponding outputs, and swaps its last two outputs if and only if the first ''n''-2 inputs are all 1.
| |
| | |
| The Fredkin gate is the reversible three-bit gate that swaps the last two bits if the first bit is 1.
| |
| | |
| {|
| |
| ! Truth table !! Matrix form
| |
| |-
| |
| |
| |
| {| class="wikitable"
| |
| |-
| |
| ! colspan="3" | INPUT
| |
| ! colspan="3" | OUTPUT
| |
| |- align="center"
| |
| ! ''C'' !! ''I''<sub>1</sub> !! ''I''<sub>2</sub>
| |
| ! ''C'' !! ''O''<sub>1</sub> !! ''O''<sub>2</sub>
| |
| |- align="center"
| |
| | 0 || 0 || 0
| |
| | 0 || 0 || 0
| |
| |- align="center"
| |
| | 0 || 0 || 1 || 0 || 0 || 1
| |
| |- align="center"
| |
| | 0 || 1 || 0 || 0 || 1 || 0
| |
| |- align="center"
| |
| | 0 || 1 || 1 || 0 || 1 || 1
| |
| |- align="center"
| |
| | 1 || 0 || 0 || 1 || 0 || 0
| |
| |- align="center"
| |
| | 1 || 0 || 1 || 1 || 1 || 0
| |
| |- align="center"
| |
| | 1 || 1 || 0 || 1 || 0 || 1
| |
| |- align="center"
| |
| | 1 || 1 || 1 || 1 || 1 || 1
| |
| |}
| |
| |
| |
| <math>
| |
| \begin{bmatrix}
| |
| 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
| |
| 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
| |
| 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
| |
| 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
| |
| 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
| |
| 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
| |
| 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
| |
| 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
| |
| \end{bmatrix}
| |
| </math>
| |
| |}
| |
| | |
| It has the useful property that the numbers of 0s and 1s are conserved throughout, which in the [[billiard-ball computer|billiard ball model]] means the same number of balls are output as input. This corresponds nicely to the [[conservation of mass]] in physics, and helps to show that the model is not wasteful.
| |
| | |
| == Logic function with XOR and AND gates ==
| |
| :''O''<sub>1</sub> = ''I''<sub>1</sub> XOR ''S''
| |
| :''O''<sub>2</sub> = ''I''<sub>2</sub> XOR ''S''
| |
| | |
| with ''S'' = (''I''<sub>1</sub> XOR ''I''<sub>2</sub>) AND ''C''
| |
| | |
| It can also be implemented by the following logic:
| |
| | |
| :O<sub>1</sub> = (NOT C AND I<sub>1</sub>) OR (C AND I<sub>2</sub>) = {{overline|C}}I<sub>1</sub>+CI<sub>2</sub>
| |
| :O<sub>2</sub> = (C AND I<sub>1</sub>) OR (NOT C AND I<sub>2</sub>) = CI<sub>1</sub>+{{overline|C}}I<sub>2</sub>
| |
| :C<sub>out</sub>= C<sub>in</sub>
| |
| | |
| == Completeness ==
| |
| | |
| It is easy to see that the Fredkin gate is universal, since it can be used to implement AND and NOT:
| |
| :if I2 = 0, O2 = C and I1
| |
| :if I1 = 0 and I2 = 1, O2 = not C
| |
| | |
| == Example ==
| |
| Here is a diagram of a three-bit adder implemented using Fredkin gates. The three inputs are A, B and C, supplemented by the constant T and F. In the diagram, the leftmost input (before the colon) swaps the two rightmost inputs if it is true.
| |
| | |
| [[Image:Fredkin_Full_Adder.svg]]
| |
| | |
| == See also ==
| |
| *[[Quantum computing]]
| |
| *[[Quantum gate]]
| |
| *[[Quantum programming]]
| |
| *[[Toffoli gate]], which is a ''controlled-controlled-NOT gate''.
| |
| | |
| == References ==
| |
| <references/>
| |
| | |
| == Further reading ==
| |
| * {{cite journal | title= Conservative Logic | first1= Edward | last1= Fredkin | authorlink1= Edward Fredkin | first2= Tommaso | last2= Toffoli | authorlink2= Tommaso Toffoli | journal= [[International Journal of Theoretical Physics]] | volume= 21 | issue= 3-4 | year= 1982 | pages= 219–253 | doi= 10.1007/BF01857727 | url= http://web.archive.org/web/20061017232512/http://www.digitalphilosophy.org/download_documents/ConservativeLogic.pdf}}
| |
| | |
| [[Category:Logic gates]]
| |
| [[Category:Quantum gates]]
| |
Hello from Switzerland. I'm glad to came across you. My first name is Jodi.
I live in a small town called Pohlern in western Switzerland.
I was also born in Pohlern 32 years ago. Married in February year 2008. I'm working at the college.
Here is my weblog; how to get free fifa 15 coins (just click the next site)