1 Introduction

Should optical communication be used or not? Is access to this technology cost-effective considering its economic costs? Given the breadth of this field of science, what is the best option to propose this design and how is it achieved? How is it be possible to design and manufacture optical devices in this field? Can these devices be coupled with older technologies? Is it possible to design and manufacture them with available technology and how can it be achieved? These are some of the most important and key questions asked by many researchers involved in telecommunications and optoelectronics so that they always seek to answer them.

Given the increasing advancement of technology and the available resources, the need for high-speed communications with broad bandwidth and low power consumption seems essential. However, today’s conventional technology does not meet the needs of societies in this field. Therefore, an appropriate replacement for it should be considered. One of the most suitable options that are highly emphasized and approved today by the majority of experts in this field is the use of light and accordingly the design and manufacture of optical devices (Kaushal and Georges 2016). Unlike electronics, light does not suffer the speed limit, and the suitable substrates for its use have been provided by the appropriate investments that are economically justifiable due to using lasers and fiber optic substrates (Keiser 2003; Agrawal 2012). Various substrates have been proposed so far to achieve the desired goals in the field of optical communications, including the unique material of graphene (Avouris 2010; Geim and Novoselov 2010; Haddadan et al. 2020), alternating and multidimensional structures of photonic crystals (PCs) (Mohammadi et al. 2020a; Xie et al. 2020), plasmon with plasma effects (Špačková et al. 2016), metamaterials (Liu and Zhang 2011), and other two-dimensional and multi-dimensional materials (Bao et al. 2017). Each of these substrates has advantages and disadvantages according to their specific characteristics that allow them to be used in different areas based on their functions. Using the proposed substrates, some designs have been made by the current technologies, the evidence of which is the research conducted in this field, some of them are now used in today’s industries, and others are still under investigation (Estevez et al. 2012; Su et al. 2018; Romagnoli et al. 2020).

As mentioned, one of the most important and practical substrates in the field of optics and optical devices is the PCs, which have received much attention due to their special characteristics (Hameed and Obayya 2019). This kind of optical substrates includes one, two, three-dimensional and alternating structures in the intended directions, in which the alternation has created the important feature of the photonic bandgap (PBG) that is an important factor in directing and controlling light to design and manufacture various optical devices to be used in optical communications (Johnson and Joannopoulos 2001; Hameed and Obayya 2019). Additionally, using various optical effects in these structures, including nonlinear effects (Mehdizadeh et al. 2017), wave interference effects Mohammadi et al. 2020b; Mohebzadeh-Bahabady and Olyaee 2018), and Self-collimated (Aidinis et al. 2020), is another influential factor that has led to the presentation of various optical devices. These optical devices include solar cell (Ishizaki et al. 2018; Soman and Antony 2019), optical filter & multi/demultiplexers Mohammadi et al. 2020a; Fallahi and Seifouri 2018), optical modulators (Huang et al. 2019), optical converters (Mehdizadeh et al. 2017; Miao et al. 2006), optical biosensors (Romano et al. 2018; Surdo and Barillaro 2020; Liu et al. 2020), optical logic devices (Correia et al. 2017; Haddadan et al. 2020; Lee et al. 2009), and so on.

Among the various types of optical devices that have been presented using PC structures, all-optical logic devices have a special place. Generally, due to their different types, logic gates have different applications in telecommunications, electronics, business, orbital launches, industry, computer systems, automobiles, and so on, which struggle today with many problems due to technological limitations. However, a fundamental step can be taken in this field by combining these devices with PC structures and providing all-optical logic gates. Among different types of all-optical logic gates based on PCs that have been presented so far, one can refer to basic logic gates (Ge et al. 2020), optical half adders and full adders (Mohammadi et al. 2020b), and optical decoders and encoders (Alipour-Banaei et al. 2016; Mehdizadeh et al. 2016; Moniem 2016). The research conducted in this field has mainly been related to the technique of using nonlinear effects to achieve the intended goals. In addition to its advantages, the use of nonlinear effects has major disadvantages such as high-power consumption for commissioning, large structural size, and complex design that make this technique difficult to use (Alipour-Banaei and Seif-Dargahi 2017). In the meantime, the technique of using self-collimation effects, due to its operation nature, has been used more in the field of optical fibers and special structures and less attention has been paid to it in the field of all-optical logic gates. Anyway, due to its unique features such as low power consumption for commissioning, simple design, small structure, and simple analysis, the technique of using interference effects can be a good alternative to other techniques (Mohebzadeh-Bahabady and Olyaee 2020; Mostafa et al. 2019; Rajasekar et al. 2020; Seif-Dargahi 2018).

