Download Billiard Ball Model and Conservative gates.

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Valve RF amplifier wikipedia , lookup

Analog-to-digital converter wikipedia , lookup

Schmitt trigger wikipedia , lookup

Operational amplifier wikipedia , lookup

Crossbar switch wikipedia , lookup

Power MOSFET wikipedia , lookup

Opto-isolator wikipedia , lookup

Flip-flop (electronics) wikipedia , lookup

Rectiverter wikipedia , lookup

CMOS wikipedia , lookup

TRIAC wikipedia , lookup

Transistor–transistor logic wikipedia , lookup

Digital electronics wikipedia , lookup

Transcript
Reversible Logic
Models: Billiard
Ball and Optical
Lecture 4
Marek Perkowski
Reversible and Quantum
Logic Fundamentals
from the Logic Synthesis
Point of View
Review: Atom-scale computation:
• What will be the difficulties when we will try to
build classical computers (Turing machines) on the
atomic scale?
• One of the toughest problems to scale down
computers is the dissipated heat that is difficult to
remove.
• Physical limitations placed on computation by heat
dissipation were studied for many years
(Landauer, 1961).
Computing at the atomic scale:
a survey made by Keyes in 1988
R. W. Keyes, IBM J. Res. Develop. 32, 24 (1988).
• Plot showing the number of dopant impurities
involved in logic with bipolar transistors with year.
– (Copyright 1988 by International Business Machines
Corporation)
Information loss = energy loss
• The loss of information is associated with laws of
physics requiring that one bit of information lost
dissipates k T ln 2 of energy,
– where k is Boltzmann’ constant
– and T is the temperature of the system.
• Interest in reversible computation arises from the
desire to reduce heat dissipation, thereby allowing:
– higher densities
– speed
R. Landauer, “Fundamental Physical Limitations of
the Computational Process”, Ann. N.Y. Acad.Sci, 426,
162(1985).
When will IT happen?
Logarithmic scale
Power for switching one bit
Related to information loss
k T ln 2
Assuming
Moore Law
works
2001
2020
2010
In our lifetime
Information is Physical
• Charles Bennett, 1973: There are no
unavoidable energy consumption requirements
per step in a computer.
• Power dissipation of reversible circuit, under
ideal physical circumstances, is zero.
• Tomasso Toffoli, 1980: There exists a reversible
gate which could play a role of a universal gate for
reversible circuits.
A
B
C
Reversible
and
universal
A
B
C  AB
Reversible computation:
• Landauer/Bennett: almost all operations required in
computation could be performed in a reversible manner,
thus dissipating no heat!
• The first condition for any deterministic device to be
reversible is that its input and output be uniquely retrievable
from each other.
– This is called logical reversibility.
• The second condition: a device can actually run
backwards - then it is called physically reversible
– and the second law of thermodynamics guarantees that it
dissipates no heat.
Billiard Ball Model
Reversible logic
Reversible are circuits
(gates) that have oneto-one mapping
between vectors of
inputs and outputs;
thus the vector of input
states can be always
reconstructed from the
vector of output states.
INPUTS OUTPUTS
000
000
001
001
36
010
010
42
011
011
100
100
101
101
110
110
111
111
2 4
53
65
(2,4)(365)
Reversible logic
Reversible are circuits
(gates) that have the same
number of inputs and
outputs and have one-toone mapping between
vectors of inputs and
outputs; thus the vector of
input states can be always
reconstructed from the
vector of output states.
INPUTS OUTPUTS
000
000
001
001
2 4
36
010 not allowed
010
Feedback
011
011
42
100
100
Fan-out not allowed
101
101
65
110
110
111
111
53
(2,4)(365)
Reversible logic constraints
Feedback not allowed in
combinational part
In some papers allowed under
certain conditions
Fan-out not allowed
In some papers allowed in a
limited way in a “near reversible”
circuit
Observations
• Every reversible gate can be described by a
permutation.
• Every reversible circuit can be described by a
permutation.
• Synthesis of a reversible circuit can be
considered as decomposition of a permutation
to a sequence of elementary permutations.
• Group theory has been successfully used for
designing cascades of reversible gates.
• To understand reversible
logic, it is useful to have
intuitive feeling of various
models of its realization.
Our examples will illustrate reversible
gates, conservative gates and synthesis
principles
Conservative
Reversible
Gates
Definitions
• A gate with k inputs and k outputs is called
a k*k gate.
• A conservative circuit preserves the
number of logic values in all combinations.
• In balanced binary logic the circuit has half
of minterms with value 1.
0
1
1
0
1
variable
1
1
0
1
0
xor3 Shannon
Conservative circuit
= the same number
of ones in inputs
and outputs
Davio
majority
xor2
Examples of balanced functions = half of Kmap are ones
Billiard Ball Model
DEFLECTION
DELAY
SHIFT
• This is described in E. Fredkin and T. Toffoli,
“Conservative Logic”, Int. J.Theor. Phys. 21,219
(1982).
Billiard Ball Model
(BBM)
A
Input
output
A B
1234
0
0
1
1
0
1
0
1
0
0
0
1
0
1
0
0
0
0
1
0
A and B
B and NOT A
0
0
0
1
A and NOT B
B
A and B
This is called Interaction Gate
This illustrates principle of conservation (of the
number of balls, or energy) in conservative
logic.
Interaction gate
Input
A B
output
A
Z1= A and B
z1 z2 z3 z4
Z2 = B and NOT A
0
0
1
0
1
0
0 0 0 0
0 1 0 0
0 0 1 0
1
1
1 0 0 1
Z3 = A and NOT B
B
Z4 = A and B
A
Z1= A and B
Z2 = B and NOT A
B
Z3 = A and NOT B
Z4 = A and B
Inverse Interaction gate
input
z1 z2 z3 z4
output
A
Z1= A and B
A B
Z2 = B and NOT A
0 0 0 0
0 1 0 0
0 0 1 0
0
0
1
0
1
0
1 0 0 1
1
1
Other input
combinations
not allowed
Z3 = A and NOT B
B
Z4 = A and B
A
B
Only disjoint inputs are OR-ed
z1
z3
z2
z4
Designing
with this
types of
gates is
difficult
Billiard Ball Model (BBM)
switch
A
Input
A B
0
0
1
1
0
1
0
1
output
z1
z2
z3
0 0
1 0
0 0
0 1
0
0
1
1
1
2
B
3
Z1 = NOT A * B
Z2 = A * B
Z3 = A
Switch Gate
A
1
2
Input
A B
0
0
1
1
0
1
0
1
output
z1
z2
z3
0 0
1 0
0 0
0 1
0
0
1
1
B
3
Z1 = NOT A * B
Z2 = A * B
A
B
Z3 = A
Inverse Switch Gate
A
z1
z2
input
z1
0
1
0
0
z2
output
z3
B
z3
A B
0 0 0 0
0 0 0 1
0 1 1 0
1 1 1 1
A
B
Z3
Z1
Z2
Inverter and Copier Gates from Switch Gate
Z1 = NOT A * 1
garbage
A
Inverter realized with
two garbages
garbage
1
garbage
Input
constants
Copier realized
with one garbage
V2 = B * 1
B
1
V3 = B
Garbage outputs
shown in green
Feynman Gate
P
+
• When A = 0 then Q = B, when A = 1
then Q =  B.
• Every linear reversible function can be
built by composing only 2*2 Feynman
gates and inverters
• With B=0 Feynman gate is used as a
fan-out gate. (Copying gate)
A
Q
A
B
A
A
A
+
A
+
0
A
1
Feynman Gate from Switch Gates
Z1 = NOT A * B
Fan-out > 1
B
Z2 = A * B
A
Z3 = A
AB
B
V1 = NOT B * A
V2 = B * A
B
A
V3 = B
Garbage outputs
Z2 and V2 shown
in green
Fredkin Gate
– Fredkin Gate is a fundamental concept in
reversible and quantum computing.
– Every Boolean function can be build
from 3 * 3 Fredkin gates:
P = A,
Q = if A then C else B,
R = if A then B else C.
Q
Q
R
R
P
P
0
0
1
0
1
1
A
B
A
B
C
A circuit from
two
multiplexers
C
A
B
C
C
AC’+B
BC’+AC
Its schemata
This is a reversible gate, one of many
Notation for Fredkin Gates
Yet Another Useful Notation for Fredkin Gate
Fredkin Gate
C
P
C
Q
Inverse Fredkin Gate
C’P+CQ
C
C’P+CQ
C
P
CP+C’Q
CP+C’Q
Q
In this gate the input signals P and Q are routed to the
same or exchanged output ports depending on the value of
control signal C
Fredkin gate is conservative and it is its own inverse
Operation of the Fredkin gate
C
A
B
A
0
B
C
AC’+BC
BC’+AC
A
AB
A
B
1
0
0
A
B
A
B
A
A+B
A
0
1
1
A
B
1
B
A
A
A
A’
A 4-input Fredkin gate
X
A
B
C
1
A
B
C
X
0
A
B
C
AX’+CX
BX’+AX
CX’+BX
1
C
A
B
A
B
0
1
0
A
B
C
A
A+B
AB
A’
Fredkin Gate from Switch Gates
CQ
 CP+CQ
