Simultaneous all-optical 1's complement cum division-by-two schemes

Odd and even number detection is an important mathematical operation. Generally when any number is divisible by 2 then it is called an even number, otherwise, it is an odd number. Division by 2 can be easily obtained by putting a point before the least significant bit of any binary number. As an example a number (27)10 = (11011)2 when divided by 2 its result will be (1101.1)2 = (13.5)10. Hence when we find the fractional bit as logic-1 we can say that the number is odd, otherwise, it is even. This operation can be obtained by using a demultiplexer. Here we have developed an optical circuit that can divide any binary integer number by 2, apart from that its 1’s complement can also be obtained from the circuit. Both of the results can be obtained simultaneously. Terahertz optical asymmetric demultiplexer based switch plays a very important role to design this n-bit circuit. Numerical simulations are done to find the performance of the circuit.


Introduction
Optics shows the potential option of electronic calculation as of late (Raffaelli et al. 2008). Optical signal processing interferometric switches to construct the upset. Among different switches, Terahertz optical asymmetric demultiplexer (TOAD) is a single-arm interferometer. TOAD is capable of dealing with information processing about 1 Tb/s (Sokoloff et al. 1993;Zoiros et al. 2005;Gayen et al. 2011;Sharma and Roy 2021;Mukherjee et al. 2021). This switch has a quick response time, low power consumption, low latency, and noise. Again this switch has very high nonlinear properties with thermally stable utilized in correspondence thoroughly (Sokoloff et al. 1993;Zoiros et al. 2005;Gayen et al. 2011 The multipliers which are utilizing two diverse plan arrangements that come within reach have been designed by Sharma and Roy (2021). Maji et al. (2019) have designed all-optical frequency-encoded AND, OR, and NOT logic gates and their performance is simulated to confirm their feasibility with a control pulse energy as 50 fJ. Huo et al. (2020) proposed a reconfigurable photonic filter based on TOAD based switch with a switching rise/fall time of 3.4/3 ns.  have proposed a dual control TOAD based 2's complement method. In their other paper, they have also suggested binary to gray and gray to binary code bit conversion using dual control TOAD-based switches ).
Here we have proposed a plan of n-bit binary division-by-2 circuit using TOAD. Generally when any binary number is divided by 2 one fractional bit appears. If the number is odd, the fractional bit is logic-'1' otherwise it is logic-'0'. By dividing different numbers by 2 we see that results can be easily obtained by putting a point before the least significant integer bit of any binary number. As an example, if we divide a binary number (11011101) 2 by 2, the result will be (1101110.1) 2 . To perform these operations, we have used TOAD based interferometric switch. This all-optical circuit can perform division-by-2 and also its 1's complement simultaneously.

Theoretical operation of the switch
TOAD could be a single-arm interferometer. It utilizes an SOA that is put unevenly situated in a fiber loop. The optical coupler (50:50) is used to join the two ends of fiber to form a loop. Here we denote the incoming signal as IS from a continuous signal of wavelength λ 1 (generally it is of 1500 nm and applied to port ① as shown in Fig. 1), which divides into two equal parts. One is a counter-clockwise signal and the other is a clockwise signal. These two signals traverse around the fiber loop in opposite direction and recombine at the input coupler. Depending upon the phase difference between clockwise and counter-clockwise signals, constructive or destructive interference occurs. This phase difference can be generated by inserting a control pulse (CP) of wavelength λ 2 (generally 1550 nm of wavelength) from another coupler attached in the fiber loop (marked as port ② in Fig. 1). This signal passes through a Ti:LiNbO 3 electro-optic modulator driven by an NRZ pulse generator. After that, it is amplified by an erbium-doped fiber amplifier (EDFA) followed by variable optical attenuator (VOA). At every stage polarization of the intense pulse can be controlled by a polarization  Fig. 1a. Control pulse with full-width half maximum (FWHM) = and incoming signal are applied at the nearly same time. A semiconductor optical amplifier is placed asymmetrically in the fiber loop. The asymmetric distance is Δx = T ex 2 ( T ex is the eccentricity time). Due to this asymmetry clockwise and counter-clockwise signals propagate through the semiconductor optical amplifier at different times. If the gain of the semiconductor optical amplifier (SOA) changes or not during this timing difference a phase difference between the clockwise and counter-clockwise signals passing the SOA is or is not created, respectively. As a result, destructive or constructive interference occurs at the input coupler. The power at the upper (marked by ③ in Fig. 1) and lower (marked by ④ in Fig. 1) ports can be expressed as (Zoiros et al. 2005;Gayen et al. 2011;Minh et al. 2008), where C(t) and C � (t) measure the SOA gain for clockwise and counter clockwise signal respectively. The clockwise and counter clockwise signals create a phase difference ∆θ, which is numerically calculated as (Bhattachryya et al. 2013;Chattopadhyay 2010;Gayen et al. 2014;Eiselt et al. 1995;Zoiros et al. 2006), Here line-width enhanced factor is . Here we consider that SOA is wavelength-independent and its unsaturated gain G U is (Chattopadhyay 2010) where g d = differential gain, Γ = confinement factor, L = active length of SOA, N c = carrier density at transparency, I = biasing current of SOA, r = gain recovery time of SOA, e = charge of electron, = width of active region of SOA, l = depth of active region of SOA, Υ = SOA internal loss per unit length. When CP is OFF i.e., the control pulse is absent, the clockwise and counter -clockwise parts of the incoming signal will enter an unchanged SOA at different times. Consequently, both signal parts will experience the same unsaturated small SOA gain G U . As a result, for both recombining signals at the coupler C(t) nearly equals to C � (t) and therefore Δ is almost equal to 0. The expression for P Upper is then nearly equal to zero (0), P Lower is equal to P IS (t)× G U , and the resulting combined signal becomes a returning pulse that exits the coupler toward the CW@ λ 1 source. At this point, this returned pulse is redirected by an optical circulator (OC) to exit the TOAD port ④. When a control pulse is injected into fiber loop, after the time t s it penetrates SOA and alters its gain as (Bhattachryya et al. 2013;Chattopadhyay 2010), E cp (t) is control pulse energy and E sat is saturation energy.
When CP is injected into the fibre loop then the gain of SOA decreases rapidly as G � (t) = e f (t) and f (t) can be determined by the ordinary differential equation as (Chattopadhyay 2010), Then, Δ is nearly equal to-π then the incoming signal exit from the upper port is equal to P Upper (t) and P Lower (t) is nearly equal to zero (0), the corresponding values of P Upper (t) and P Lower (t) can be obtained from the Eqs. (1) and (2), respectively. When a control pulse is applied, in a short period of time the gain of SOA recovers due to carrier insertion into SOA by gain recovery time r . The energy of the incoming signal is about one-tenth time less than that of the control pulse. So that only CP alters the gain of SOA. An optical tuneable band pass filter (OTBPF) is placed at the output of TOAD to reject the CP and pass the IS. This filter is tuned such that it blocks the wavelength of light 1550 nm and passes the other. It also suppresses the amplified spontaneous emission (ASE) noise generated in SOA (Matsuura et al. 2008). The block diagram of a TOAD is shown in Fig. 1b. For optimum performance of TOAD-based interferometric switch, it must follow the relation:

Division-by-2 cum 1's complement
In the above section, we have noticed, when CP is applied to TOAD, then IS (of wavelength λ 1 ) is transmitted to the upper port. At that time, no signal is found at the lower port. Also when CP is absent, the IS is reflected to the lower port and no signal is exposed to the upper port. We can plan n-bit division-by-2 circuit utilizing n-numbers of TOADs (T 0 , T 1 , … and T n-1 ) that is shown in Fig. 2. In this paper, we have utilized all the output ports (upper and lower ports) of all TOADs. (A n-1 A n-2 …A 1 A 0 ) 2 are n-bit inputs of wavelength λ 2 are applied to every TOAD as CPs according to Fig. 2. Upper ports of all TOADs arrangement forms division-by-2 output as (D n-2 D n-3 …D 1 D 0 D -1 ) 2 , where D -1 is the fractional part. Likewise (C n-1 C n-2 …C 1 C 0 ) 2 is the 1's complement, which is taken from lower ports of all TOADs [as for 1's complement conversion only NOT operation is required (Bhattacharyya et al. 2017)].
The operation of the proposed circuit can be explained on this example: Let us consider, we have 4-bit digital input data representing a binary number (A 3 A 2 A 1 A 0 ) 2 = (1011) 2 . Now our task is to convert this input data to its equivalent 1's complement and furthermore divide it by 2. These inputs (1011) are given as CP to four TOADs (i.e. CP = 1 for TOAD T 0 as A 0 = 1, CP = 1 for TOAD T 1 as A 1 = 1, CP = 0 for TOAD T 2 as A 2 = 0 and CP = 1 for TOAD T 3 as A 3 = 1). Then according to the theoretical operation of TOAD in Sect. 2, incoming signal (IS) of TOADs T 0 , T 1 and T 3 are sent to the upper port only and TOAD T 2 , 'IS' reaches to the lower port only. Henceforth we obtain the outputs (D 2 D 1 D 0 D -1 ) 2 = (101.1) 2 and (C 3 C 2 C 1 C 0 ) 2 = (0100) 2 , which are the division-by-2 and 1's complement of the input digital data (1011) 2 respectively.