The purpose of this paper was to realize a 4 × 2 all optical encoder based on photonic crystal. In this regard, various paper has been presented by researchers in different ways mentioned above. In this regard, in 2017, Gholamnejad and Zavvari (2017), using nonlinear effects, presented a 4 × 2 PhC encoder, which had high power consumption, size 1000 mW/µm2 and 726 µm2, respectively. Also, Hadadan et al. (Haddadan et al. 2020) using nonlinear effects, presented an encoder structure with a power consumption above 100 mW/µm2. In the 2020 s, Rajasekar et al. (Rajasekar et al. 2020), And Mohebzadeh-Bahabady and Olyaee (2020) presented an encoder with a power consumption of less than 1 mW/µm2 and a foot print of less than 170 µm2 using the interference method.

According to the above mentioned, this paper presents an ultra-fast all-optical encoder based on 2D-PCs by the use of silicon technology. In this structure, by using interference effects instead of nonlinear effects, replacing nano-resonators (NRs) instead of ring resonators, and combining 2-branch output waveguide with them, an important step has been taken to realize logic gates. A structure with a size of smaller than 149 µm2 and power consumption of less than 1 mW/µm2 has been created using the given factors that lead to the desired results. The use of a 2-branch waveguide in combination with NRs has caused a decrease in the power dissipation, the prevention of the minimal light scattering in the structure, and the symmetry of the structure. The results considered regarding the logic gates are related to contrast ratio (CR), bit rate (BR), response time, structural size, power consumption, and frequency range, and operating wavelength, which have been investigated in the present paper. Finally, after designing and performing simulations to investigate the effects of various structural parameters such as the radius of the dielectric rods and the Nano Resonators (NRs), the effects of the lattice constant (a), the input power, and the central wavelength (λResonant) on the results obtained from the structure have also been investigated, causing the presentation of a principled and logic structure with no data fabrication. The unique design of the structure and the results obtained from the optimization of its simulation causes the proposed structure to be very suitable for being used in integrated optical circuits. It can be considered as a basic structure for designing optical devices based on photonic crystals (PCs).

2 Design consideration

In general, an encoder does the act of encoding in logic circuits and performs the reverse operation of a decoder. An encoder has always 2n input lines and n output lines so that the inputs create the outputs of the circuit. An example of a 4 × 2 encoder has been presented in Table 1, according to which the circuit has 4 inputs and 2 outputs and only one input can be in logic 1 (active) at any time, while the outputs of the structure can be in logics 0 or 1 (inactive or active) in this case (Mohebzadeh-Bahabady and Olyaee 2020).

$$\text{O}1=\text{I}1+\text{I}3$$
$$\text{O}2=\text{I}2+\text{I}3$$
Table 1 The truth table for the encoder

Designing and manufacturing optical logic circuits and gates to be used in future integrated optical circuits are of great importance, among which optical encoders have a special place. They take logics 1 or 0 with or without radiation of light to each of the structure inputs and take also logics 1 or 0 by receiving or not receiving light in the outputs.

In the present research, according to its main focus that has been the realization of the structure of an all-optical 4 × 2 encoder based on PCs, 20 × 25 dielectric rods in an air background and the square lattice constant were used. To benefit from the silicon technology and the simplicity of the structure, dielectric rods were made of silicon (nr=3.46). The value of the lattice constant (a) of the structure was equal to a = 520 nm and the radius (R) of the dielectric rods was considered to be about R = 100 nm. According to the selected parameters, the initial PC structure had a size of about 149 µm2, which is simple, flexible and small compared to other structures proposed in this field. The range of the PBG of ​​the structure has been shown in Fig. 1. According to the figure, the PBG at TM mode was in the range of 0.279 ≤ a / λ ≤ 0.420 and 0.711 ≤ a / λ ≤ 0.737 with a wavelength range of 1238 nm ≤ λ ≤ 1863 nm and 705 nm ≤ λ ≤ 731 nm, respectively. These ranges can be regarded as appropriate due to the operating range considered for designing the structure. It should be noted that the plane-wave expansion (PWE) method was used to determine the range of the PBG of the structure (Cao et al. 2004).

