Abstract
In this work, we present a novel method for directly computing functions of two real numbers using logic circuits without decoding; the real numbers are mapped to a particularly-chosen set of integer numbers. We theoretically prove that this mapping always exists and that we can implement any kind of binary operation between real numbers regardless of the encoding format. While the real numbers in the set can be arbitrary (rational, irrational, transcendental), we find practical applications to low-precision posit™ number arithmetic. We finally provide examples for decoding-free 4-bit Posit arithmetic operations, showing a reduction in gate count up to a factor of \(7.6\times \) (and never below \(4.4\times \)) compared to a standard two-dimensional tabulation.
Research supported by Horizon H2020 projects EPI-SGA2 and TextaRossa.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Cococcioni, M., Rossi, F., Ruffaldi, E., Saponara, S.: Small reals representations for deep learning at the edge: a comparison. In: Gustafson, J., Dimitrov, V. (eds.) CoNGA 2022. LNCS, vol. 13253, pp. 117–133. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-09779-9_8
Gustafson, J.L.: The End of Error: Unum Computing. Chapman and Hall/CRC (2015)
Gustafson, J.L.: A radical approach to computation with real numbers. Supercomput. Front. Innov. 3(2), 38–53 (2016)
Gustafson, J.L., Yonemoto, I.T.: Beating floating point at its own game: posit arithmetic. Supercomput. Front. Innov. 4(2), 71–86 (2017)
Johnson, J.: Rethinking floating point for deep learning. CoRR, vol. abs/1811.01721 (2018). http://arxiv.org/abs/1811.01721
Conforti, M., Cornuéjols, G., Zambelli, G.: Integer Programming. Graduate Texts in Mathematics, Springer, Cham (2014). https://doi.org/10.1007/978-3-319-11008-0
Acknowledgments
Work partially supported by H2020 projects EPI2 (grant no. 101036168, https://www.european-processor-initiative.eu/ and TextaRossa (grant no. 956831, https://textarossa.eu/).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Appendix: How to Build an Initial Feasible Solution
Appendix: How to Build an Initial Feasible Solution
An initial feasible solution (useful to speedup Matlab intlinprog function) can be constructed as shown below. We will focus on the positive values in X, different both from NaR (notice that we are excluding the zero as well). Let us call this set \(\mathcal {X}\). Let us indicate with \(x^{*}_i \in \mathcal {X}\) the corresponding bistring (in the next we will refer to the \(Posit\left\langle 4,0\right\rangle \) case, as an example). Therefore, the bistrings will be the ones of \(Posit\left\langle 4,0\right\rangle \) without its most significant bit (see Table 1).
-
Each \(x_i \in \mathcal {X}\) is mapped to the natural number \(L^x_i = x_i^* \cdot 2^n,\) n being the maximum number of bits needed for representing the \(x_i\) (in the case of \(Posit\left\langle 4,0\right\rangle \), \(n = 3\) )
-
Each \(y_j \in \mathcal {Y}\) is mapped to the natural number \(L^y_j = y_j^*\)
Therefore, we obtain the \(L^x, L^y\) sets: \(L^x: \{x_1^* \cdot 2^n, \dots , x_{|\mathcal {X}|}^* \cdot 2^n \}\) and \(L^y: \{ y_1^*, \dots , y_{|\mathcal {Y}|}^* \}\). Each \(L_{i,j}^z \in L^z\) is obtained by the concatenation of the bit strings \(x_i^*, y_j^*\) (or equivalently, as \(L_{i,j}^z = L_i^x + L_j^y\), as shown in Table 12).
We now prove that this solution satisfies the constraint given in Eq. (1):
-
Since there are no conflicting encodings of the real numbers in \(\mathcal {X}\) and \(\mathcal {Y}\), we can guarantee that different real numbers have different bit-strings that digitally encode them. Therefore, \(L_i^x \ne L_j^x, \forall i \ne j\) and \(L_p^y \ne L_l^y, \forall k \ne l\).
-
Since all the encodings in \(L^x, L^y\) are different from each other, also the concatenation of any pair \(L_i^x, L_j^y\) is unique. Therefore, \(L_{i,j}^z \ne L_{k,q}^z, \) if \(x_i \triangledown y_j \ne X_j \triangledown Y_q \) (with \(\triangledown \) we indicate the generic operation for which we are finding the mapping).
-
Being the values \(L_{i,j}^z\) unique (no duplicates), we can easily obtain the ordered set \(L^z\), by sorting them.
-
the k-element vector \(\boldsymbol{w}\) can be trivially obtained as cast\((x_i \triangledown y_j)\), when \(i\cdot 2^n + j = k\).
An example of feasible solution for the multiplication of \(Posit\left\langle 4,0\right\rangle \) numbers is reported in Table 12.
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Gustafson, J.L., Cococcioni, M., Rossi, F., Ruffaldi, E., Saponara, S. (2023). Decoding-Free Two-Input Arithmetic for Low-Precision Real Numbers. In: Gustafson, J., Leong, S.H., Michalewicz, M. (eds) Next Generation Arithmetic. CoNGA 2023. Lecture Notes in Computer Science, vol 13851. Springer, Cham. https://doi.org/10.1007/978-3-031-32180-1_4
Download citation
DOI: https://doi.org/10.1007/978-3-031-32180-1_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-32179-5
Online ISBN: 978-3-031-32180-1
eBook Packages: Computer ScienceComputer Science (R0)