A data processing device calculates the difference 110 between the significands of two floating point numbers. To normalise the difference, an intermediate number w is generated 130. This number has either the same number of, one more or one less leading zero than the difference between the significands. The number of leading zeroes in w is counted 140, and input to a left shifter 160 to normalise the difference. In parallel to the counting, two masks are generated from w 150. Both masks have a one in the location of the most significant non zero bit in w and zeroes in the more significant bits. The l mask has zeroes in the less significant bits. The s mask has ones in the less significant bits. The l mask is used to detect an overflow using a logical and operation between the mask and bits of the difference 170. If an overflow has occurred, the difference is shifted right one bit 180. The s mask is used to return trailing bits of the difference by performing a logical and with a subset of the bits of the difference 170. This may be used to generate a sticky bit.
展开▼