Fig. 1
figure 1

The proposed PBG of the fundamental structure

After determining the structural parameters and the range of the PBG of the structure, the structure of the 4 × 2 encoder was designed using the interference effects. For this purpose, line and point defects and optical waveguides were used, which have been shown in Fig. 2. According to the figure, four linear waveguides W0-W3 were used to create optical inputs I0-I3. Additionally, to create the outputs of the structure to receive light entering the structure, two curved 2-branch waveguides W4 and W5 were used at the intersection with the waveguides W1 and W2. According to the type of mechanism used, the structure was completely symmetrical with respect to the horizontal axis. As the output was not received when I0 was active, a linear waveguide without coupling to the output waveguides was used that can be moved to the top and bottom of the structure because of the lack of receiving the output.

Fig. 2
figure 2

 A sketch of the final proposed encoder logic gate based on NRs & curved 2-branch waveguides

In addition, to create logic states when I1 and I2 were active, linear waveguides were used by creating symmetry to create logic 1 in each of the outputs. Finally, to create a logic state when I3 was active, a horizontal linear waveguide was used at the intersection with the vertical waveguide to create symmetry and split the light to reach each of the outputs and create logic 1 in each of them. To prevent light scattering into the structure at the intersection of the waveguides, scattering rods (SRs) with the same size as dielectric rods were used, and to resonate the light and couple it to the outputs, two NRs with a radius of 40 nm were used. It should be noted that the reason for using this special type of curved 2-branch waveguide is the better and complete conduction of light from inputs to outputs, the prevention of the transfer of light to other unwanted outputs, and the reduction of power dissipation and light scattering at the intersection with NRs and waveguides. This is a very unique and new method that eliminates the need to use non-linear materials.

3 Numerical results

To simulate the structure of the intended 4 × 2 encoder, the two-dimensional finite-difference time-domain (2D-FDTD) numerical method was used (Taflove and Hagness 2005). In this numerical method, it is always necessary to use an accurate meshing of the structure. Thus, considering \(\varDelta x=\varDelta z=\frac{a}{16}\) and a=520 nm, the size of the mesh in the proposed structure was calculated to be \(\varDelta x=\varDelta z=32.5\). All simulations were performed at a wavelength of λ = 1550 nm. The input power was considered to be Pin=1 mW/µm2 for each of the inputs in the active state or logic 1. When analyzing the different logic states at the outputs obtained from the simulations, powers between 0 and 20 % correspond to logic state 0 while those higher 40 % correspond to logic state 1.

According to the performance of the 4 × 2 encoder structure, four operating states can be considered for it. Each of these states realizes when only one input is active, and the results obtained in the outputs can be presented as follows.

The amount of power received at the outputs relative to the input power and the response time are two important factors for each of these states. Other important factors in this field are the BR and the CR, which can be obtained by the following equation, indicating the accuracy of the given structure in separating the results obtained regarding the recognition of logic states (Mohammadi et al. 2020b).

$$\text{C}\text{R} \left(\text{d}\text{B}\right)=10\times \text{l}\text{o}\text{g}\frac{{\text{P}}_{\text{o}\text{n}}}{{\text{P}}_{\text{o}\text{f}\text{f}}}$$

where Pon indicates the lowest power received at the output in logic 1 or active state, and Poff indicates the maximum power received at the output in logic 0 or inactive state.

3.1 State 1

As can be seen from the power distribution in Fig. 3a, when input I0 is active and the other inputs are inactive, the input light is resonated in the waveguide, and due to the lack of coupling to the output waveguides, it is returned as a mirror. In this state, no output is active and both outputs are off. According to Fig. 3b, c, due to the symmetry in the structure and the creation of a dividing state in the structure, the amount of input power in each of the outputs O1 and O2 is equal to 0.079 Pin. Response time is also estimated to be 0.21 ps.

Fig. 3
figure 3

The results for the all-optical encoder when I0 is active. a The electromagnetic field, b the output power level, c the output intensity

3.2 State 2

As can be seen from the power distribution in Fig. 4a, when I1 is active and the other inputs are inactive, the input light is directed to waveguide W1 and is directed by the curved 2-branch waveguide W4 to output O1. According to the figure, the presence of NRs prevents the transfer of light in other waveguides, and by resonating the light, they cause better conduction and transfer of light to the curved 2-branch waveguide and activate the O1 output. According to Fig. 4b, c, The input power at each of the outputs O1 and O2 is equal to 0.76 Pin and 0.0284 Pin, respectively, representing logics 1 and 0. Response time is estimated to be 0.21 ps.

