Design of Reversible Random Access Memory: Md. Selim Al Mamun Syed Monowar Hossain
Design of Reversible Random Access Memory: Md. Selim Al Mamun Syed Monowar Hossain
18
International Journal of Computer Applications (0975 8887)
Volume 56 No.15, October 2012
(a) A P=A
Frekdin
A P=A* B Gate Q AB AC
C R AC AB
B Q A B
(a)
(b)
Fig. 1. (a) Block diagram of 2x2 Feynman gate and (b) A P=A
Equivalent quantum representation B Q AB AC
3.2 Double Feynman Gate C V V V+ R AC AB
The input vector Iv and output vector Ov of 3*3 Double
Feynman gate (DFG) is defined as Iv = (A, B, C) and Ov = (P
= A, Q A B , R A C ). The quantum cost of Double (b)
Fig.4. (a) Block diagram of 3*3 Frekdin gate and (b)
Feynman gate is 2 [10]. The block diagram and equivalent
Equivalent quantum representation.
quantum representation of 3*3 Double Feynman gate are
shown in Fig. 2. 3.5 Peres Gate
The input vector Iv and output vector Ov of 3*3 Peres gate
A P=A (PG)[13] is defined as follows: Iv = (A, B, C) and Ov = (P = A,
DFG Q = A B, R = AB C). The quantum cost of Peres gate is
B Q A B
4. The block diagram and equivalent quantum representation
C R AC of 3*3 Peres gate are shown in Fig. 5.
(a)
A P=A
A P=A Peres
B Gate Q A B
B Q A B
C R AB C
C R AC
(b) (a)
Fig. 2. (a) Block diagram of 3x3 Double Feynman gate and A
(b) Equivalent quantum representation. P=A
B Q A B
3.3 Toffoli Gate
The input vector Iv and output vector Ov of 3*3 Toffoli gate C V V V + R AB C
(TG) [11] is defined as Iv = (A, B, C) and Ov = (P = A, Q = B,
(b)
R = AB C). The quantum cost of Toffoli gate is 5. The
block diagram and equivalent quantum representation of 3*3 Fig.5. (a) Block diagram of 3*3 Peres and (b) Equivalent
Toffoli gate are shown in Fig. 3. quantum representation.
19
International Journal of Computer Applications (0975 8887)
Volume 56 No.15, October 2012
4. PROPOSED MODIFICATION ON
FREKDIN GATE MFRG1 0 MFRG1
4.1 Modified FRG 1 gate
The input vector, Iv and output vector, Ov for 3*3 modified
Fredkin Gate (MFRG1) is defined as follows: Iv = (A, B, C)
and Ov=(P=A, Q AB AC , R AC AB ). The quantum
cost of MFRG1 gate is 4.
FG
A P=A
B Q AB AC Fig. 9. Proposed 2 to 22 decoder
C V V V+ R AC AB The proposed 2 to 22 decoder has quantum cost 9, delay 9 and
bare minimum of 1 garbage bit. The proposed design of 2 to
Fig. 6. Quantum representation of MFRG1 gate 22 decoder achieves improvement ratios of 18%, 18% and
50% in terms of quantum cost, delay and garbage outputs
4.2 Modified FRG 2 gate compared to the design presented in N.M.Nayeem et al. [14].
The input vector Iv and output vector Ov of 3*3 modified The improvement ratios compared to the design M. Morrison
Fredkin Gate (MFRG2) is defined as Iv = (A, B, C) and Ov = ( et al. presented in [19] are 10% and 10% in terms of quantum
P A , Q AB AC , R AC AB ). The quantum cost of cost and delay. The comparison of proposed 2 to 22 decoder
with the existing ones shown in table I.
MFRG2 gate is 5.
A PA Table I. Comparison of different types of 2 to 2 2 decoders.
B Q AB AC Cost Comparisons
2 to 22 decoder design
Quantum Delay Garbage
C V V V+ R AC AB Cost Outputs
Proposed 9 9 1
Fig. 7. Quantum representation of MFRG2 gate
Existing[14] 11 11 2
5. DESIGN OF RANDOM ACCESS Existing[19] 10 10 -
MEMORY Improvement(%) w.r.t. [14] 18 18 50
In this section we first presented proposed design for all the
components of RRAM. Then we presented our proposed Improvement(%) w.r.t. [19] 10 10 -
novel design of RRAM that is optimized in terms of quantum
cost, delay and garbage outputs.
Theorem 1: To construct n to 2n decoder, if g is the total
n number of gates required to design the decoder producing b
5.1. Proposed Reversible n to 2 Decoder
A single Feynman gate can be used to design the basic 1 to 21 number of garbage outputs then g 2n-1 and b n-1.
decoder. Using this decoder we can systematically add 2 n-1 Proof: For 1 to 21 decoder only one Feynman gate needed
number of MRFG1 gates to the design to achieve n to 2n that doesnt produce any garbage bit. So number of gate = 1
decoder. The design of 1 to 21 decoder is shown in Figure. 8. and garbage output = 0.
Now for n>1, n to 2n decoder design requires that each of the
Feynman output of the (n-1) to 2(n-1) decoders together with (n-1)
A A
selection bits are employed in separate MRFG1 gate to
Gate produce selections for n to 2n decoder. In that case overall
1 A number of gates becomes 2 n-1, because for n=1 we were
required only 1 gate. This design has n-1 garbage bits as the 1
to 21 decoder produces zero garbage.
Fig. 8. Proposed 1 to 21 decoder Theorem 2: The quantum cost of an n to 2n decoder is Qc
4.2n-7.
The design of decoder has 1 quantum cost, 1 delay and no
garbage output. Proof: From theorem 1, at least 2n-1 gates are required to
design n to 2n decoder. For n = 1 only one 2*2 Feynman gate
Our proposed 2 to 24 decoder using MRFG1 gates are shown is required which has quantum cost 1. Then 2 n-2 MRFG1
in Figure 9. gates are required and each MRF1 gates quantum cost is 4.
So total quantum cost Qc is = (2n-2)4 +1 = 4.2n-7.
20
International Journal of Computer Applications (0975 8887)
Volume 56 No.15, October 2012
MFRG2 gate. The Figure 10 shows our proposed D flip-flop the MRFG1 gate is carried to the first D flip-flop and if
with and outputs. write is low, output of the D flip-flop is fed back to the
second input of the MRFG1 gate so that state of the flip-flop
remains same.
MRFG2 The proposed write enable master slave D flip-flop has
quantum cost 17, delay 17 and 3 garbage bits. The proposed
design of single bit memory cell achieves improvement ratios
DFG of 19% and 11% in terms of quantum cost and delay
compared to the design presented in M. Morrison [19]. The
comparisons are summarized in table III.
Table III. Comparisons of different types of Write Enable
Master Slave D flip-flops with and outputs.
Fig. 10: Proposed design of D flip-flop with and
outputs. Cost Comparisons
Single bit Memory Cell
The proposed D flip-flop with and outputs has quantum Quantum Delay Garbage
cost 7, delay 7 and has the bare minimum of 1 garbage bit. Cost Outputs
The proposed design of gated D flip-flop achieves Proposed 17 17 3
improvement ratios of 50% in terms of garbage outputs
Existing[19] 21 19 -
compared to the design presented in Thapliyal et al. 2010[15]
and L. Jamal et al. 2012[16]. The comparisons of our D flip- Improvement in (%) 19 11 -
flop (with and outputs) design with existing designs in
literature are summarized in Table II.
5.3. Proposed Reversible Random Access
Table II. Comparison of different types of D flip-flops with
and outputs. Memory (RRAM)
A RAM is a two dimensional array of flip-flops. There are 2n
Cost Comparisons rows where each row contains m flip-flops. Each time only
D flip-flop design Quantum Delay Garbage one of the 2n output lines of the decoder is active which
Cost Outputs selects one row of flip-flops of the RAM. Whether a read or a
write operation is performed depends on the W input. When W
Proposed 7 7 1
is high, m flip-flops of the selected row of the RAM are
Existing[15] 7 7 2 written with the inputs D1 to Dm. When W is low, Q1 to Qm
Existing[16] 7 7 2 contains stored bits in the flip-flops of the selected row and
simultaneously the flip-flops are refreshed with the stored
Improvement(%) w.r.t. [15] 0 0 50 bits. The proposed design of 2n *m bit RRAM is shown in
Improvement(%) w.r.t. [16] 0 0 50 Figure.12.
Theorem 3
We need Write Enable Master Slave D FFs to design a Let g be the number of gates required to realize a 2n* m
Reversible Random Access Memory (RRAM). Our proposed Reversible RAM where n be the number of bits and m be the
write enable master slave flip-flop is shown in Figure 11. selection bits in the RRAM, then g 2n *(6m+2) +m-1.
Proof: A 2n * m RRAM requires n to2n decoder that consists
CLK of (2n-1) gates. 2n Toffoli gates are required to perform AND
W W operations in RRAM. m*2n D flip-flops are required inside
MFRG1 MFRG2 the m * 2n RRAM whereas each D flip-flop requires 5 gates.
D g1 g2 2n * m Feynman gates are required to perform the copy
Q operation. There are m number of 2n bit Feynman gate at the
FG blottom last row. If g be the minimum number of gates to
0 realize the RRAM, then g(2n-1) + 2n + 5*2n*m + 2n*m+m
Hence g 2n *(6m+2)+m -1.
CLK Theorem 4
MFRG2 Let n be the number of bits, m be the selection bits in the
g3 RRAM and b be the number of garbage outputs generated
from the RRAM, then b m*(4.2n -1)+n.
DFG Q Proof: A 2n * m RRAM requires n to2n decoder which
produces (n-1) garbage bits. 1 garbage bit is generated from
the mth Toffoli gate in the RRAM. Inside RRAM there are
2n*m D flip-flops and each D flip-flop produces 3 garbage
Fig. 11: Proposed write enable master slave D flip-flop. bits. The last row contains m number of 2n bit Feynman gate
and each of them produces 2n-1garbage bits. If b be the
As data are both read from and written into RAM, each Flip- number of garbage outputs then b (n-1) + 1 + 3*2n*m +
Flop should work on two modes- read and write. A MFRG1 m*(2n-1).
gate is used to multiplex between flip-flops D input and Hence b m*(4.2n -1) + n.
stored bit Q in the flip-flop. When write is high, input D of
21
International Journal of Computer Applications (0975 8887)
Volume 56 No.15, October 2012
D0 D1 Dm
0 0 0
FG FG FG
W Toffoli D Q D Q D Q
Gate C C C C C C
W W W W W W
0 0
I1 0 0
I2 FG FG FG
2n * m bit decoder
I3
Toffoli D Q D Q D Q
Gate C C C C C C
W W W W W W
0
0 0 0
In FG
FG FG
Toffoli D Q D Q D Q
Gate C C C C C C
W W W W W W
0
Q0 Q1 Qm
22
International Journal of Computer Applications (0975 8887)
Volume 56 No.15, October 2012
Circuits and Systems(ISCAS) 2006, Kos, Greece, May [13] A. Peres, "Reversible Logic and Quantum Computers,"
21-24 ,2006, pp. 243-246. Physical Review A, vol. 32, pp. 3266-3276, 1985.
[5] Dmitri Maslov and D. Michael Miller, Comparison of [14] Sk. Noor Mahammad and Kamakoti Veezhinathan,
the cost metrics for reversible and quantum logic Constructing Online Testable Circuits Using Reversible
synthesis, http://arxiv.org/abs/quant-ph/0511008, 2006 Logic, Ieee transactions on instrumentation and
measurement, vol. 59, no. 1, January 2010.
[6] Hafiz Md.Hasan Babu, Md.Rafiqul Islam, Ahsan Raja
Chowdhury, and Syed Mostahed Ali Chowdhury, [15] Himanshu Thapliyal and Nagarajan Ranganathan, Design
"Synthesis of full-adder circuit using reversible logic," of Reversible Sequential Circuits Optimizing Quantum
International Conference on VLSI Design, vol. 17, pp. Cost, Delay, and Garbage Outputs, ACMJournal
757-760, 2004. onEmerging Technologies inComputer Systems,Vol.
6,No. 4,Article 14, Pub. date:December 2010.
[7] Richard P.Feynman, "Quantum mechanical computers,"
Foundations of Physics, vol. 16, no. 6, pp. 507-531, [16] Lafifa Jamal, Farah Sharmin, Md. Abdul Mottalib and
1986. Hafiz Md. Hasan Babu, Design and Minimization of
Reversible Circuits for a Data Acquisition and Storage
[8] Mohammadi,M. and Mshghi,M, On gures ofmerit in System, International Journal of Engineering and
reversible and quantumlogic designs, Quantum Inform. Technology Volume 2 No. 1, January, 2012
Process. 8, 4, 297318, 2009.
[17] H. Thapliyal and A. P. Vinod, Design of reversible
[9] D. Michael Miller, Dmitri Maslov, GerhardW. Dueck, A sequential elements with feasibility of transistor
Transformation Based Algorithm for Reversible Logic implementation In Proc. the 2007 IEEE Intl. Symp. On
Synthesis, Annual ACM IEEE Design Automation Cir.and Sys., pages 625628, New Orleans, USA, May
Conference,Proceedings of the 40th annual Design 2007.
Automation Conference, Anaheim, CA, USA Pages: 318
323. [18] M.-L. Chuang and C.-Y. Wang, Synthesis of reversible
sequential elements, ACM journal of Engineering
[10] Perkowski, M., A hierarchical approach to computer- Technologies in Computing Systems (JETC). Vol. 3,
aided design of quantum circuits, 6th International No.4, 119, 2008.
Symposium on Representations and Methodology of
Future Computing Technology, 201-209, 2003. [19] Matthew Morrison, Matthew Lewandowski, Richard
Meana and Nagarajan Ranganathan, Design of Static
[11] Tommaso Toffoli, "Reversible Computing," Automata, and Dynamic RAM Arrays using a Novel Reversible
Languages and Programming, 7th Colloquium of Lecture Logic Gate and Decoder 11th IEEE International
Notes in Computer Science, vol. 85, pp. 632-644, 1980. Conference on Nanotechnology, Portland, Oregon, USA,
[12] Edward Fredkin and Tommaso Toffoli, "Conservative August 15-18, 2011
Logic," International Journal of Theoretical Physics,
vol. 21, pp. 219-253, 1982.
23