Implementation of hyperbolic tangent function in neural network using Matlab HDL coder for Biosignals
In this paper, the hyperbolic tangent function and its application in a test neural network on a Field Programmable Gate Array are presented, using the Verilog hardware description language. The hyperbolic tangent activation function is presented using a rational approximation in order to avoid floating-point arithmetic and instead use fixed-point. When the approximated version of the hyperbolic tangent function with fix point representation was compared to its original version, the mean absolute error was 0.00536, the mean squared error was $5.607 \mathrm{e}-05$, and the maximum error was 0.016, which shows that to an average of 2.27 decimal places the approximation was accurate. For comparison, the approximated function was implemented using two types of logic: sequential and combinational. The combinational logic was 67 percent more energy efficient than the sequential logic, because the combinational logic provided an immediate response, while the sequential logic required only one clock cycle. These implementations were achieved through MATLAB software in conjunction with the integrated hardware description language Coder and Fixed Point Designer tools, in which the mathematical instructions are written in MATLAB scripts and then generated into Verilog code. The design was then taken to Xilinx’s Vivado software to conduct tests and evaluate things like power consumption and response times.
Authors
- Abbass Nasser (ORCID: https://orcid.org/0000-0002-7768-8953)
- José Luis Ordóñez-Ávila (ORCID: https://orcid.org/0000-0002-3537-1739)
- Jorge Canales Verdial
Institutions
- Central American Technological University (HN)
- Central New Mexico Community College (US)
Publication Details
- Published
- 2025-05-09
- DOI
- https://doi.org/10.1109/iccre65455.2025.11093331
- Citations
- 1
- Primary Topic
- Neural Networks and Applications
- Type
- article
- Field-Weighted Citation Impact
- 2.48