Results and discussion
Numerical simulation with MATLAB has been carried out using different parameters used in simulations and experiments of various papers (Zoiros et al. 2004(Zoiros et al. , 2006(Zoiros et al. , 2008. The estimations of the different parameters are utilized in this simulation are as per the following: I = 400 mA, Γ = 0.48, g d = 3.3 × 10 −20 m 2 , N c = 1.0 × 10 24 m −3 , = 1.5 m , l = 250 nm , L = 1500 m , Υ = 2700 m −1 , unsaturated amplifier gain of the SOA (G U ) = 30 dB, gain recovery time of the SOA (τ r ) = 50 ps, saturation energy of the SOA (E sat ) = 1000 fJ, eccentricity of the loop (T ex ) = 15 ps, line-width enhancement factor (α) = 6, bit period (T C ) = 50 ps, and a control pulse energy (E cp ) = 100 fJ. We have done simulation for six sets of digital 8-bit binary input data (00011110, 10101011, 11100110, 10111110, 00110001, and 11010101). The input and output waveforms are given in Fig. 3a-f. Parallel digital input (A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0 ) 2 is given to the circuit as CP of the TOADs T 7 -T 0 individually as described in Fig. 2. Simultaneous outputs are obtained at the output ports parallel manner. Hence the upper outputs (D 6 D 5 D 4 D 3 D 2 D 1 D 0 D -1 ) 2 check consequences of division-by-2 furthermore, lower outputs (C 7 C 6 C 5 C 4 C 3 C 2 C 1 C 0 ) 2 check the 1's complement operation for the given input digital data. We also plot the gain variation with the used six sets of 8-bit input data for 8-TOAD based interferometric switches as shown in Fig. 4.   Fig. 2 All-optical division-by-2 cum 1's complement conversion circuit using TOAD. (A n-1 A n-2 … A 1 A 0 ) 2 is input number applied to CP of each TOAD, divisionby-2 output is (D n-2 D n-3 … D 0 D -1 ) 2 , where D -1 is fractional bit, (C n-1 C n-2 …C 1 C 0 ) 2 is 1's complement output To quantify our design different parameters like extension ratio (ER), contrast ratio (CR), amplitude modulation (AM) and Q-factor have been studied. We figure the extinction ratio (ER) as (Gayen et al. 2014), where, P 0 max and P 1 min is the maximum and minimum peak power of the '0' and '1' states respectively. For better performance, ER ought to be 8.5 dB. ER value tells that '1' states can be clearly recognized from the '0' states.
The performance of the circuit depends on SOA gain recovery and energy of CP. The effect of the gain recovery time and the energy of CP on the ER is explained in Fig. 5. It is observed that ER increases when control pulse energy and gain recovery time increase up to 12 dB. After that ER reduces again. It is likewise seen from Fig. 5, longer the gain recovery time and the energy of CP decreases the ER. This is justified by the gain dynamic response of SOA. The saturation energy decreases with decreasing gain recovery time for fixed saturation power. That is the reason less energy is needed to saturate the SOA.
A primary parameter that influences the performance of the circuit is that the width of the optical pulse. Figure 6 shows the impact of the gain recovery time and width of the input data pulse on the ER. It clarifies that the ER reduces with reducing the width of the pulse and gain recovery time. This occurs because of fixed asymmetry and the SOA needs more time to recover its gain to provide the required phase change of -π. The ER becomes steady once some specified value of gain recovery time and width of the input data pulse. A specific ER will be attained with less energy for a short width of the input data pulse. Now we investigate the contrast ratio (CR) of the circuit. It should be high as possible for optimum TOAD-based switching performance so that a large fraction of data is transmitted to the targeted output port of the switch than the non-targeted port. It is chosen as another improvement criteria, expressed as a correlation of the power used in sending a logic level 'one' to the power used in sending logic 'zero'. This could be represented as the ratio of least output peak power of '1' to the most extreme output peak power of '0' in dB (decibel), defined as (Zoiros et al. 2006) where, P 0 mean and P 1 mean is the mean value of the output peak power of '0' and '1', respectively. We estimate the CR (in dB) from Eq. (7) and it gets 15.62 dB. The significant issue that affects the performance of the circuit is that the width of the optical pulse. Figure 7 shows the variation of CR on the width of the optical pulse and gain recovery time. The estimation of CR is about 15.62 dB for the specified small-signal gain approximately (6) ER(in dB) = 10 log P 1 min P 0 max (7) CR(in dB) = 10 log P 1 mean P 0 mean Fig. 3 Simulated input and output waveforms. (A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0 ) 2 is 8-bit input digital data, (D 6 D 5 D 4 D 3 D 2 D 1 D 0 D -1 ) 2 is division-by-2 output, (C 7 C 6 C 5 C 4 C 3 C 2 C 1 C 0 ) 2 is 1's complement output. The data sets are a input = (00011110) 2 , division-by-2 output = (0001111.0) 2 and 1's complement output = (11100001) 2 , b input = (10101011) 2 , division-by-2 output = (1010101.1) 2 and 1's complement output = (01010100) 2 , c input = (11100110) 2 , division-by-2 output = (1110011.0) 2 and 1's complement output = (00011001) 2 , d input = (10111110) 2 , division-by-2 output = (1011111.0) 2 and 1's complement output = (01000001) 2 , e input = (00110001) 2 , division-by-2 output = (0011000.1) 2 and 1's complement output = (11001110) 2 , f input = (11010101) 2 , division-by-2 output = (1101010.1) 2 and 1's complement output = (00101010)  Henceforth an exact CR achieves with less energy for a short width of the optical pulse. This occurs because a short width of the optical pulse goes quickly through the SOA which enhances the fast depletion of carriers. Hence a steeper transition occurs from the lower to the higher value of saturated gain. So we cautiously select the gain recovery time and width of the optical pulse with the goal that the circuit execution is better. We define amplitude modulation (AM) as (Zoiros et al. 2006)  where, P 1 min and P 1 max are the minimum and maximum output peak power of the '1' states, respectively. Figure 8 shows the variation of AM with different gain recovery times and energy of CP. The AM is tremendously vulnerable to the varieties of gain recovery time. Although, defined care is taken so that gain recovery time must be some precise limit (as low as possible) otherwise pattern effects happen at the output of the circuit.
Q-factor is another performing estimating component of the optical circuit. The Q-factor can be expressed as (Zoiros et al. 2008), where, σ 1 std and σ 0 std are the standard deviations of the output peak power of the '1' states and '0'states, respectively. Figure 9 illustrates the variety of the Q-factor on the energy of CP with different pulse widths. From this figure, we see that the Q-factor increases with increasing the width of the pulse since it requires considerably more time to transit SOA by the control pulse. From Figs. 5-9 and their clarifications, we select estimations of the different parameters as T ex = 15 ps, G ss = 20 dB, α = 6, τ e = 50 ps, E sat = 1000fJ and E cp = 100 fJ, which isn't fixed and stays within the specified limits. At that point utilizing these qualities all through the simulation, we can get ER = 11.51 dB, CR = 15.62 dB, AM = 0.05 dB, and Q = 8.13 at the outputs. To plan the n-bit circuit, we require n-numbers of TOADs with n-inputs. The circuit has 2n-numbers of outputs, among them n-output bits address 1's complement results (C n-1 to C 0 ) and (n-1) bit represents the integer bits (D n-2 to D 0 ) of the division-by-2 output and 1-bit (D -1 ) for a fractional bit.

Conclusion
We have proposed and shown by numerical simulations an all-optical division by 2 and 1's complement operation simultaneously at 20-Gbit/s utilizing TOADs. The circuit is planned theoretically and verified through numerical simulation. Here, by conducting numerical simulation study precise the necessities for the control pulse energy, gain recovery time and width of input pulse with the goal that the extinction ratio, contrast ratio, amplitude modulation, and Q-factor is acceptable. In this proposed design, the extinction ratio is about 11.51 dB, the contrast ratio is about 15.62 dB, amplitude modulation is about 0.05 dB, and Q-factor is 8.13 at the outputs. The benefit of the design is all-optical and can be extended out to n-bit without any problem.