Digital architecture to implement a piecewise-linear approximation for the hyperbolic tangent function