IEEE 854

The IEEE 854 standard was developed to guide how computers represent and work with floating-point numbers. It supports multiple bases for floating-point numbers, but it only allows base 10 and requires base 2 if a different base is used.

Why Is Base 10 Allowed?

Base 10 is the number system we use in everyday life. It's the decimal system, with digits from 0 to 9. Calculators often display results in decimal, so it makes sense for them to use base 10 internally.

Why Base 2 Is Preferred in Computers

When computers don't use base 10, IEEE 854 says they must use base 2 (binary). This is due to

  1. Better Error Handling - since all decimal numbers can't be represented exactly (like 1/3 or 0.1), there will always be rounding errors. These errors are easier to analyze and control when using base 2, which is why the relative error stays more stable in binary. This means that binary arithmetic will generally produce more predictable and accurate results.

  2. More Effective Precision - larger bases can actually waste some of the digits they are afforded. For example, base 2 with 4 binary digits can represent exactly, but base 16 with 1 digit (which is still 4 bits) cannot - it only gets the first bit correct.

This means a system using base 16 may seem to offer the same precision as base 2, but in practice, it will lose information. In general, base 16 can lose up to 3 bits of precision, and the actual effective precision will be closer to bits (where is the number of digits).

Why Did IBM Use Base 16?

Back in the day, IBM chose base 16 for its System/370 architecture. The exact reason isn't known, but here are two possible explanations:

  1. Wider range of numbers - with base 16, they could fit a larger range of numbers into a 32-bit word. For example, a base-16 system with uses 24 bits for the number and 7 for the exponent. A similar base-2 system would need more exponent bits to get the same range, leaving fewer bits for the actual number (the significand).

However, even with that tradeoff, base 2 can actually store more accurate numbers because it doesn't lose those extra bits to rounding the way base 16 does.

  1. Faster additions (sometimes) - with base 16, numbers like 1 through 15 all have the same exponent, so they can be added quickly - no shifting needed to line up decimal points. In contrast, base-2 numbers might need shifting, which can slow things down. However, this kind of performance improvement is negligible on modern computer architectures, so it's no longer necessary.

Was this page helpful?