# A Low-Complexity Start-Stop True Random Number Generator for FPGAs
## 2 A Start-Stop TRNG with Two ROs and a Phase Detector
For simplicity, ideal sampling is assumed using Dirac pulses with a period \(T_{s}\). The sampled signals are the following:  
\[ \begin{array}{l}d_{1}(t)=\sum\limits_{n=-\infty}^{\infty}{[\sin{(\omega_{1} nT_{s})}+(\varphi_{1}(nT_{s})+\varphi_{2}(nT_{s}))\cos(\omega_{1}nT_{s})]\delta(t-nT _{s})}\\ d_{2}(t)=\sum\limits_{n=-\infty}^{\infty}{[\sin{(\omega_{2}nT_{s})}+(\varphi_{ 2}(nT_{s})+\varphi_{1}(nT_{s}))\cos(\omega_{2}nT_{s})]\delta(t-nT_{s})}.\end{array}  \tag{8}\]  
After summing modulo 2 (both signals) and applying the Fourier transform, we obtain the following spectrum:  
\[ \begin{array}{l}S(\omega)=\frac{1}{2T_{s}}\sum\limits_{n=-\infty}^{\infty} &\frac{1}{j}(\delta(\omega-\omega_{1}-n\omega_{s})-\delta(\omega+\omega_{1}- n\omega_{s}))\\ &+\[PERSON]_{1}(\omega-\omega_{1}-n\omega_{s})+\Phi_{1}(\omega+\omega_{1}-n\omega_{s}) \\ &+\[PERSON]_{2}(\omega-\omega_{1}-n\omega_{s})+\Phi_{2}(\omega+\omega_{1}-n\omega_{ s})\\ &+\frac{1}{j}(\delta(\omega-\omega_{2}-n\omega_{s})-\delta(\omega+\omega_{2}-n \omega_{s}))\\ &+\[PERSON]_{2}(\omega-\omega_{2}-n\omega_{s})+\[PERSON]_{2}(\omega+\omega_{2}-n\omega_{ s})\\ &+\[PERSON]_{1}(\omega-\omega_{1}-n\omega_{s})+\[PERSON]_{1}(\omega+\omega_{1}-n\omega_{s})-4\pi C\delta(0). \end{array}  \tag{9}\]  
The value of C is constant. In comparison, the signal spectrum from generator WT2 is as follows:  
\[ \begin{array}{l}SW(\omega)=\frac{1}{2T_{s}}\sum\limits_{n=-\infty}^{\infty} &\frac{1}{j}(\delta(\omega-\omega_{1}-n\omega_{s})-\delta(\omega+\omega_{1}- n\omega_{s}))\\ &+\Phi_{1}(\omega-\omega_{1}-n\omega_{s})+\Phi_{1}(\omega+\omega_{1}-n\omega_{ s})\\ &+\frac{1}{j}(\delta(\omega-\omega_{2}-n\omega_{s})-\delta(\omega+\omega_{2}-n \omega_{s}))\\ &+\Phi_{2}(\omega-\omega_{2}-n\omega_{s})+\Phi_{2}(\omega+\omega_{2}-n\omega_{ s})-4\pi C\delta(0).\end{array}  \tag{10}\]  
On examining Equations (9) and (10), it is evident that, within the proposed generator, the spectral elements associated with phase disturbances traverse to the output twice on two distinct subcarriers. This feature is advantageous as it enables more precise band coverage and makes the signal more like white noise, as depicted in Figure 4. The generators that were tested comprised two source ring oscillators. The sampling frequency was 10 MHz, and the bit rate was 10 Mbit/s. Figure 4: Comparison of spectrum on the output of RO-based generator with two ROs without phase detector (**left side**) and with phase detector (**right side**). Upon examining the spectra, it is evident that the WT2 generator's spectrum is focused on a few frequencies only. In contrast, the spectrum of the WT2D generator, equipped with a phase detector, is more spread out and effectively covers the entire signal band. This observation aligns with the spectral flatness values calculated using Wiener entropy, as outlined in the following formula [50]:  
\[F_{l}=\frac{\sqrt[N]{\prod_{n=0}^{N-1}x(n)}}{\frac{1}{N}\sum_{n=0}^{N-1}x(n)}= \frac{e^{\frac{1}{N}\sum_{n=0}^{N-1}\ln x(n)}}{\frac{1}{N}\sum_{n=0}^{N-1}x(n)}. \tag{11}\]  
The spectrum samples in set \(N\), denoted as \(x(n)\), have a spectrum flatness of one when dealing with white noise in the measured signal band. A spectrum flatness value of zero indicates a pure harmonic. When comparing WT2D to WT2, the value of \(F_{l}\) is 0.553671 for WT2 and 0.673340 for WT2D. Thus, better statistical properties of output sequences are expected to be produced by WTD2 than by WTD.