Novel high-performance QCA Fredkin gate and designing scalable QCA binary to gray and vice versa

In the design of digital logic circuits, QCA technology is an excellent alternative to CMOS technology. Its advantages over CMOS include low power consumption, fast circuit switching, and nanoscale design. Circuits that convert data between different formats are code converters. Code converters have an essential role in high-performance computing and signal processing. In this paper, first, we proposed a novel QCA structure for the quantum reversible Fredkin gate. Second, we proposed 4-bit and 8-bit QCA binary-to-gray converter and vice versa. For the second proposal, both reversible and irreversible structures are suggested. The proposed structures are scalable up to N bits. To change the conversion type from B2G to G2B, we use a 2:1 QCA multiplexer. The proposed QCA Fredkin is applied in the reversible design of QCA code converters as multiplexers. The suggested designs are simulated using the QCADesigner tool. Then we calculated figures of merit, including cell counts, occupied areas, and clock zones. Finally, we compare the proposed structures to existing research. Our proposed approach is the first quantum-dot cellular automata design to perform B2G conversion and G2B in a single QCA circuit. The proposed designs are scalable. Specifications are reported.


Introduction
The CMOS technology faces challenges like leakage current, speed limitation, and power consumption. Landauer demonstrated that non-reversible processing of the information leads to energy losses due to data loss [1,37,38]. Researchers have considered different technologies to overcome the limitations of CMOS technology and reduce the loss of energy. They found QCA one of the most appropriate substitutions for CMOS technology [2]. The QCA technology has advantages such as low power consumption, fast switching, and the capability to design circuits on the nanoscale [3]. QCA technology employs in the design of reversible logic gates. Gates are reversible if their outputs produce their inputs and vice versa. Reversible logic gates eliminate any information loss. There is no energy loss in a circuit that has no information loss.
A code converter generally turns data from one format to another. Signal processing depends heavily on code converters. In a binary-to-gray (B2G) code converter, binary numbers are input and converted into gray codes following processing. The gray-to-binary (G2B) code converter takes numbers in gray form as inputs and converts them into binary codes after processing. During the past few years, circuits like fault-tolerance B2G [4], binary incrementer [5], reversible ALU [6], hamming code circuit [7], reversible full adder [8], and multiplier [9] have been designed in QCA. A 3-bit B2G conversion and vice versa in the reversible and irreversible modes is proposed in [10]. Gray codes are beneficial when a binary number transition results in an error or ambiguity. As a result, since only one bit changes during a transition from one number to another, gray code will efficiently handle this problem. Other gray code applications are Boolean circuit minimization, genetic algorithms, mathematical puzzles, and position encoders. Some of the contributions and highlights of this paper are as follows: • Designing and simulating a 4-bit irreversible B2G conversion and vice versa in QCA technology • Designing and simulating an 8-bit irreversible B2G conversion and vice versa in QCA technology • Designing and simulating an N-bit irreversible B2G conversion and vice versa in QCA technology • Proposing and simulating a novel structure of reversible Fredkin (FRG) gate in QCA technology • Designing and simulating a 4-bit reversible B2G conversion and vice versa in QCA technology • Designing and simulating an 8-bit reversible B2G conversion and vice versa in QCA technology • Designing and simulating an N-bit reversible B2G conversion and vice versa in QCA technology • Verifying the designs using QCADesigner [11] • Power dissipation analysis of the proposed irreversible and reversible B2G and vice versa 1 3 Novel high-performance QCA Fredkin gate and designing scalable… • Comparing the designs with recent works regarding different figures of merit, including the cell counts, the occupied area, and the latency. • Our proposed approach is the first design to embed both B2G and G2B in QCA technology in a single circuit.
The organization of the rest of the paper is as follows: In Sect. 2, we provide the fundamentals of QCA technology. In Sect. 3, the previous works are discussed. The proposed QCA structures of Fredkin gate and code converters and their simulations are fully described in Sect. 4. Evaluation parameters for the proposed N-bit code converter are also calculated in Sect. 4. Section 5 shows the simulation results of the suggested QCA designs using the QCADesigner tool. In Sect. 6, the suggested structures are compared to related research, and an energy dissipation analysis of the proposed structures are presented. In Sect. 7, we concluded our work and proposed some future research directions.

