Nothing Special   »   [go: up one dir, main page]

Skip to main content

Decoding-Free Two-Input Arithmetic for Low-Precision Real Numbers

  • Conference paper
  • First Online:
Next Generation Arithmetic (CoNGA 2023)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. 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

    Chapter  Google Scholar 

  2. Gustafson, J.L.: The End of Error: Unum Computing. Chapman and Hall/CRC (2015)

    Google Scholar 

  3. Gustafson, J.L.: A radical approach to computation with real numbers. Supercomput. Front. Innov. 3(2), 38–53 (2016)

    Google Scholar 

  4. Gustafson, J.L., Yonemoto, I.T.: Beating floating point at its own game: posit arithmetic. Supercomput. Front. Innov. 4(2), 71–86 (2017)

    Google Scholar 

  5. Johnson, J.: Rethinking floating point for deep learning. CoRR, vol. abs/1811.01721 (2018). http://arxiv.org/abs/1811.01721

  6. 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

    Book  MATH  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Federico Rossi .

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).

Table 12. Example of a feasible solution for positive values of \(Posit\left\langle 4,0\right\rangle \). Notice that \(L^x_i = x^{*}_i \cdot 2^3\) and \(L^y_j = y^{*}_j\).

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

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics