## 1 Introduction  
In the ever-evolving landscape of information processing and communication technologies, the demand for faster, more efficient, and secure data handling methods has led researchers to explore novel paradigms. The marriage of optics and electronics has been a driving force in meeting these challenges, offering solutions that exploit the unique properties of light for information manipulation. Among these cutting-edge developments, the focus on all-optical processing has gained prominence for its potential to revolutionize data processing speed and energy efficiency [1; 2]. Existing research in optical data processing has made significant strides, yet several challenges remain. Traditional electronic methods, although well-established, face limitations in terms of speed, energy consumption, and electromagnetic interference. These limitations are becoming increasingly problematic as data rates and processing demands continue to escalate. Moreover, current optical solutions often rely on hybrid systems that integrate both optical and electronic components, which can introduce latency and inefficiencies. One major shortcoming of existing optical data processing technologies is their reliance on complex and energy-intensive electronic components for error detection and correction mechanisms. These hybrid systems can suffer from bottlenecks due to the slower electronic processing speeds, negating some of the speed advantages inherent to optical technologies. Additionally, many current optical systems lack the robustness required for large-scale implementation, particularly in environments demanding real-time processing and high data integrity. Several studies have already explored the use of all-optical techniques for parity generation and checking, which are fundamental aspects of error detection and correction in digital data transmission [3; 4; 5; 6]. These works have laid the groundwork by demonstrating various optical logic gates and error-checking mechanisms. For instance, [PERSON] et al. [3] introduced an all-optical non-inverted parity generator and checker based on semiconductor optical amplifiers (SOAs), showcasing the potential for such devices to handle high-speed data processing. [PERSON] et al. [4] designed an ultrafast all-optical 4-bit parity generator and checker using a quantum-dot (QD) SOA-based Mach-Zehnder interferometer (MZI), pushing the boundaries of speed and efficiency in optical computing. [PERSON] et al. [5] developed a reflective SOA (RSOA)-based all-optical parity generator and checker, further expanding the toolkit of optical data processing devices. [PERSON] et al. [6] conducted a performance analysis of a lithium niobate waveguide-based serial parity generator and checker, illustrating the versatility of different photonic materials in achieving high-performance optical circuits. In response to these challenges and building upon the foundation laid by previous research, this paper introduces a groundbreaking approach to information processing through the design and implementation of an all-optical 4-bit parity generator and checker. The key innovation of this paper lies in the utilization of carrier reservoir semiconductor optical amplifier (CR-SOA)-based MZI to perform these operations entirely in the optical domain. This marks a significant departure from conventional electronic methods. CR-SOAs present a promising platform for achieving ultrafast, parallel, and all-optical computation due to their unique carrier reservoir dynamics [7; 8; 9]. On the other hand, the MZI's advantages lie in its ability to perform all-optical signal processing, high sensitivity, interference control, versatility, compact design, low power consumption, capability for phase modulation and demodulation, and overall stability in various applications [10; 11]. By leveraging the inherent advantages of CR-SOA-based MZI, our proposed system eliminates the need for cumbersome and energy-intensive electronic components, thus significantly enhancing processing speed and energy efficiency.