Fundamentals of QCA
For the paper to be self-contained, in this section, we briefly describe various aspects of QCA technology, including QCA cells, QCA wires, QCA majority, QCA inverters, and QCA clocks.

QCA cell
The QCA cells are the most basic blocks of quantum-dot cellular automata circuits. As shown in Fig. 1, each QCA cell has four quantum dots and two free electrons at every corner. Tunnel junctions separate the dots so that electrons can reposition from one location to another [12]. A QCA cell can take several states depending on the occupation of electrons inside the dots. The operation of the QCA relies on Coulombic interactions. Electrons remain diagonally oriented due to Coulombic interactions, as seen in Fig. 1a and b [13]. This causes two states of polarization to emerge, logic '0' (P = −1) and logic '1' (P = + 1). P is the polarization of the cell [14]. Coulombic interactions enable neighboring QCA cells to exchange information; the state of one influences the state of the other.

QCA wire
In the design of logic circuits, designers use normal cells (in four zones), rotating cells, cells with fixed polarization, and input/output cells in QCA, as depicted in  [8]. A binary wire is a set of cells horizontally or vertically that transmits information.
A QCA wire is formed by connecting several cells at 90°, as shown in Fig. 3a, or 45° side by side, as shown in Fig. 3b [15]. The signal propagates along the wire from left to right as the leftmost cells are activated. A line of QCA cells forms a 90-degree QCA wire. A QCA wire with 45° cells transfers the incoming signal into odd cells and inverts it into even cells. QCA technology has two types of wire-crossings: coplanar and multilayer. It is possible to perform a wire-crossing in one layer called a coplanar wire-crossing. Figure 4b shows a QCA wire with 45-degree cells crossing over a regular wire. Alternatively, wires on either side of the wire-crossing should have two-phase differences, as shown in Fig. 4a. According to Fig. 4c, multilayer crossovers use multilayered architectures to pass the QCA wires over each other [16].

QCA clocking
Wires are divided into multiple clock zones to avoid signal degradation caused by a long chain of cells in the same clock zone. A QCA circuit uses the clock to synchronize  Novel high-performance QCA Fredkin gate and designing scalable… and regulate information flow. In very large scale integrated (VLSI) circuits, a signal controls the time, while in QCA, the clock controls the storage and removal of information within cells [17]. For altering time in the circuit, QCA calculations require a multi-phase clock [18]. A QCA clock comprises four phases: switch, hold, release, and relax [19]. The phases are 90 degrees apart. During the switch phase, the QCA cell begins the transition from unpolarized to a polarized state, and the barriers between the dots rise. In the hold phase, the barrier of the cell is at its maximum, electrons cannot tunnel through the dots, and the polarization of the cell does not change. The barrier is decreased in the release phase, allowing electrons to tunnel through the dots, and the cell's states become unpolarized. In the relaxation phase, the barrier stays reduced, and the cell is unpolarized. This clocking scheme splits a QCA array into four sub-arrays called clock zones. According to this method, a clock zone can complete its computation in four phases [6].

QCA majority and inverter gates
In QCA-based logic implementation, the majority (MV) and the inverter (INV) gates are essential. The MV gate is a function logic that includes three inputs and one output. Equation (1) displays its inputs and outputs. In Eq. (1), A, B, and C are inputs, and MV is the output.   Inverter gates are another significant structure for implementing logical circuits using QCA. Cells aligned diagonally will have opposite polarizations. By aligning cells diagonally, an inverter can be created. Figure 6 shows two examples of inverters in different shapes.