Fig. 4
figure 4

The results for the all-optical encoder when I1 is active. a The electromagnetic field, b the output power level, c the output intensity

3.3 State 3

As can be seen from the distribution of power in Fig. 5a, when input I2 is active and other inputs are inactive, this state operates similar to state 2 due to the symmetry of the structure. In this state, the light is directed into the structure by the waveguide W2. It is directed into the output O2 by the curved 2-branch waveguide W5 and is placed in the active state. In addition, the presence of NRs causes to resonate the light and not transfer more light in other waveguides, and by directing light into the output waveguides, it causes more light to be transmitted and received at the output O2. According to Fig. 5b, c, the amount of power received at the outputs O1 and O2 are equal to 0.0284 Pin and 0.76 Pin, respectively, representing logics 0 and 1. The response time is estimated to be about 0.21 ps.

Fig. 5
figure 5

The results for the all-optical encoder when I2 is active. a The electromagnetic field, b the output power level, c the output intensity

3.4 State 4

As shown in Fig. 6a, the input I3 is active and other inputs are off. In this state, the light is directed into the structure by the waveguide W3, and considering the symmetry created, it is directed by the vertical waveguide to the upper and lower parts of the structure. Finally, the light is resonated by NRs. It is directed to the curved 2-branch output waveguides and activates both outputs. As shown in Fig. 6b, c, the amount of power received in each of the outputs O1 and O2 is the same and equal to 0.485 Pin, representing logic 1. The response time of the structure is estimated to be about 0.21 ps. The results of the simulation of these 4 states have been presented in Table 2.

Fig. 6
figure 6

The results for the all-optical encoder when I3 is active. a The electromagnetic field, b the output power level, c the output intensity

Table 2 Optical power in input and output ports for all-optical encoder

4 Optimization and evaluation of the performance of the structure parameters

As explained in the previous section, considering the design and simulations, the proposed 4 × 2 encoder with a simple and very different design based on the interference effects lead to desirable results. However, achieving these results depends on optimizing the structure to investigate the factors affecting the results. Therefore, these factors are of great importance and have been investigated in this section. One of the influential factors is the use of different materials with different refractive index, which have been always considered as an important factor affecting the output of optical structures, and the research conducted in this field indicate it. As the structure proposed in the present research has been based on the use of silicon technology, the material used has been silicon, and the changes were made accordingly in other effective structural parameters to be investigated and optimized. It should also be noted that due to the specific symmetry of the structure and the results of it as well as the lack of light coupling to the outputs in state 1, the investigations were limited to the results obtained from states 2 and 4 only.

The first factor investigated was the effect of the value of the lattice constant of the structure on the results obtained regarding the power received at the outputs. The use of a square or triangular lattice constant in the structures based on PC has always been an important and challenging issue. However, the use of square lattice constant has received much attention due to its simplicity and flexibility in designing optical structures and creating various structures. According to research, the use of this type of lattice constant causes to create a structure with an appropriate linear bandwidth (Fallahi et al. 2019). Accordingly, using this type of lattice constant, changes were made with a step of ∆a = 10 nm. As the diagram presented in Fig. 7 shows, in state 2, the amount of power received at the output O1 increases and reaches its optimal value with the increase in the constant lattice. However, it finally goes down again. In state 4, the amount of power received at both outputs O1 and O2 increases and reaches its optimal value with the increase in the constant lattice. It finally goes through a decreasing process again. According to the results obtained, the best value of the lattice constant to optimize the structure in terms of the power received at the outputs is equal to a = 520 nm.

Fig. 7
figure 7

Optical output power in different modes for different lattice constant value, a state 2, b state 4

The next parameter, the effects of which on the power received in the outputs of the structure were investigated, has been the radius of the dielectric rods. The results of the changes in this parameter were evaluated with a step ∆R = 10 nm. According to Fig. 8, in state 2, the amount of power received at the output O1 increases and reaches its optimal value with the increase in the radius of the dielectric rods, but it then decreases again. In state 4, the same process is also repeated and both outputs O1 and O2 reach their optimal value at a certain size of the radius. According to the results, the best size of the radius of the dielectric rods to optimize the structure in terms of the power received at the outputs is equal to R = 100 nm.