Q
 CQ
CP+  CQ
CP
P
C
 CP
C
Another
Illustration of
Conservative
Property of a
Circuit
Operation of a circuit from Switch Gates
One red on inputs and outputs
Conservative property
CQ
 CP+CQ
Q=0
 CQ
CP
P=1
C=1
CP+  CQ
 CP
Red signals are value 1
C
Two red on inputs and outputs
Minimal Full Adder using Interaction Gates
AB+AXC
+BXC
0
Carry
AB
A
AB
A’B
(A+B)C
B
AB’
B
AB
AB
A’B
C
AB’
AB
Garbage signals shown in green
3 garbage bits
Sum
Reversible logic:
Garbage
• A k*k circuit without constants on inputs which
includes only reversible gates realizes on all
outputs only balanced functions.
• Therefore, k1 * k1 circuit can realize nonbalanced functions only with garbage outputs.
Switch Gate
Switch Gate
CP
Inverse Switch Gate
CP
P
C
C
P
C
C’P
C’P
C
In this gate the input signal P is routed to one of two
output ports depending on the value of control signal C
Minimal Full Adder Using Switch Gates
AB
A
carry
B
B
A’B
sum
C
Garbage signals shown in green
7 garbage bits
Minimal Full Adder Using Fredkin Gates
A
B
carry
C
1
0
sum
In this gate the input signals P and Q are routed to the
same or exchanged output ports depending on the value of
control signal C
3 garbage bits
Fredkin Gate from Interaction Gates
PQ
C
C PQ
P
 PQ
