User:Cerlane/sandbox

Posit and Unum
Universal number (Unum) was formally shared by John Gustafson in 2016. That version is now officially known as Type I unum. Since then, Gustafson had invented two additional types of unum, Type II and Type III. Type III unum also known as posits and valids is the breakthrough type that can serve as a drop and replacement for IEEE 754 floats. Similar size posits when compared to floats offer a bigger dynamic range and more fraction bits for accuracy for numbers near one where most computations occur. This makes it very attractive to the current trend in deep learning to minimise the number of bits used. It potentially helps any applications to achieve a speedup by enabling the use of fewer bits (since it has more fraction bits for accuracy) thus reducing network and memory bandwidth, and power requirements, and bring us one step closer to exascale.

Posit
Posits have a different format than IEEE 754 floats. It consists of three parts, sign, regime, exponential and fraction(also known as significand/mantissa). For a n-bit posit, regime can be of length 2 to (n-1). The format of regime is such that it is a repetition of a same-sign bit and terminated by a different-sign bit.

Example 1:

Example 2:

Example 1 shows a regime with 14 same-sign bit (bit 0), terminated by a different-sign bit (bit 1). As there are 14 same-sign bits, the runlength of regime is 14.

Example 2 shows a regime with 3 same-sign bit (bit 0), terminated by a different-sign bit (bit 1). As there are 3 same-sign bits, the runlength of regime is 3.

Sign, exponential and fraction bits are very similar to IEEE 754. In the case of posits, it is possible to have no exponential and fraction bits, i.e. the entire posit consists of only sign and regime bits.