Fig. 8
figure 8

Optical output power in different modes for different dielectric rod radius, a state 2, b state 4

Given that NRs were used in this structure to properly resonate the light in different states to create the desired logic structure, it was very important to choose the appropriate type and size of this parameter. The lack of proper selection of this parameter can affect very much the non-uniform distribution of light as well as the light scattering. Therefore, the results obtained regarding the amount of power received at the outputs of the structure by increasing the radius of NRs at a step of ∆NR = 10 nm were investigated. As can be seen in Fig. 9, in state 2, the amount of power received at the output O1 decreases relatively with the increase in the radius of the NRs. However, in state 4, this process is repeated in reverse, and the amount of power received at the outputs O1 and O2 increases and reaches its peak with the increase in the radius of the NRs. Of course, it then decreases again. According to the results, the optimal size of the radius of NR rods is RNR = 40 nm to optimize the structure in different states.

Fig. 9
figure 9

Optical output power in different modes for different NRs, a state 2, b state 4

The next parameter investigated was the intensity of the input power. The use of low powers for structural simulations causes to not achieve the desired results if nonlinear effects are used. High input power is always needed to take advantage of nonlinear effects. However, using interference effects instead of nonlinear effects eliminates the need for high powers in the range of mW/µm2. According to the diagram presented in Fig. 10, increasing the input power at a step of ∆Pin=0.2 mW/µm2 causes the power received in the outputs to increase in both states 2 and 4, and the amount of 1 mW/µm2 can be considered as the optimal value due to the normalization of the input power.

Fig. 10
figure 10

Optical output power in different modes for different input optical power, a state 2, b state 4

Another parameter investigated to evaluate its effects on the performance of the structure was the wavelength (frequency). The selection of an appropriate wavelength prevents excessive scattering of light inside the structure and increases the coordination of the structure in coupling to other optical devices to provide integrated optical circuits. In this regard, the results obtained at different wavelengths were investigated at a step of ∆λ = 10 nm, which have been shown in Fig. 11. According to the results, the increase in the wavelength leads to the increase in the amount of power received at the outputs in state 2 so that it reaches its optimal value at the output O1 and then decreases again. The same results were obtained in state 4 in both outputs. According to the results of the study, the wavelength of 1550 nm can be considered as the best possible amount in this field so that the structure can operate at its best state.

Fig. 11
figure 11

Optical output power in different modes for different input wavelength, a state 2, b state 4

The proposed structure has been compared with other relevant structures in terms of CR, delay time, structural size, BR, and type of operating mechanism in Table 3. According to the table, the proposed structure leads to better results than other structures in terms of CR, delay time, and BR. In addition, the small structural size, the simplicity of design, and the use of interference effects instead of nonlinear effects cause the structure to be more flexible and have more ability to be generalized to other structures such as 8 × 3 encoder, decoders, and other logic gates to be used in optical integrated circuits. In fact, the introduction, design, and use of curved 2-branch waveguides in this field is a relatively new and unique method that minimizes the use of input power and prevents power loss in the structure. Thus, this method is suggested to be used in other relevant structures.

Table 3 Comparison of the proposed all-optical encoder with the previous structures

5 Conclusions

In this paper, an all-optical 4 × 2 encoder based on 2d-PC NRs was designed and simulated. The wave interference, the optical NRS, the linear and vertical waveguides as input, and the curved 2-branch waveguide as output were used to design the structure. The PWE method was used to determine the PBG of the structure and the FDTD method to obtain the results of the output spectrum of the structure. All simulations were performed in TM mode at the operating wavelength of 1550 nm with an input power intensity of 1 mW/µm2. The results obtained from the simulations indicate the CR of 7.88 dB, the delay time of 0.21 ps, and the BR of 4.76 Tbit/s. To investigate and optimize the effects of different parameters on the results obtained, changes were made in the size of the radius of dielectric rods and NRs and the lattice constant. In addition, the results of changes in input power intensity and wavelength were also evaluated. The proposed structure was based on silicon technology and had a small size of 149 µm2 with a symmetrical, very simple, and flexible design. The results of designing, simulating, and optimizing the proposed structure indicate the creation of a simple structure with a suitable CR, response time, and BR so that it can be used in optical integrated circuits and can be considered as a basic structure for more research in this field.