Related works
This section reviews previous works on QCA code converters and QCA multiplexers. Xiao-bin et al. [22] introduced a 4-bit B2G code converter using 2-input XOR gates in QCA technology. They simulated their suggested design with the QCADesigner tool. The suggested code converter featured fewer cell counts, a smaller area, and decreased latency compared to prior studies. Rao et al. [23] proposed a B2G and a G2B code converter using their proposed XOR. The proposed XOR contains only 29 cells. It is much smaller than the previous design. The proposed design of the B2G code converter includes only 127 cells. The simulation result was compared and evaluated against recent research. Khakpour et al. [24] presented new structures for converting B2G, G2B, and BCD-to-gray codes in QCA. Also, they suggested a new structure for the XOR gate for the circuit. There are 76 QCA cells in the proposed G2B converter, and its delay is 2.25 cycles. The proposed B2G converter consists of 99 QCA cells with a delay of 0.75 cycles. Karkaj et al. [25] proposed a new structure of a 2-input XOR. Then, using it, they simulated reversible and irreversible B2G conversions. The proposed work has good improvements with cell counts and area occupied. The proposed circuit includes 92 cells and one crossover. Ahmed et al. [26] proposed efficient 4-bit, 8-bit, and 16-bit designs of separated B2G and G2B converters that can scale up to N bits. These converters utilize to design 4-bit, 8-bit, and 32-bit communication systems for sending and receiving data effectively. We use multiplexers to select a single path from multiple inputs. Jeon [27] presented a QCA multiplexer with 13 cells and then suggested a shift register based on the proposed multiplexer. Khan [28] presented a simple single-layer multiplexer without any wirecrossing. This 2:1 multiplexer is shown in Fig. 7.

3
Novel high-performance QCA Fredkin gate and designing scalable…

Proposed QCA structures
A code converter transforms one code into another code to perform signal processing. On the one hand, the B2G code converter takes inputs in a binary format and then processes them to produce a gray format. On the other hand, a G2B code converter accepts numbers in the gray format as inputs, processes them, and then outputs the binary form. We present a novel structure for the Fredkin gate in QCA technology to utilize in reversible designs. Also, we propose and simulate novel QCA B2G and G2B code converters. The designs are done using both reversible and non-reversible approaches for converting 4-, 8-, and N-bit codes. To cross wires in QCA circuits, designers employ coplanar and multilayer schemes. Because of the fabrication difficulties associated with multilayer crossover, designers utilize coplanar crossover for designing one-layer QCA circuits. Although more clocking zones are necessary for coplanar crossover, these zones address the problem of sneak noise paths. As a result, in this paper, we use the coplanar scheme to achieve robust designs based on QCAs. Also, we use the coherence vector simulation engine to check the accuracy of the proposed design [29]. Figure 8 shows the simulation parameters for verifying the results of the proposed QCA structures.

The Proposed reversible Fredkin gate
In this section, we propose a novel structure for the Fredkin gate in QCA technology. This gate has a quantum cost of five. It maps three inputs ('A', 'B', and 'C') to three outputs ('P', 'Q', and 'R'). The values of 'P', 'Q', and 'R' are equal to , + , + , respectively. The first input (i.e., 'A') acts as a control signal, while 'B' and 'C' represent data. The input 'A' is connected directly to the output 'P'. If 'A = 0, the outputs are identical to the inputs (Q = B, and R = C). Otherwise, if A = 1, the outputs correspond to the inputs swapped (Q = C, R = B). Fredkin gate is a conservative gate, i.e., it has equal number of 1 s in the outputs as there are in its inputs. Fredkin gate is also a parity-preserving gate, i.e., the input parity is equal to the output parity. Fredkin gate is important for both reversible and quantum computing. It has applications in designing parity-preserving reversible circuits. In Fig. 7 The QCA 2:1 multiplexer in [28] the block structure, Fredkin gate serves as the multiplexer. By this definition, this gate is responsible for converting binary into gray and vice versa. Figure 9 shows the QCA layout and the simulation result of the proposed reversible Fredkin gate. The structure contains 32 cells within an area of 0.025 m 2 , with a latency of two clock zones.

Proposed irreversible 4-bit B2G and vice versa
In this section, we design and simulate the non-reversible structure of a 4-bit B2G code converter and vice versa in QCA technology. A 4-bit B2G converts a 4-bit binary number into its gray equivalent. A 4-bit G2B conversion receives a 4-bit gray number as input and produces its binary equivalent in output. Figure 10 shows the logic circuit of the 4-bit B2G and vice versa. A i , A 0 andA 3 are input, Least Significant Bit (LSB), and Most Significant Bit, respectively. SEL is a converter selector. The design uses three XOR gates and two multiplexers. Equation (4) shows the relationship between inputs and outputs.
If SEL equals zero, the offered circuit operates as a B2G converter, and the equation becomes Eq. (5).
The simulation parameters [29] (a) Our proposed QCA Fredkin gate structure (b) Simulation result If SEL equals one, the offered circuit operates as a G2B converter, and the equation becomes Eq. (6).
Using Eqs. (5) and (6), one can understand the functionality of the B2G and G2B code converters. Table 1 is the truth table for the 4-bit B2G and G2B code converters. Figure 11 shows the proposed design for the 4-bit B2G conversion in QCA technology. In this structure, A i is the input vector and P i is the output vector. The primary element of the suggested architecture consists of two-input XOR gates. Thus, we use the best XOR structure [21] in our simulations. This circuit includes 75 cells, an area of 0.08μm 2 , and one clock cycle. Table 1 Truth table for the 4-bit  converter Inputs (binary code) B2G G2B

