## 4 Simulation Results and Discussion  
### Functional Verification  
In this subsection, we choose 16-bit data as the search field to evaluate the output performance of the proposed all-optical pattern recognition system at 100 Gbps. The data rate represents the relatively high transmission rate that can be achieved using the BPSK modulation format in optical networks [23; 24]. Through conducting simulations at this data rate, we can evaluate the system's adaptability to such high-speed signals. Figure 6 presents the simulation results of recognizing 4-bit bit-flip BPSK targets in the input data using the proposed system at frequencies of 192.8 THz and 193.4 THz. When the frequency of the input data is 192.8 THz, as shown in Figure 6a, the phase of the input BPSK data is \(\{\pi,0,\,\pi,0,\,\pi,\,\pi,0,\,0,0,\,\pi,0,\,0,\,\pi,\,\pi\}\), while the 4-bit bit-flip BPSK targets are \(\{\pi,0,\,\pi,\,\pi\}\) and \(\{0,\,\pi,\,0,\,0\}\). As the simulation result of the first loop is ignored, we observe the result from the second loop. The output of the second loop is \(\{0,\,1,\,1,\,1,\,0,\,1,\,0,\,0,\,1,\,1,\,1,\,0,\,1,\,0\}\), which indicates all occurrences of \(\{\pi,0\}\) and \(\{0,\,\pi\}\) in the data. The output of the third loop is \(\{0,\,0,\,1,\,1,\,1,\,0,\,0,\,0,\,0,\,1,\,1,\,1,\,0,\,0,0\}\), which indicates all occurrences of \(\{\pi,0,\,\pi\}\) and \(\{0,\,\pi,\,0\}\) in the data. The output of the fourth loop is \(\{0,\,0,\,0,\,0,\,1,\,0,\,0,\,0,\,0,\,0,\,0,\,1,\,0,\,0\}\), which clearly shows the number and position of the bit-flip BPSK targets \(\{\pi,0,\,\pi,\pi\}\) and \(\{0,\,\pi,\,0,\,0\}\) in the data. Results demonstrate that two targets are hidden in the data, and their last bits are the sixth bit and the fourteenth bit of the input data, respectively. Figure 6b shows the simulation results of recognizing 4-bit bit-flip BPSK targets \(\{\pi,\,\pi,\,\pi,\,\pi\}\) and \(\{0,\,0,\,0\}\) in the input data \(\{0,\,0,\,0,\,\pi,\,\pi,\,\pi,\,\pi,\,0,\,\pi,\,\pi,\,0,\,0,\,0,\,\pi\}\) using the proposed system at a frequency of 193.4 THz. We find that the system can still accurately recognize 4-bit bit-flip BPSK targets when the frequency of the input data is 193.4 THz. Figure 7 shows the simulation results of recognizing 8-bit bit-flip BPSK targets in the input data using the proposed system at frequencies of 192.8 THz and 193.4 THz. In Figure 7a where the input frequency is 192.8 THz, the input data are the same as that in Figure 6a, and the 8-bit bit-flip BPSK targets are \(\{\pi,0,\,\pi,\,0,\,\pi,\,0,\,0\}\) and \(\{0,\,\pi,\,0,\pi,\,0,\,0,\,\pi,\,\pi\}\). Similarly, we can observe that the output of the second loop is \(\{0,\,1,\,1,\,1,\,0,\,1,\,0,\,0,\,1,\,1,\,1,\,0,\,1,\,1,\,0,\,1,\,0\}\), which indicates all occurrences of \(\{\pi,0\}\) and \(\{0,\,\pi\}\) in the data. the data. Figure 7b presents the simulation results of recognizing 8-bit bit-flip BPSK targets {0, 0, 0, \(\pi\), \(\pi\), \(\pi\), \(\pi\), \(\pi\), \(\pi\), 0} and {\(\pi\), \(\pi\), \(\pi\), 0, 0, 0, 0, \(\pi\)} in the input data using the proposed system at a frequency of 193.4 THz. Consequently, all the simulation results demonstrate that the proposed all-optical pattern recognition system can accurately determine the number and position of the bit-flip BPSK targets in the input data with tunable frequencies of 192.8 THz and 193.4 THz when the transmission rate is 100 Gbps. Notably, our proposed system can also achieve accurate recognition of longer targets in longer input data. The system was also tested to recognize longer targets in longer input data, and no obvious signal degradation was observed in the output results. A longer input data sequence can provide more recognition opportunities, but it also takes more time. Consequently, to recognize the bit-flip BPSK targets, we choose targets of different lengths (4-bit and 8-bit) and recognize them in 16-bit input data to evaluate the system's performance.