Sistema binario
∑
=
n
n
an
N 2
a
n= 0 , 1 2 → 10 3 → 11 59 → 111011
A B C S D
1 1 1 1
0 0 1 0 1 1 0
1
1 1 0 1
1 0 1 1
1 0 0 0
0 1 1 1
0 1 0 0
0 0 1 0
0 0 0 0
Tavola dell’addizione
A bit primo addendo B bit secondo addendo
C bit riporto precedente somma S bit somma
D bit riporto
101 11
10 + = 5 3
2 + =
Algebra di Boole
Porte Logiche
A 1 0
0 1
A B
1 0
1 1 1
0 1 0
A B
1 0
1 1 0
0 0 0
A B
1 0
1 0 1
0 1 0
B A +
OR AND
B A
NOT
XOR
A
B A B
A B
A / = +
A B
0 0
0 1 1 1
0 1 0 0
1 0
1 1 0 0
1 0 0
0 0 1
1 1 1
0 1 0
A B A B A B A B + A B
B A B
A + =
B A
AB = +
BC AC
C B
A + ) = + (
A B
B
A + = + BA AB =
A A =
A B
B
A / = /
( )
( NOT A ) Id ( ) A
NOT =
( A B ) OR ( B A )
OR , = ,
( A B ) AND ( B A )
AND , = ,
( A B ) XOR ( B A )
XOR , = ,
( B C ) ( A B ) C
A + + = + +
( ) ( ) BC AB C
A =
( A B )( A C )
C B
A + = + +
B A
B A
B
A / = / = /
Sommatore Logico
( A B ) C
S = / / D = ( A / B ) C + AB
A B AB A/B C (A/B)/C S (A/B)C (A/B)C+AB 1
1 0 0 0 0 0
0
0
0
1 1 1 0 1 0 0 1
0 1 0 0
0 0
D
1 1
1 1 0 1 0 0 0 0
0 1 0 1 1 0 0
0 1 1 1 1 0
1 1 1
0
1 1 0
1 0 0 1 0 1 1
1 0 1
1 0 0
0 1 1
0 1 0
0 0
0 1
0 0 0
Porte Logiche
Realizzazioni fisiche delle porte logiche Circuiti elettro-meccanici
OR
NOT AND
Vds
Vgs
input
output R
n p n
Vg
MOSFET
drain gate
source
Circuiti elettronici NOT
NAND
Vds
output
A B C 0 0 1 0 1 1 1 0 1 1 1 0
R C
A
B
A B C 0 0 1 0 1 0 1 0 0 1 1 0 NOR
AB C =
Vds
R
B A
C = +
A B
C
Porte Logiche Reversibili
Input Output
AND non è reversibile NOT è reversibile
La formulazione della MQ con Osservabili Autoaggiunte ed Evoluzione Unitaria è REVERSIBILE
i i
f
A B
B = ⊕
Ai Bi Af Bf
0 0 0
0 1 1
0
0 1 1
1 0 1
1 1 0
CONTROL – NOT (CN)
⎩ ⎨
⎧
=
= =
= 1
0
i i
i i
f i
f
B se A
A se B B
A A
i i
i i i
i
f
A B A B A B
B = + = /
Bit di controllo
Bit target
Ai Af
Bf
Bi CN
CONTROL - CONTROL – NOT (CCN)
(Toffoli)
C
f= A
iB
i⊗ C
iAi Bi Ci Af Bf Cf
0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 0 1
1 1 0 1 1 1
0 0
1
1 0
1 0 0 0
1
0 0 0
1 0 0
0 1
1 1
⎩ ⎨
⎧ = =
=
=
= C altrimenti
B A
se C C
B B
A A
i
i i
i f
i f
i f
1
Bits di controllo
Bit target
Ai Af
Bf Bi
Cf
Ci CCN
Porta Universale
•A
i=B
i=1 NOT
•Ai=1
CN
•Ci=0
AND
i
f
C
C =
i i
f
B C
C = ⊗
i i
f
A B
C =
Sommatore Reversibile
( )
( )
( ) ( )
(
i) (
i i)
if
i i i i i
i f
i i
i i
i i i
i i i
C B
A C
B C
B A C B A D
C B D
B A B
A B
B A ,D
,B A D
D
/ /
,
, , / ,
,
/ ,
, 0
1
1 1
1 1
=
=
=
=
=
=
=
=
=
CN
CCN CCN
CN CCN
A B C D
1 1 1
1 1
1 0 1 1
1 0 1 1
0
1 1 1
1 0 1
CCN(A,B,D)
Circuito logico:
1. Porte logiche 2. Fili
addendi resto controllo
Bi Ci Di
CN(A,B)
Ai Af
Bf Cf Df CCN CCN
CN
CN
CCN(B,C,D) CN(B,C)
somma resto
Porta di Fredkin
CONTROL – EXCHANGE (F-gate)
Ai Bi Ci Af Bf Cf
0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 1 0
1 1 0 1 0 1
1 0
1
1 0
1 0 0 0
1
0 0 0
1 0 0
0 1
1 1
⎪⎪
⎩
⎪⎪
⎨
⎧
⎭ =
⎬⎫
⎩⎨
⎧
⎭ =
⎬⎫
⎩⎨
⎧
⎭ =
⎬⎫
⎩⎨
= ⎧
1 0
i i
i
i i
i
f f i
f
A B se
C
A C se
B C
A B A
Ai Af
Bf Bi
Cf Ci
Porta Universale
•Ci=0