Proposed irreversible 8-bit B2G and vice versa
In this section, we design and simulate the irreversible structure of an 8-bit bit B2G code converter and vice versa in QCA technology. An 8-bit B2G code converter receives an 8-bit binary number on the input and delivers its equivalent gray code on the output. Alike, an 8-bit G2B conversion accepts an 8-bit gray number from input and delivers its equivalent binary code in output. Figure 12 shows the logic diagram for designing an 8-bit B2G and vice versa code converter. A i and P i are input and output, respectively. A 0 . and A 7 are LSB and MSB, respectively. SEL is a converter selector. The design uses seven XOR gates and six multiplexer blocks. Equation (7) shows the relationship between inputs and outputs of the design. The design acts as a G2B converter if the value of SEL equals one. The circuit works as a B2G code converter if the value of SEL equals zero. Figure 13 indicates the QCA layout for the suggested irreversible 8-bit QCA B2G code converter and vice versa. A i and . P i are input and output, respectively. This circuit includes 204 cells, an area of 0.187μm 2 , and three clock cycles.

Proposed irreversible N-bit B2G and vice versa
In this section, we design and simulate an N-Bit B2G code converter and vice versa in QCA technology. Figure 14 shows the logic diagram for the N-bit code converter. The design uses N-1 XOR gates and N-2 multiplexer blocks. Equation (8) shows the relationship between inputs and outputs of the design.   15 The suggested irreversible N-bit QCA B2G and vice versa  Table 2 indicates the general equations for calculating the cell counts, the area, and the clock numbers. In performed simulations, Number Total_Mux and Number Total_Xor are N-2 and N-1, respectively. For the mentioned equations in Table 2, the value of N is greater than or equal to 4.

The suggested reversible 4-bit B2G and vice versa
In this section, we design and simulate the structure of the reversible 4-bit B2G code converter and vice versa in QCA technology. Figure 16 shows the block and quantum structures of the reversible 4-bit B2G code converter and vice versa. Our structure uses five Feynman (FG) and two Fredkin blocks. The design acts as a 4-bit G2B converter if the value of SEL equals zero. Also, it works as a 4-bit B2G code converter if the value of SEL equals one. Figure 17 indicates the suggested reversible 4-bit QCA B2G converter and vice versa. This circuit requires 162 cells, an area of 0.19 m 2 , and eight clock zones. For this design, the inputs and outputs of each Feynman are described in Table 3. The quantum structure of the Fredkin block is shown in Fig. 16. The quantum cost of the proposed Fredkin is five.

The suggested reversible 8-bit B2G and vice versa
In this section, we design and simulate the structure of the reversible 8-bit B2G code converter and vice versa in QCA technology. Figure 18 shows the block and quantum structures of the reversible 8-bit B2G and vice versa. Our structure uses 13 Feynman and six Fredkin blocks. The design acts as an 8-bit G2B code converter if the value of SEL equals zero. Also, it works as an 8-bit B2G code converter if the value of SEL equals one. Figure 19 indicates the suggested reversible 8-bit QCA B2G and vice versa.  Table 3 The inputs and outputs of each Feynman gate Label in Fig. 17 Inputs Outputs

The suggested reversible N-bit B2G and vice versa
We design and simulate the proposed reversible N-bit B2G code converter and vice versa in QCA technology. Figure 20 shows the block and quantum structures of the reversible N-bit B2G and vice versa. Our structure uses 2 N-3 Feynman and N-2 Fredkin blocks. The design acts as an N-bit G2B code converter if the value of SEL equals zero. Also, it works as an N-bit B2G code converter if the value of SEL equals one. Figure 21 indicates the proposed reversible N-bit QCA B2G code converter and vice versa. We calculate the figures of merit, including the cell counts, the area, and    Table 4 indicates the general equations for calculating the cell counts, the area, and the clock Used. In performed simulations, Number Total_Fredkin and Number Total_Feyman are N-2 and 2 N-3, respectively. For the mentioned equations in Table 4, the value of N is greater than or equal to 4.

