A Resource- and Power-Efficient FPGA Implementation of a Segmented Chebyshev Tanh Activation Function Using Single-Precision Floating-Point Arithmetic
Artificial intelligence and machine learning workloads increasingly rely on dedicated hardware accelerators, including field-programmable gate arrays (FPGAs), which offer parallelism and reconfigurability. The hyperbolic tangent (tanh) is widely used as a nonlinear activation function yet is costly to evaluate directly in hardware, making efficient approximation essential. This work presents an FPGA implementation of a segmented Chebyshev-polynomial-based tanh core for IEEE-754 single-precision floating-point. The input domain x∈[−6,6] is reduced to |x|∈[0,6] by exploiting tanh’s odd symmetry, and partitioned into three sub-intervals with per-interval Chebyshev degrees selected to achieve the target accuracy. Polynomial evaluation is performed via Clenshaw’s recurrence, with a single recurrence stage reused for all evaluation steps under finite-state-machine control. Implemented and verified on an Altera Cyclone V FPGA, the core uses 1176 adaptive logic modules, 317 registers, and one digital signal processing (DSP) block. It requires 28 clock cycles for inputs within the approximation domain and 3 outside it, and dissipates 6.20 mW of dynamic power at 40 MHz. The mean absolute error is 8.26×10−8 across the tested inputs and 5.74×10−8 over a denser MATLAB sweep. Against exponential-based, continued-fraction-based, and polynomial-based tanh approximations, it achieves the lowest register, DSP, memory, and dynamic power utilization.
Authors
- Chanakya Dinesh Hingu (ORCID: https://orcid.org/0000-0002-8279-5518)
- Xingang Fu (ORCID: https://orcid.org/0000-0002-1846-2604)
- Mahesh V. Hosur (ORCID: https://orcid.org/0000-0002-0604-3453)
- Praneeth Vangala (ORCID: https://orcid.org/0009-0006-2706-1681)
Institutions
- University of Nevada, Reno (US)
- Texas A&M University – Kingsville (US)
Publication Details
- Journal
- Electronics
- Published
- 2026-10-28
- DOI
- https://doi.org/10.3390/electronics15214993
- Primary Topic
- Numerical Methods and Algorithms
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Science Foundation