# Bit Streaming Processing Algorithms for Intelligent Hardware Converters
## 3 Results
### Bit-Stream Algorithms  
The conversion of the code into a pulse-frequency stream is based on the method of small increments. According to this method, the input code is represented as a stream of single bits occurring at fixed moments of time, ti. The number of pulses per process period is equal to the normalized value of the code. Figure 2 shows the algorithm of pulse-frequency sweep. Figure 1: The scheme of the parallel bit-stream process: (**a**) multiplication process; (**b**) multiplication-division process. When performing the sweep of the n-bit binary code \(\rm N_{k}\), n bit streams are formed in parallel. The algorithm works as follows: some base code n-bit binary code \(\rm N_{b}\) at each moment of time \(\rm t_{i}\) is incremented by 1, and \(\rm N_{binc}\) code is formed. The value of \(\rm N_{binc}\) is compared with \(\rm N_{b}\) in order to find the position \(\rm m\) (\(0\leq\rm m\leq n-1\)), where \(\rm N_{binc}\) code contains 1, and \(\rm N_{b}\) code contains 0. If such a combination is found, then a single bit is generated in the stream with the number \(\rm n-1-m\) (\(\rm P_{\rm v(n-1-m)}\)). The converted code \(\rm N_{k}\) is used as a mask of the current state of the streams \(\rm P_{\rm v0}\), \(\rm P_{\rm v1}\),... \(\rm P_{\rm v(n-1)}\). For masking, we use the following rule: the least significant bit 0 of the binary code \(\rm N_{k}\) masks the stream \(\rm P_{\rm v(n-1)}\), formed on the basis of the most significant bit of codes \(\rm N_{binc}\), and the most significant (\(\rm n-1\)) bit codes \(\rm N_{k}\) masks the stream \(\rm P_{\rm v0}\). The result of the masking makes it possible to determine the necessity of the bit generation to represent the \(\rm N_{k}\) code at the current time \(\rm t_{i}\). Table 1 shows an example of obtaining the bit streams \(\rm P_{\rm v0}\), \(\rm P_{\rm v1}\), \(\rm P_{\rm v2}\), \(\rm P_{\rm v3}\) for n = 4. When considering the sweeping of the code \(\rm N_{k}\), if \(\rm N_{k}=7\) (binary equivalent: 0111), the streams \(\rm P_{\rm v0}\), \(\rm P_{\rm v1}\), \(\rm P_{\rm v2}\) will be selected. The zero value of the most significant bit of the \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \(\rm N_{b}\) & \(\rm N_{binc}\) & \(\rm P_{\rm v0}\) & \(\rm P_{\rm v1}\) & \(\rm P_{\rm v2}\) & \(\rm P_{\rm v3}\) \\ \hline
0000 & 0001 & 0 & 0 & 0 & 1 \\
0001 & 0010 & 0 & 0 & 1 & 0 \\
0010 & 0011 & 0 & 0 & 0 & 1 \\
0011 & 0100 & 0 & 1 & 0 & 0 \\
0100 & 0101 & 0 & 0 & 0 & 1 \\
0101 & 0110 & 0 & 0 & 1 & 0 \\
0110 & 0111 & 0 & 0 & 0 & 1 \\
0111 & 1000 & 1 & 0 & 0 & 0 \\
1000 & 1001 & 0 & 0 & 0 & 1 \\
1001 & 1010 & 0 & 0 & 1 & 0 \\
1011 & 1100 & 0 & 1 & 0 & 0 \\
1101 & 1110 & 0 & 0 & 1 & 0 \\
1110 & 1111 & 0 & 0 & 0 & 1 \\
1111 & 0000 & 0 & 0 & 0 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Example of obtaining bit streams. Figure 2: Algorithm of pulse-frequency sweep. code \(\mathrm{N_{k}}\) blocks the stream \(\mathrm{P_{v3}}\). The merging of bits of \(\mathrm{P_{v0}}\), \(\mathrm{P_{v1}}\), and \(\mathrm{P_{v2}}\) streams allows the formation of a stream in which the number of bit pulses per period is equal to the value of the sweeping code \(\mathrm{N_{k}}=7\). If \(\mathrm{N_{k}}=12\) (binary equivalent: 1100), then \(\mathrm{P_{v2}}\) and \(\mathrm{P_{v3}}\) streams are selected. The sum of bits in \(\mathrm{P_{v2}}\) and \(\mathrm{P_{v3}}\) is equal \(\mathrm{N_{k}}=12\). The streams \(\mathrm{P_{v0}}\), \(\mathrm{P_{v1}}\) are blocked by zero values of bits number 0 and number 1 of the \(\mathrm{N_{k}}\) code. The multiplication of PFM and PWM data is realized by passing bits of the PFM stream only at times when the PWM signal is active (equal to 1). We used the multiplication-division operation algorithm shown in Figure 3 to implement function (1). One of the input numerator codes, e.g., \(\mathrm{N_{1}}\), is converted into a bit stream, and the code \(\mathrm{N_{2}}\) is converted into a PWM signal \(\mathrm{\Theta_{N_{2}}}\).