Q
PQ
C
CP+  CQ
 CP+ CQ
Swap gate from three Feynman Gates
0
0
1
1
0
1
1
1
1
0
1
1
1
0
0
1
1
1
1
1
1
1
0
0
Thus every
non-planar
function can
be converted
to planar
function
Fredkin Gate from Interaction Gates
PQ
C
C PQ
P
Q
PQ
C
CP+  CQ
 CP+ CQ
To verify conservative property signal ON is shown in red
Fredkin Gate from Interaction Gates
C
P
Q
C
CP+  CQ
 CP+ CQ
To verify conservative property signal ON is shown in red
Fredkin Gate from Interaction Gates
C
P
Q
C
CP+  CQ
 CP+ CQ
To verify conservative property signal ON is shown in red
Concluding on the Billiard Ball Model
• The Interaction and Switch Gates are reversible
and conservative, but have various numbers of
inputs and outputs
• Their inverse gates required to be given only some
input combinations
• Logic Synthesis methods can be developed on the
level of k*k gates such as Fredkin and Toffoli
(quantum)
• Logic synthesis methods can be developed on level
of simpler gates such as Interaction gate and Switch
gate that have direct counterparts in physical
processes.
Concluding on the Billiard Ball Model
• INVERTER, FREDKIN and FEYNMAN
gates can be created from Billiard Ball Model.
• There is a close link of Billiard Ball Model
and quantum gates and other physical models
on micro level
• Many ways to realize universal (for instance –
optical) gates, completely or partially
reversible but conservative