## 2 CR-SOA
### Numerical Analysis
By incorporating carrier dynamics, intraband effects, and gain suppression mechanisms, these equations enable precise modeling of CR-SOA performance in optical logic and communication applications. In this study, the quality factor (QF) is employed to evaluate the performance of the optical functions under investigation. The QF is a crucial metric for assessing the signal quality in optical systems, as it directly correlates with the bit error rate (BER) [31], a key performance indicator in communication systems. The QF quantifies the response of an optical circuit to the entire duration of the input data patterns, providing insight into its performance when the system operates under heavy stress. This is particularly useful in scenarios where the system's operation is pushed to its limits, as it helps assess potential performance degradation. The QF is defined as [11]:  
\[\frac{dh_{AR}(t)}{dt}\ =\ \frac{h_{CR}(t)-h_{AR}(t)}{\tau_{t}(1+\eta)}\ +\ \frac{\eta h_{0}}{\tau_{c}(1+\eta)}\ -\ \frac{h_{AR}(t)}{\tau_{c}}\ -\ ( exp\left[h_{AR}(t)\ +\ h_{CH}(t)\ +\ h_{SHB}(t)\right]\ -\ 1)\ \frac{P_{in,\ CR-SOA}(t)}{E_{sat}} \tag{1}\]0  
where \(\rm P_{1}\) and \(\rm P_{0}\) represent the mean peak powers of the signal at logic \"1\" and \"0\" levels, respectively, while \(\sigma_{1}\) and \(\sigma_{0}\) are the standard deviations of the noise at those levels. This definition enables a direct assessment of the signal-to-noise ratio, which is essential for determining the reliability of the system in high-speed operations. Importantly, there exists a well-established exponential relationship between the QF and the BER in optical systems, typically approximated as [11; 31]:  
\[\frac{dh_{AR}(t)}{dt}\ =\ \frac{h_{CR}(t)-h_{AR}(t)}{\tau_{t}(1+\eta)}\ +\ \frac{\eta h_{0}}{\tau_{c}(1+\eta)}\ -\ \frac{h_{AR}(t)}{\tau_{c}}\ -\ ( exp\left[h_{AR}(t)\ +\ h_{CH}(t)\ +\ h_{SHB}(t)\right]\ -\ 1)\ \frac{P_{in,\ CR-SOA}(t)}{E_{sat}} \tag{1}\]1  
This equation shows that as the QF increases, the BER decreases rapidly. For example, a QF value of 6 corresponds to a BER of approximately \(10^{-9}\), which is a standard benchmark for error-free operation in high-speed optical communication systems [15; 18; 21]. Therefore, monitoring the QF allows for an indirect yet highly effective estimation of BER and is widely used in evaluating the integrity of optical signal transmission. While several definitions of the QF exist in optical system analysis, including those based on eye diagrams or frequency-domain measures such as FWHM of resonances [32; 33], this study uses the time-domain QF definition, as it provides a direct correlation with BER and is widely applied in digital optical communication systems [34; 35; 36; 37]. To obtain accurate results, the Adams numerical method is employed in Wolfram Mathematica(r) to solve all time-dependent equations. This method is known for its efficiency in solving complex differential equations, making it an ideal approach for the detailed analysis of optical systems over time. By integrating the QF as the performance criterion and utilizing Mathematica for precise numerical analysis, this study provides a robust evaluation of the optical logic gate's functionality, addressing both the system's performance and the potential impact of noise and distortion on the overall signal integrity. The simulations use the default numerical parameters listed in Table 1[11; 12; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26], which are consistent with the previous literature on SOA- and CR-SOA-based optical logic devices. Many of these values, including carrier lifetimes, linewidth enhancement factors, saturation powers, and SOA geometrical dimensions, were selected based on experimental works and validated simulation studies[11; 12; 15; 18; 21; 22; 23; 24; 25; 26]. Notably, the pulse energy (E\({}_{0}\)), set at 0.7 pJ, lies within the typical operating range used in similar high-speed optical logic circuits[15; 16; 17].