Optimizing FPGA implementation of high-precision chaotic systems for improved performance
Optimizing FPGA implementation of high-precision chaotic systems for improved performance
Damaj, Issam;Zaher, Ashraf;Lawand, Wafic
2024-04-09 00:00:00
a1111111111 a1111111111 Developing chaotic systems-on-a-chip is gaining much attention due to its great potential in a1111111111 securing communication, encrypting data, generating random numbers, and more. The digi- a1111111111 tal implementation of chaotic systems strives to achieve high performance in terms of time, a1111111111 speed, complexity, and precision. In this paper, the focus is on developing high-speed Field Programmable Gate Array (FPGA) cores for chaotic systems, exemplified by the Lorenz system. The developed cores correspond to numerical integration techniques that can extend to the equations of the sixth order and at high precision. The investigation comprises OPENACCESS a thorough analysis and evaluation of the developed cores according to the algorithm com- Citation: Damaj I, Zaher A, Lawand W (2024) plexity and the achieved precision, hardware area, throughput, power consumption, and Optimizing FPGA implementation of high-precision maximum operational frequency. Validations are done through simulations and careful com- chaotic systems for improved performance. PLoS ONE 19(4): e0299021. https://doi.org/10.1371/ parisons with outstanding closely related work from the recent literature. The results affirm journal.pone.0299021 the successful creation of highly efficient sixth-order Lorenz discretizations, achieving a high Editor: Muhammad Bilal, King Abdulaziz University throughput of 3.39 Gbps with a precision of 16 bits. Additionally, an outstanding throughput Faculty of Engineering, SAUDI ARABIA of 21.17 Gbps was achieved for the first-order implementation coupled with a high precision Received: September 24, 2023 of 64 bits. These outcomes set our work as a benchmark for high-performance characteris- tics, surpassing similar investigations reported in the literature. Accepted: February 3, 2024 Published: April 9, 2024 Copyright:© 2024 Damaj et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which 1 Introduction permits unrestricted use, distribution, and reproduction in any medium, provided the original Many chaotic systems, along with their applications in Chaos-Based Secure Communication author and source are credited. (CBSC), data encryption, and True Random Number Generation (TRNG) are implemented Data Availability Statement: All relevant data are using a wide variety of embedded systems, such as Arduino, Application-Specific Integrated within the manuscript. Circuits (ASICs), Digital Signal Processors (DSPs), and Field Programmable Gate Arrays Funding: The author(s) received no specific (FPGAs) [1–3]. Until recently, and before the rabid advances of digital technology, analogue funding for this work. implementations of continuous-time chaotic, or hyperchaotic, systems were the default. A combination of Op-Amps, resistors, capacitors and analogue multipliers were used to con- Competing interests: The authors have declared that no competing interests exist. struct such implementations. The Ordinary Differential Equations (ODEs), which are used to PLOS ONE | https://doi.org/10.1371/journal.pone.0299021 April 9, 2024 1 / 29 PLOS ONE Optimizing FPGA implementation of high-precision chaotic systems describe the dynamics of chaos, for both autonomous and nonautonomous systems, were directly mapped to active RC circuits to generate the states of the system. A typical example, describing the Lorenz system, is illustrated in Fig 1 (see Eq 9) in Section 1). Other examples for analogue implementations could be found in [4–8]. The analogue multiplier AD633 was used to implement the nonlinear part of the Lorenz equation (see Eq (1) in Section 1), along with other chaotic systems of similar structure. As shown in Fig 2, grounding terminals 2, 4, and 6 can effectively produce the product function, with high accuracy. The Lorenz system was explored in [4, 5], where both the LF353 Op-Amp and the AD633 analogue multiplier were used to perform the required algebraic/calculus-based mathematical operations to implement its dynamics. Adjusting the values of the resistors and the capacitors were used to arrive at the required dominant time constants of the circuit, which could be made as small as a few microseconds, without any noticeable degradation in the performance. Other autonomous chaotic systems, such as the Ro ¨ssler and Chua circuits, were also Fig 1. Electronic analogue implementation of the Lorenz system. https://doi.org/10.1371/journal.pone.0299021.g001 PLOS ONE | https://doi.org/10.1371/journal.pone.0299021 April 9, 2024 2 / 29 PLOS ONE Optimizing FPGA implementation of high-precision chaotic systems Fig 2. Typical configuration of the AD633 IC, acting as a multiplier. https://doi.org/10.1371/journal.pone.0299021.g002 considered in [4–6] that covered applications in chaos control, state observers, parameter identification, and synchronization of chaotic systems. Similar analogue implementations to other chaotic systems that include infinitely many equilibria and fractional-order dynamics without equilibrium were also covered in [7, 8]. Challenges to digital implementations of chaotic systems, including Lorenz, include the performance aspects of time, speed, complexity, precision, and dealing with the intrinsic sequential behaviour of the model. As related to chaotic systems, the following research oppor- tunities are highlighted: • The attraction of reconfigurability of FPGAs in implementing chaotic systems with effective applications in synchronization, control, and communication. • The development of hardware implementations of chaotic algorithms under FPGAs with appealing performance characteristics that outperform similar implementations reported in the literature. • The embedding of Lorenz hardware cores to assist or replace traditional computing systems, such as central processing units, in applications. • The emergence of hybrid analogue and digital chaotic system implementations. • The exploration of implementations with various accuracy levels, speeds, and complexities. • The creation of development and analysis patterns that are applicable in the wider area of chaotic systems, such as autonomous and non-autonomous systems to cover both chaotic and hyperchaotic systems. In this paper, we present high-speed hardware implementations of chaotic systems, namely the Lorenz system. The presented implementations target traditional and high precision including 8, 16, 32, and 64 bits floating point number representations. The proposed hardware cores implement different numerical integration (discretization) techniques that extend to equations of the sixth order. Furthermore, the implementation challenge is extended to include experimenting with different floating-point data types to arrive at the best compromise among complexity, precision, area, and speed. The rest of this paper is organized so that Section 2 presents related work. Section 3 presents the motivation and research objectives. In Section 4, the adopted hardware development meth- odology and the created cores are presented. Section 5 presents the achieved results and a PLOS ONE | https://doi.org/10.1371/journal.pone.0299021 April 9, 2024 3 / 29 PLOS ONE Optimizing FPGA implementation of high-precision chaotic systems thorough evaluation that includes comparisons with closely-related work. In addition, Section 5 presents the design and implementation limitations of the proposed cores and sets the ground for future work. In Section 6, the investigation is concluded by highlighting important achievements and presenting work in progress. 2 Related work 2.1 Background When dealing with chaotic systems, several benchmark models exist that can be used for veri- fying newly proposed techniques, either for control, synchronization, synthesis, or implemen- tation [9]. The Lorenz system is the most famous example that represents the autonomous category of chaotic systems; it has many different forms, including a hyperchaotic model. It was originally discovered when analyzing weather patterns that exhibit very strong depen- dence on initial conditions [10]; however, other applications in engineering and physics were found to exhibit quite similar behaviour. This includes permanent magnet synchronous machines (PMSMs) [11], single mode optical lasers [12], and thermal convection [13]. The mathematical model of the 3D chaotic Lorenz system is given by Eq 1. x _ ¼ sðx yÞ y _ ¼ rx y xz ð1Þ z _ ¼ xy bz where x, y, and z are the three dynamic states of the system, and σ, ρ, andβ are three positive constants. Along with the origin, this system has the two additional equilibrium points of Eq 2. pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ½x y z � ¼ ½� bðr 1Þ � bðr 1Þ ðr 1Þ� ð2Þ eq eq eq which might be stable or unstable, depending on the values of the parameters, as can be deduced by evaluating the eigenvalues of the Jacobian matrix in Eq 3, at the equilibrium points: 2 3 s s 0 6 7 6 7 r z 1 x J ¼ ð3Þ 6 7 eq eq 4 5 y x b eq eq For generating chaos, the parameters might take the values, 10, 28, and 8/3, respectively [9]. The most important characteristics of the Lorenz system are that each dynamic equation con- tains a single parameter and that chaos is generated by only two quadratic terms; namely, xy and xz. In addition, it is invariant under the transformation (x, y)! (−x, −y). Eq 1 is known to have (0.90563, 0, −14.57219), as Lyapunov exponents, and a DKY of 2.06215, representing the Kaplan-Yorke dimension [14]. Moreover, The Lorenz system is dissipative, as illustrated in Eq 4: @x _ @y _ @z _ þ þ ¼ trðJÞ ¼ s 1 b ¼ 13:667 < 0 ð4Þ @x @y @z When investigating the time evolution of Eq 1, starting from x(0) = 1.0, y(0) = z(0) = 0, the response, illustrated in Fig 3, is observed. PLOS ONE | https://doi.org/10.1371/journal.pone.0299021 April 9, 2024 4 / 29 PLOS ONE Optimizing FPGA implementation of high-precision chaotic systems Fig 3. The time series for x(t), y(t), and z(t), in (a), (b), and (c), respectively. https://doi.org/10.1371/journal.pone.0299021.g003 which is shown to be bounded, for the given values of the parameters. The following ranges for the states were observed, for 50� t� 100: þ17:9032 � xðtÞ � þ18:4669 24:0120 � yðtÞ � þ25:0480 ð5Þ þ04:3772 � xðtÞ � þ45:6160 Examining the phase space of the states, shown in Fig 4, illustrates the chaotic behavior of the system, where the famous butterfly effect is observed. The simulation was conducted employing the Simulink model, as depicted in Fig 4(e). A fixed integration step of 0.01 seconds was maintained throughout the process. Furthermore, the fourth-order Runge-Kutta (RK-4) method was utilized to solve the ODEs presented in Eq 1. Usually, the choice of the integration step for numerical simulations is based on the actual dominant time constant of the system, in addition to the stiffness ratio of the ODEs [15]. How- ever, for chaotic systems, this is difficult to be extracted from the power spectrum of the states, or the eigenvalues of the Jacobian matrix. Changing the value of ρ in Eq 1, while maintaining both σ andβ at their nominal values can lead to different oscillatory non-chaotic patterns that will be stable, provided that the following condition is satisfied [9]: � � sþ bþ 3 470 r < s ) r < ð6Þ s b 1 19 which is directly driven from the eigenvalues (λ , i2 1,2,3) of the characteristics equation that corresponds to Eq 3. In addition, the eigenvalues of Eq 3, at the nominal values of σ, ρ,β and the equilibrium points of Eq 2 can be used to calculate the stiffness ratio (SR), as depicted in PLOS ONE | https://doi.org/10.1371/journal.pone.0299021 April 9, 2024 5 / 29 PLOS ONE Optimizing FPGA implementation of high-precision chaotic systems Fig 4. Phase spaces of the Lorenz system in (a)-(d), resulting from simulating the Simulink model. https://doi.org/10.1371/journal.pone.0299021.g004 Eq 7: 2 3 13:8546 6 7 13:8546 6 7 l ¼ 6 0:0940þ j10:19457 ) SR ¼ ¼ 147:39 ð7Þ 4 5 0:0940 0:0940 j10:1945 The SR, calculated in Eq 7, which is the ratio of the largest to the smallest eigenvalue of the Jacobian matrix of the ODE system, depicted in Eq 3, has a large value reflecting more restric- tive stability conditions for the Lorenz system. This signifies that the solution, despite varying slowly, is affected by other nearby solutions that vary rapidly, so the chosen numerical method must take small integration steps to obtain satisfactory results. This should be taken into con- sideration, when designing the FPGA-based numerical algorithm, in terms of the maximum operating frequency, and the solver structure, which is thoroughly analyzed in the coming sections. Fig 5 shows the signal x(t), for ρ = 24, while the remaining parameters are kept the same, along with its power spectrum in (a) and (b), respectively. The periodic time of the dominant cycle can be used as a guide for the best choice of the integration step of the numerical solver. When using the Lorenz system for practical implementations, e.g. CBSC [4], it might be required to scale the generated signals to meet the constraints imposed by the actual hardware. For example, when using standard TTL hardware, signals are required to be within 5 Volts limits. In addition, many ADDA cards require the analogue signals to be within ±10 Volts. Nowadays, many low-power hardware, e.g. modern FPGAs, require dealing with signals that are limited to 3.3 Volts. More restrictions could be imposed on the level of the signals, gener- ated from the Lorenz system, for specific applications that require handling binary-based mul- timedia signals, corresponding to text, audio, images, and video streams [16]. Consequently, scaling the values of x(t), y(t), and z(t), to meet the required range, should be provided in a PLOS ONE | https://doi.org/10.1371/journal.pone.0299021 April 9, 2024 6 / 29 PLOS ONE Optimizing FPGA implementation of high-precision chaotic systems Fig 5. The power spectrum, in (b), for x(t), in (a), showing a dominant period of approximately 6.68 s. https://doi.org/10.1371/journal.pone.0299021.g005 systematic way that will not distort the chaotic behaviour of the Lorenz system. Along with magnitude scaling, adjusting the time scale of the Lorenz system might be required to meet the requirements on the bandwidth of the application. This is crucial, especially for real-time applications that require synchronizing the speed of the Lorenz system with some clock. A simple way to achieve scaling, in both magnitude and time, is to modify the Simulink block diagram, as illustrated in Fig 6. The system is made 10 times faster while forcing all states to fall between 0 and 1. This was easily adjusted by adding the gain blocks, just before the integra- tors (shown in green), while using soft functions to scale all the variables (shown in yellow). Fig 6. New layout of the Lorenz system with both time and magnitude scaling. https://doi.org/10.1371/journal.pone.0299021.g006 PLOS ONE | https://doi.org/10.1371/journal.pone.0299021 April 9, 2024 7 / 29 PLOS ONE Optimizing FPGA implementation of high-precision chaotic systems The numerical technique, illustrated in Fig 6 can also be augmented to Eq 1 to yield the following: 2 3 2 3 x _ sðx yÞ 6 7 6 7 new new new new S S S S 6 7 6 7 min max min 6 y _ 7 ¼ T x 6 rx y xz7 & ¼ ð8Þ SF old old old old 4 5 4 5 S S S S min max min z xy bz where T is the time scale factor that is used to shrink or stretch the time if set to more than SF old or less than one, respectively. In addition, the old signal, S , corresponding to x, y, or z new could be easily scaled to S , for any given range, according to the mathematical expression in Eq 8. When depending on numerical simulations to generate the chaotic signals, the choice of the integration algorithm and its corresponding time-step is crucial. Numerical solvers con- vert the analogue model, implicitly, into an equivalent discrete model for which the accuracy is dependent on its order. Stability, convergence, and tolerance are three important factors that must be taken into consideration when choosing the numerical solver and adjusting its settings. Many software packages exist that can do this automatically, e.g. MATLAB. The accuracy of the simulation is directly proportional to the order of the integration algorithm. First-order Euler, second-order Heun, and RK-4 methods are the most famous numerical solvers to choose from. Low-order numerical solvers are simpler, faster and require less mathematical effort, when implemented in real-time embedded hardware. On the other hand, higher-order numerical solvers are more complicated, require access to many inter- mediate variables, and can be dramatically slow, which makes them less appealing for real- time applications. Thus, an optimal compromise should be obtained between the required details for the abstract level of the discrete-equivalent model and its operating speed. Usu- ally, there is a conflict between accuracy and speed, and satisfying both of them requires very sophisticated hardware with high-performance computational power. As a rule of thumb, the approximation error between the numerical solution and the exact solution is a function of h , where h is the integration step and n is the order of the numerical solver. This implies that for better accuracy smaller integration steps and higher-order solvers should be used. For many applications, the Lorenz system needs to be implemented in analogue forms, especially in both electronic and optical hardware. In such cases, proper connections should be set up in the laboratories, with a controlled environment to minimize the effects of noise and external disturbances. Analog components are inherently susceptible to degradation over time, influenced by factors such as aging, temperature variations, and additional anom- alies that may arise during the circuit assembly process. Therefore, their accuracy might be questioned, and they will need continuous calibration and conditioning. Fig 1 illustrates a typical electronic layout for an analogue implementation of the Lorenz system that has a scaling factor of 1000, and all the signals are scaled to fit the standard TTL level of ±5 Volts [17]. Analog Op-Amps and a collection of resistors and capacitors are used to represent the three first-order nonlinear dynamics of x(t), y(t), and z(t). Two analog multipliers, AD633AN, were used to generate the quadratic terms xy and xz, while using LF353 Op- Amps, with ±15 Volts power supplies. The values and types of the analog components are shown in Fig 1. The modified ODEs, representing the electronic circuit of Fig 6, are given PLOS ONE | https://doi.org/10.1371/journal.pone.0299021 April 9, 2024 8 / 29 PLOS ONE Optimizing FPGA implementation of high-precision chaotic systems by: 2 � � � �3 1 R R R 3 2 2 1þ xþ y 6 7 2 3 R C R þ R R R 2 3 6 7 5 1 3 4 1 1 x _ 10ðx yÞ 6 7 6 � � 7 6 7 6 7 6 7 1 R 1 1 6 7 6 7 6 7 y _ ¼ x y xz ¼ 1000 28x y 10xz ð9Þ 6 7 6 7 6 7 4 5 C R R R R 4 5 6 2 6 8 9 10 7 6 7 � � z _ 6 7 2:5xy 2:667z 4 1 R 1 5 xy z C R R R 3 11 13 14 which have a scaling time factor of 1000, a 20% scaling factor for both x and y, and a 10% scaling factor for z. Fig 7 illustrates the response of such system. The Lorenz system was first observed in an application in fluid convection, where x(t) rep- resents the rate of the fluid convection, while both y(t) and z(t) represent the temperature vari- ation in both the horizontal and the vertical directions. The parameters σ, ρ,β represent Prandtl number, Rayleigh number, and horizontal wave number of the fluid convection, respectively [10]. However, many optical systems have similar dynamics; this suggests the pos- sibility of implementing the Lorenz system using optical devices, in contrast to the previous electronic analogue implementation. Eq 10 exemplifies the dynamics of semiconductor lasers: x _ ¼ sðx yÞ y _ ¼ rx ð1 jdÞy xz ð10Þ z _ ¼ Re½x y