Design and Implementation of a Takum Arithmetic Hardware Codec in VHDL

Laslo Hunhold
2024-08-22
Abstract:The takum machine number format has been recently proposed as an enhancement over the posit number format, which is considered a promising alternative to the IEEE 754 floating-point standard. Takums retain the useful posit properties, but feature a novel exponent coding scheme that yields more precision for small and large magnitude numbers. Takum's dynamic range is larger and bounded, as reflected in its name, derived from the Icelandic 'takmarkað umfang', meaning 'limited range'. Consequently, the selection of bit string lengths becomes determined solely by precision requirements and independent of dynamic range considerations. Takum is defined in both a logarithmic number system (LNS) format and a traditional floating-point format. This paper presents the design and implementation of a hardware codec for both the logarithmic and floating-point takum formats. The design primarily focuses on the codec, as both formats share a common internal arithmetic representation. Non-essential aspects of current posit designs, such as fused or pipelined architectures and the choice of floating-point IP cores, are thus omitted. The proposed takum codec, implemented in VHDL, demonstrates near-optimal scalability and performance on an FPGA, matching or exceeding state-of-the-art posit codecs in terms of both latency and LUT utilisation.
Hardware Architecture
What problem does this paper attempt to address?
The main problems that this paper attempts to solve are the deficiencies of the current floating - point number representation formats (such as the IEEE 754 standard) in terms of precision, dynamic range, and reproducibility, especially in the fields of low - precision and mixed - precision computing (such as machine learning). Specifically: 1. **Precision problem**: The IEEE 754 standard loses precision rapidly when dealing with small and large numbers. For example, when dealing with very small or very large values, the precision of IEEE 754 decreases significantly. 2. **Dynamic range problem**: The IEEE 754 standard has a limited dynamic range at lower bit widths (such as 16 - bit or 32 - bit), resulting in excessive relative approximation errors and being unable to meet the requirements of certain application scenarios. 3. **Reproducibility problem**: In some cases, the calculation results of the IEEE 754 standard may vary due to different hardware or software implementations, affecting the reproducibility of the results. To solve these problems, the paper introduces a new machine number format - the takum format. Compared with the existing posit format, the takum format has the following advantages: - **Higher precision**: For small and large numbers, the takum format can provide more significant digits, thereby improving precision. - **Larger dynamic range**: The dynamic range of the takum format is larger and bounded, making its performance more stable at different bit widths. - **Decoupling precision and dynamic range**: The design of the takum format makes it no longer necessary to consider the influence of the dynamic range when choosing precision, simplifying the design and application. In addition, the paper also describes in detail the hardware codec design and implementation of the takum format, and optimizes the implementation on FPGA using the VHDL language, and shows its superior performance in terms of latency and LUT utilization. ### Main contributions 1. **Mathematical derivation**: Derived efficient takum encoding and decoding algorithms. 2. **Open - source implementation**: Provided detailed pseudo - code descriptions and open - source VHDL implementations, which are suitable for FPGA hardware. 3. **Performance comparison**: Compared the performance of the takum codec with the state - of - the - art posit codec, showing its advantages in latency and LUT utilization. Through these contributions, the paper not only solves the problems of existing floating - point number formats but also provides new solutions for future low - precision and mixed - precision computing.