# A Modified KNN Algorithm for High-Performance Computing on FPGA of Real-Time m-QAM Demodulators
## 6 Conclusions  
In this work, we presented a multi-core architecture for real-time implementation of KNN-based demodulators. The design takes advantage of the operations' independence applied to the symbols coming from a communication channel. The design allowed selecting \(N\) input symbols to configure \(N\) parallel processing cores. These cores contain custom processing units (CuPUs) implemented with optimization directives to increase concurrency within each core. The implementation was performed using a high-level synthesis (HLS) design methodology, simplifying the selection of m-QAM formats and the KNN parameters. This version of KNN could be used in formats other than m-QAM modulation because KNN results depend on the training data and not on the constellation's shape.  
Additionally, we proposed a modification of the KNN algorithm to improve the performance of the hardware implementation. In this case, the modulation format does concentrate on square-shaped m-QAM constellations. We define Cluster-Blocks to significantly reduce the number of comparisons and sortings on the training data. The modified KNN algorithm shows a decrease in computation times concerning the first KNN version. For the hardware implementation, we use as a base the multi-core architecture to preserve the advantages in scaling and parameterization.  
For future work, we propose testing KNN implementations with data from other experimental setups and different modulation formats. In addition, we suggest increasing the design exploration for the KNN algorithms to obtain better processing times, for example, exploring the impact on the use of fixed-point numerical formats with a lower amount of bits or efficient memory management techniques. Finally, we propose exploring this type of modification in other machine learning algorithms.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **N-Cores** & **BRAM** & **FF** & **LUT** & **DSP** &
\begin{tabular}{c} **Elapsed** \\ **Time (s)** \\ \end{tabular} \\ \hline KNN & 20 & 369.5 & 242,996 & 177,445 & 75 & 5.82 \\ Modified KNN & 20 & 403.5 & 107,108 & 99,759 & 321 & 3.07 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison between the KNN algorithm and the modified KNN algorithm for 100 K input symbols using 20 cores on the AWS-FPGA.  
**Author Contributions:** Conceptualization, [PERSON] and [PERSON]; methodology D.M.-V., [PERSON]-L., and [PERSON]; validation, [PERSON]-V. and [PERSON]-L.; formal analysis, [PERSON]-[PERSON] and [PERSON]-[PERSON]; investigation, [PERSON]-V., [PERSON]-L., and [PERSON]; writing--original draft preparation, D.M.-V.; writing-review and editing, [PERSON]-V., [PERSON]L., and [PERSON]; funding acquisition, [PERSON] and [PERSON]-L. All authors have read and agreed to the published version of the manuscript.  
This research was funded by Instituto Tecnologico Metropolitano grant number P17224.  
**Data Availability Statement:** Not applicable.  
**Acknowledgments:** This work was developed in the LSCR laboratory of the Instituto Tecnologico Metropolitano.  
**Conflicts of Interest:** The authors declare no conflict of interest.