Koz, adding posits is very much like adding floats, but with a simplification. The regime bits and exponent bits determine the scale factor of each number, and you shift the mantissa bits by the difference of the two scale factors. The smaller magnitude number is the one to shift. (If the two values have the same scale factor, no shifting is needed.) Then add the mantissas, and convert the result back as you would for a float, except use the regime bits to abbreviate the scaling factor.
The simplification is that the mantissas, once aligned, add like two's complement integers and that works for both negative and positive values. The "hidden bit" for negative posits has the value -2 instead of 1. That saves at least one conditional test that floats have to do: "Are the inputs the same sign or opposite sign?"
Find a definition of how to do addition of conventional IEEE floats (I think Berkeley SoftFloat will work, or read Knuth's description in The Art of Computer Programming) and step through it until you understand it. Only a few lines of that algorithm need to be changed to work for posits.
> --
> You received this message because you are subscribed to the Google Groups "Unum Computing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
unum-computin...@googlegroups.com.
> To post to this group, send email to
unum-co...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/unum-computing/20170610212534.GA18040%40Emi.
> For more options, visit
https://groups.google.com/d/optout.
________________________________
Important: This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Thank you.