FPGA Implementations of Piecewise Affine Functions Based on Multi-Resolution Hyperrectangular Partitions