Simulation result for the suggested 4-bit QCA B2G and vice versa
The simulation results for the proposed irreversible and reversible 4-bit B2G code converters are shown in Fig. 22 (a. and c.). In such a structure, the value of SEL is zero. As seen in simulation results, if the input value is 1010, i.e.,A 3 A 2 A 1 A 0 = 1010 , the output becomes 1111, i.e., P 3 P 2 P 1 P 0 = 1010 . Also, if the input value is 1111, i.e.,A 3 A 2 A 1 A 0 = 1111 , the output becomes 1000, i.e., P 3 P 2 P 1 P 0 = 1000 . The simulation result is verified based on Table 1. Figure 21 (b. and d.) shows the simulation results for the proposed irreversible and reversible 4-bit G2B code converters. In such a structure, the value of SEL equals one. As seen in simulation results, if the input value is 1010, i.e., A 3 A 2 A 1 A 0 = 1010 , the output becomes 1100, i.e., P 3 P 2 P 1 P 0 = 1100 . Also, if the input value is 1111, i.e., A3A2A1A0=1111, the output becomes 1010, i.e., P 3 P 2 P 1 P 0 = 1010.

Discussion and Power dissipation analysis
In this section, we compare the proposed QCA structure of Fredkin gate and code converters with existing counterparts based on different figures of merit. Also, we show power dissipation of the proposed QCA irreversible and reversible 4-bit B2G and vice versa using QCADesigner-E [31].

3
Novel high-performance QCA Fredkin gate and designing scalable…  Tables 6  and 7. Also, these designs have been compared with each other based on metrics like the cell counts, the area, and clocks. As said before, the existing QCA circuits in the     Tables 6 and 7 show the existing QCA code converters based on the cell counts, the area, and the clocks used. Designs in Table 6 are non-reversible, whereas designs in Table 8 are reversible. Our proposed QCA circuits can perform both code conversions for N-bit inputs (N ≥ 4) . For the mentioned equations in Table 8 (Proposed N-Bit), the value of N is greater than or equal to 4. Table 8 shows the specifications of our proposed QCA circuits, including quantum cost, constant input, garbage output, area, number of clocks, and the number of cells.

Power dissipation analysis
Researchers use the Hartree-Fock approximation to calculate the power dissipation of QCA cells. Equation (9) express the Hamiltonian matrix of an array of cells [17].
where f ij , C i , and E k are geometrical parameter, polarization of the ith neighboring cell, and kink energy, respectively. According to Hamiltonian and Coherence vectors, the energy dissipated by a QCA cell is calculated as Eq. (10).
where Γ and are the energy environment vector and the coherence vector of the cell. The QCADesigner-E software is used to perform an energy dissipation analysis of the proposed structures, including total energy dissipation and average energy dissipation per cycle. In Table 9, the total energy dissipation and average energy dissipation per cycle of the proposed designs are shown.

Conclusion
In this paper, we proposed a novel high-performance QCA structure for the reversible Fredkin gate. We also proposed QCA converters capable of performing B2G and G2B code conversions. Designing such QCA structures with both capabilities in one single circuit is done for the first time. We proposed both reversible and non-reversible structures for those QCA code converters. Both 4-bit and 8-bit QCA B2G and vice versa code converters are presented. Then we extended it to N-bit QCA code conversion. The designs were simulated, and the simulation results were reported. These structures were compared to the existing designs regarding different figures of merits like the cell counts, the area, and the clocks. One of the advantages of our designs is their scalability. The proposed structure for the QCA Fredkin gate and other contributions of the paper can be exploited by other researchers in the field of quantum-dot cellular automata design.
Acknowledgements This research has been supported by the Academy of Finland (project 349945).

Authors' contributions All authors have contributed equally.
Funding Open Access funding provided by University of Jyväskylä (JYU).

Availability of data and materials
Data sharing is not applicable to this article as no new data were created or analyzed in this study.

Conflict of interest
The authors declare that they have no competing interests.

Consent for publication Not applicable.
Ethics approval Not applicable.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.