# Trade-Off Analysis of Hardware Architectures for Channel-Quality Classification Models
## 4 Methods
### Common Components  
The common hardware modules used in MLP and Logistic Regression architectures are multipliers, adders, comparators, and the Sigmoid module. Multipliers and adders are the most used components. We developed a single module containing the above operations, avoiding making several copies of multipliers and adders for MLP, Logistic Regression, and SVM.  
Multiplier Adder Module: MLP, Logistic Regression, and SVM have 15 multipliers and 15 adders as common components (Figure 4a) in their architecture, and each multiplier has two data inputs: \(x_{i}\) and \(w_{i}\) with \(i=0,1,2,...,14\), where \(x_{i}\) are the 15 features from the data set, and \(w_{i}\) is the weight multiplied by the inputs, such that \(x_{i}\times w_{i}\) for every \(i\); in  
Figure 3: System model to implement in V2V and V2I Communications our proposal as part of an On-Board System.  
addition, there is a value \(c\) that is calculated depending on the algorithm. The output was determined by using the Equation (5):  
\[output=(\sum_{i=0}^{14}x_{i}w_{i})+c \tag{5}\]  
The 15 multipliers and 15 adders were represented as a single module with 15 data inputs and 1 data output and 3 control signals called _enable_ (EN), _reset_ (RST), and _ready_, which indicate when the process has been completed and the output is ready to be communicated. This module is called Multiplier-Adder Module 1, shown in Figure 4b.  
Sigmoid Module: The _Sigmoid_ activation function is part of MLP and Logistic Regression architectures. Different steps are necessary for the hardware implementation of the _Sigmoid_ function since it is not possible to implement it directly. _Sigmoid_ has a range of between zero and one, and its expression is shown in Equation (6):  
\[f(X)=\frac{1}{1+e^{-X}} \tag{6}\]  
The block diagram of the _Sigmoid_ activation function is shown in Figure 5a, such that the process consists of four different steps: (i) \(e^{x}\) is calculated, such that the input value is the exponent of the Euler constant \(e\); (ii) the result of \(e^{x}\) is inverted, obtaining a result of \(1/e^{x}=e^{-x}\) to this point; (iii) a value of one is added to the previous result, forming the denominator of the _Sigmoid_ activation function; and (iv) the result of \(1+e^{-x}\) is inverted. The representation of the Sigmoid module is shown in Figure 5b.  
Figure 4: Multiplier Adder Module 1 and its Components. (**a**) Common Multipliers and Adders. (**b**) Multiplier Adder Module 1.  
Comparator Module: It is the common component of MLP and Logistic Regression that determines the class to be activated: class zero or class one. The module has one data input; one store value; three control signals, EN, RST, and READY; and two outputs, _CLASS_0_ and _CLASS_1_, that are determined depending on the input signals. _CLASS_0_ is activated if the input is bigger than 0.5; if not, _CLASS_1_ is activated. The comparator module is shown in Figure 6. We remark that a comparator is also used for Decision Trees and SVM. However, their implementation is slightly different; for example, in Decision Tree, there are two outputs that activate the left or right node, respectively, whereas SVM implements two comparators for forming a Hard Margin.