## 1 Introduction
The decision to use behavioural-level HDL code instead of gate-level code for evolving this MSD is based on the recommendation for complex circuits [18] and its ability to evolve complex designs from the abstract level. Behavioural-level code is more straightforward to interpret [19] yet more challenging to evolve [20] due to its complex structures, such as _if-else_ conditions and _for_ loops. MSDs are specialised sequential circuits that detect specific binary sequences, making them crucial in applications where sequence detection is critical, such as avionics and control systems. GE's use in evolving these circuits allows for the automatic generation of HDL solutions, particularly at the behavioural level. Due to its complex structures, HDL code is easier to interpret but more challenging to evolve. This study demonstrates the practical application of this approach through a case study involving a vending machine, which requires effective state management for tasks like product selection and payment processing. While the specific application in this paper is that of vending machines, the technique can be applied to any MSD, such as those commonly found in traffic light control systems [21], elevator control systems [22], robot navigation systems [23], and TCP/IP communication protocols [24]. By evolving the HDL code for a Mealy FSM-based Gold MSD, which acts as a benchmark circuit, the research compares different parent selection techniques and verifies the synthesisability of the evolved designs. A Mealy machine is a type of FSM where the output depends on both the current state and the current input (detail in Section 2). This work contributes to the field by exploring well-established methods for automatic circuit design in the context of evolving complex sequential circuits, such as MSD, using behavioural-level HDL. The main contributions of this work are summarised as follows:  
* We propose a GE-based approach to evolve SV code for solution circuits representing the FSM of a single-input, multi-output MSD, mapped to a real-life vending machine. * We provide a theoretical analysis showing that prior work focuses only on single-input, single-output, single-sequence detectors, and no existing work addresses the evolution of FSMs of this complexity. * We conduct extensive experiments demonstrating that GE combined with LS and TS can effectively generate solution circuits for such real-world problems. However, LS performs better than TS in terms of time and computational resources. * Although GE, LS, and TS are well-established techniques, the novelty of this work is reflected by putting them all together to evolve the solution circuits of real-life complex FSMs. * We show that the evolved solution circuits are synthesisable, and their synthesis reports outperform those of manually designed circuits. The organisation of this paper is as follows: Section 2 gives a detailed background on all the technical aspects used. Section 3 provides a literature survey on the evolution of digital circuits. Section 4 introduces GE and details the parent selection techniques employed in this study. Section 5 describes the process of generating training and test datasets necessary for the proposed work. Section 6 presents the experiments and results. Section 7 shows one of the perfectly evolved FSMs and compares it with a human-made FSM. Section 8 shows and compares the synthesis of the Gold and evolved solutions, highlighting the performance differences between human-designed and machine-generated solutions. Finally, Section 9 concludes the paper and discusses future directions in this field of research.