## 3 Simulation Setup and System Parameters
Thus, we modify the gain of the amplifier to achieve an XPM-induced phase shift of \(\pi\). For the lower branch of the probe, an attenuator is used to match the output power of the upper branch. When the bit-recognition result is a logic \"1\", destructive interference occurs at the multiplexer, resulting in an output of logic \"0\". Conversely, when the bit-recognition result is a logic \"0\", constructive interference occurs at the multiplexer, leading to an output of logic \"1\". Therefore, the NOT gate is completed. **Loop:** The output of the NOT gate is amplified by 4.97 dB using EDFA, and then enters the recirculating loop to complete the pattern recognition for variable target length. As the result of the first loop can be ignored, in the second loop, the initializing pulse which has an average power of 6 mW at 193.1 THz enters the subsequent AND gate with the output of the NOT gate. The AND gate operation is implemented by the FWM process within the HNLF. The output from this AND gate is then filtered using a BPF with a center frequency set at 192.5 THz. To ensure the power levels are consistent prior to entering the regenerator, an amplifier with a gain of 20.43 dB is employed. The regenerator itself also utilizes the FWM process within the HNLF to achieve frequency conversion. In the regenerator, the pump's center frequency is 192.8 THz, and it maintains an average power of 6 mW. After interacting inside the HNLF, a BPF with a center frequency of 193.1 THz is utilized to extract the frequency-converted signal. An amplifier with a gain of 20.48 dB is positioned downstream. Finally, the output from the regenerator is fed back to the input of the AND gate after a delay of \((n+1)T\). Upon completion of the second loop, the input to this AND gate is switched to the output of the regenerator via a control signal. During the parameter selection process, we first clarified the average power of the input data. Considering the signal power transmitted in optical fibers, it is justified to set the value to 0.5 mW [17]. For the input signal frequencies, we chose 192.8 THz and 193.4 THz, which are centered around 193.1 THz. As the standard WDM channel spacing is 100 GHz, by setting the frequency spacing to 300 GHz, we ensure compatibility with existing optical network equipment while meeting the spectral occupancy requirements of high-data-rate signals. Moreover, the larger spacing reduces inter-channel crosstalk and mitigates nonlinear interference. Nonlinear effects such as FWM in HNLF can introduce noise. The 300 GHz spacing ensures that FWM-generated products are away from the main signal frequencies, allowing them to be easily filtered out by BPFs with a bandwidth of 100 GHz, thereby preserving signal integrity. The input frequencies of 192.8 THz and 193.4 THz are symmetrically distributed around the local CW frequency of 193.1 THz. This symmetric configuration aims to validate the system's performance at dual frequency points and test its adaptability to tunable frequency. Through this symmetric frequency arrangement, the system's flexibility in dynamically tunable WDM networks can be effectively evaluated. Subsequently, we set the parameters of the HNLF and chose a relatively lower power of 1 mW for the local CW [18]. However, during simulations, we observed that the phase shift induced by the XPM effect in the bidirectional HNLF failed to reach \(\pi\). Therefore, we gradually increased the nonlinear coefficient to approximately 29 W\({}^{-1}\)\(\times\) km\({}^{-1}\)[19]. We found that this value ensures significant XPM effects at 100 Gbps while avoiding signal distortion caused by excessive nonlinearity. The power of the target was determinedthrough iterative optimization, ensuring that the XPM-induced phase shift reaches \(\pi\) when the left DI output is high, thereby completing signal reloading in the NOLM. Similarly, the gain of the EDFA before the input signal enters the NOLM was precisely calibrated to achieve a \(\pi\)-phase shift when the right DI output is high.