I have built a floating point multiplier in Logisim (digital design tool) for only single precision normal inputs. I have realised 2 different round to even rounding algorithms and I am not sure which one is correct.
If you take the 23 bit mantissa and bit extend it by 1 to 24 bits then multiply 2 of these together you get a 48 bit binary number with bits 48 and 47 to the left of the 'decimal' point. Depending on whether the multiplication returns a 1 or 0 at the 48th bit will determine whether the answer needs to be normalised with the point staying put or shifting 1 place to the left.
So my question on rounding is this. The guard bit and the OR'd sticky bits will start at different positions (1 position difference) depending on whether the 48th bit is a 1 or a 0 so should the rounding section of the multiplier be fed with these 2 different bit streams and then a choice made as to which one to use (depending on the 48th bit) or should we simply implement the rounding assuming 48th bit is a 0 THEN normalise ???
Example 2 possible 48 bit numbers from multiplication of 2 24 bit mantissas
10.0011010010011101011010 101010101010101010101011
01.1010101110100101010110 101010101010010101010101
The guard bit and the remaining 'sticky bits' to be Or'd together are different depending on whether the 48th bit MSB is a 1 or a 0 (the 2 different guard bit positions are in bold type). So which guard bit position is used ? Or ' as I have done' do we offer both bit streams to the rounding section and chose the correct one via the 48th bit ???