## 2 Background
They play crucial roles in real-time critical systems, such as avionics, where detecting a series of events in the correct order is essential. These systems must be highly responsive, meticulously designed, and thoroughly tested under all possible conditions to ensure they do not fail to generate necessary alarms. This work proposes evolving behavioural-level HDL code using GE for a single-input, multi-output MSD. MSD is crucial in designing complex systems that require multiple states and transitions based on varying inputs. They are used in various applications where state management is critical, such as digital systems, embedded systems, and communication protocols. Speaking of their real-world applications, MSDs are fundamental in designing control systems for machinery, robotics, and other automated processes. Their ability to manage multiple states and transitions makes them suitable for real-time systems where efficient state management is crucial. We apply this work to a real-life vending machine scenario, which provides a concrete example of how MSDs can be applied in real-world systems. Vending machines involve state management for product selection, payment processing, and item dispensing, making them an ideal test case for MSD designs. Moreover, the vending machine example highlights the complexity involved in real-world applications. It shows how MSDs can handle various states and transitions required to process inputs and provide outputs, demonstrating the practical value of evolving synthesisable HDL codes for such systems. The Mealy FSM for the Gold MSD, representing a human-designed target circuit, is shown in Figure 1. \"Gold\" refers to the benchmark circuit the evolutionary system aims to achieve. This MSD can identify two distinct sequences, process a single 1-bit input, and produce two 1-bit outputs each clock cycle. The system starts at state S0 after a reset or upon waking from its idle state. The customer can choose between water and a carbonated drink. If the customer selects water (binary input '0'), the machine transitions to state S1 (labelled 'W'). Conversely, if the carbonated drink is selected (binary input '1'), the system moves to state S2 (labelled 'F'). After this selection, the system waits for payment. If the payment is incomplete within a specified time, the product is not dispensed, and the system resets to S0. We are assuming that the water costs EUR 1, while the carbonated drink costs EUR 1.50, with the system accepting only EUR 0.50 (binary input '0') and EUR 1 (binary input '1') coins. In state S1, if the system receives EUR 1, it returns to S0, and the first output (leftmost) turns '1', indicating full payment and dispensing the water. However, if only EUR 0.50 is received, the system transitions to S3, keeping both outputs at '0' to indicate that additional payment is required. If another EUR 0.50 is received at S3, the system returns to S0, setting the first output to '1' to confirm full payment. If EUR 1 is received at S3, the system resets to S0 but also sets the rightmost output to '1', indicating that EUR 0.50 must be returned to the customer. For S2, the system transitions through states S4 and S5, eventually returning to S0 if three consecutive EUR 0.50 coins are inserted. If a EUR 1 coin is inserted at any point, the system bypasses certain states and returns to S0, providing appropriate outputs for payment processing and correct change. Note that in any given transaction, the maximum return possible is EUR 0.50. As discussed above and shown in Figure 1, from any stage, there are two possible transitions: one dependent on input '1' and the other on input '0'. If, at any stage, the system does not receive any input--neither '1' nor '0'--it remains in the same state and outputs '0' for both product delivery and return change.