0% found this document useful (0 votes)
81 views

Basics of Reversible Logic Gates

1) Reversible logic gates and circuits are important for building low-power quantum computers as they avoid the heat generation associated with logical irreversibility according to Landauer's principle. 2) Key reversible logic gates include the Toffoli gate and Fredkin gate, which are universal and have the same number of inputs and outputs. 3) Reversible circuits must be composed only of reversible gates, have no fan-out, and be acyclic to ensure they can be logically reversed without information loss.

Uploaded by

Rashika Aggarwal
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Basics of Reversible Logic Gates

1) Reversible logic gates and circuits are important for building low-power quantum computers as they avoid the heat generation associated with logical irreversibility according to Landauer's principle. 2) Key reversible logic gates include the Toffoli gate and Fredkin gate, which are universal and have the same number of inputs and outputs. 3) Reversible circuits must be composed only of reversible gates, have no fan-out, and be acyclic to ensure they can be logically reversed without information loss.

Uploaded by

Rashika Aggarwal
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 22

Basics of Reversible Logic Gates

Reasons to work on Reversible Logic


Build Intelligent Robots (quantum or reversible brains in nanotechnology) Save Power
Save our Civilization and supremacy of advanced nations?

Landauer Principle and What is Reversible Logic Gate?

Landauers Principle
In 1961, Landauer was considering the smallest amount of heat generated per bit processed in computation. He made several discoveries and innovations. He introduced the distinction of logical and physical irreversibility. A logically irreversible process is defined to be one that cannot be logically reversed, i.e. undone by reversing the flow direction of computation. He noted that a physical implementation of a logically irreversible process must be physically irreversible (i.e. cannot be undone or reversed to its prior physical state). A process is logically reversible if knowing the binary input to a logic gate, one can deduce the output and vice versa. (There is a 1 : 1 mapping between input bit string and output bit string (bijective ,math) e.g. of a logically reversible gate is the NOT gate. An example of a logically irreversible gate is the AND gate.

Landauers Principle
Knowing one has a 0 at the output of an AND gate does not allow one to deduce what the input was. This gate is logically irreversible. This is not surprising because there must be loss of information. The AND gate has 2 input bits and only 1 output bit. Information (one bits worth) has been destroyed! Landauer discovered (rather surprisingly) that the heat coming from computation was due to the destruction of information (wiping out bits of information) and not to the processing of bits. This is Landauers Principle. Landauer thought that since computers used logically irreversible gates, (I.e. typically NAND gates) that computing was inherently physically irreversible, and hence inevitably gave off heat.

Classical gates are irreversible


Conventional computers are built from basic building blocks, such as the AND, NAND, OR, NOR, and XOR gates. Such tables are logically irreversible.

This means that, if we forget the value of the input (A, B), knowledge of the output P is not sufficient to calculate backwards and to recover the value of (A, B).

AND

NAND

OR

NOR

XOR

Logical irreversibility = physical irreversibility.

The NOT gate is reversible The AND gate is irreversible


the AND gate erases information.

the AND gate is physically irreversible.

Overview of Reversible Gates


A reversible gate is one where there is a one-to-one correspondence between the inputs and the outputs (i.e., if in the truth table of the gate there is a distinct output row for each distinct input row). In Boolean algebra, such a function is both one-to-one (or injective) and onto (or surjective).

A B X Y 0 0 0 0

0 1 0 1
1 0 1 1 1 1 1 0

Logically Reversible Gates A logically reversible gate must have the same number of inputs as outputs (why?)! Two of the most famous such gates are the Fredkin Gate and the Toffoli Gate, shown below. The Fredkin Gate is a controlled swap gate, i.e. if the control bit C is 1, then the two input bits A and B are swapped at the output. See the figure and the corresponding truth table.

C A B

C A B

CA B 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1

C A B 0 0 0 0 1 1 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 0 1 1 Truth table for the Fredkin Gate. If C=1, A and B swap, otherwise A and B go through unchanged.

The Toffoli Gate is often called a CCNot Gate, i.e. if the two control input bits are both 1, then the 3rd input is reversed. See the figure and its truth table on the next slide. The Toffoli Gate is an important gate in quantum computing as you know already.

C1 C2 A

C1 C2 A

0 0 0 T 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 1 If the two control input bits C1 and C2 1 0 0 1 0 0 of a Toffoli Gate are both 1, then the 1 0 1 1 0 1 input bit A reverses, else all 3 bits go 1 1 0 1 1 1 through unchanged. 1 1 1 1 1 0 Both gates are computationally universal, i.e. they can be used to generate AND, OR, NOT gates, which together form a computationally universal set of gates (i.e. they can be used to generate any Boolean function (i.e. a function that maps a set of M-bit input strings into a set of N-bit output strings). Ex. Show that these two gates are computationally universal.

C1 C2 A

C1 C2 A

Real-world Applications
Digital signal processing Cryptography Computer graphics Network congestion

First Example: Toffolis Gate

Tomasso Toffoli, 1980: There exists a reversible gate which could play a role of a universal gate for reversible circuits.

Q(3) :(x,y,z)==>(x,y,zxy) denotes EXOR


x y x y

z
A B

z xy

Fredkin and Toffoli created the first (3,3) universal gate


A

reversible

A XOR B

Toffoli Gate

Non-linear Gate: Toffoli


Important example of non-linear gate: 3-bit Toffoli gate, (3,3) Toffoli gate

Called also controlled-controlled-NOT


x x y z xy
We already introduced this gate earlier, now will be more detail

y
z

It flips the third bit if the first two bits are 1 and does nothing else

Like the Toffoli gate, it is its own inverse (please prove these two facts)

Of course, a computer built of only this type of gate, even using quantum technology, would have the power of only classical computers

But we can in addition to these gates construct

gates that are possible only in quantum


x y x y

z xy

Sufficient motivation is also that reversible gates can be realized in many other technologies that already exist

Reversibility in Logic Gates


A logic gate is reversible if
It has as many input as output wires It permutes the set of input values

Some examples include


An inverter (the NOT gate) A two-input, two-output gate which swaps the values on the input wires (the SWAP gate) An (n+1)-input, (n+1)-output gate which leaves the first n wires unchanged, and flips the last if the first n were all 1 (the n-CNOT gate)

Reversibility in Logic Circuits


A combinational logic circuit is reversible if
It contains only reversible gates It has no FANOUT It is acyclic (as a directed multigraph)

It can be shown that a reversible circuit has as many input wires as output wires, and permutes the set of input values

The synthesis of a 2-bit reversible gate: (a) truth table, (b) three different implementations combining NOTs and CONTROLLED NOT. Figure gives a representative example of a 2-bit reversible gate, realized by combining NOT and CONTROLLED NOT gates.

Whereas output Q simply equals input B, output P can be described in three different ways:
P = NOT (A B) P = A (NOT B) P = (NOT A) B .

Controlled NOT gate


These three boolean expressions are identical, but lead to different physical realizations. We note, however, that these implementations not only make use of the 1-bit NOT function and the 2-bit CONTROLLED NOT function, but also of the 2-bit exchanger, i.e. the gate that interchanges two logic variables (realizing P = B as well as Q = A). This is an example of a general property: the EXCHANGER, the NOT, and the CONTROLLED NOT form a natural `generating set' for the twenty-four 2-bit reversible gates. More precisely, each reversible 2-bit gate can be synthesized by taking one or zero CONTROLLED NOTs and adding one or zero EXCHANGERs and one or zero NOTs to the left and to the right of it.

Note that:
neither the EXCHANGE R nor the NOT is a true 2-bit gate, but the CONTROLL ED NOT is one.

Table 4: The three generators of the 2bit reversible gates: (a) EXCHANGER, (b) NOT, (c) CONTROLLED NOT.

See Table 4

References: reversible logic synthesis by Anas N. al-rabadi and wikipedia

THANK YOU..!!

You might also like