Electronic – Why comparison of biased representation are faster than two’s complement

binaryfloating point

Biased representation (or excess-N, offset binary) are used for floating number representation in computers. This wiki page says

This allows high speed comparisons

Could any one explain why comparison is faster (potentially in terms of gates implementation)?

Best Answer

It makes it faster because, when you need to check if A is greater than B, with bias, you can just use the usual integer comparison (using subtraction), actually interpreting the floating point bits like a normal unsigned integer (like a "reinterpret_cast" in C++), and the result will be obtained immediately.

Otherwise, you would need two steps: first comparing exponents, then comparing mantissa, and that would make it a specific processor instruction.