0. Background
The exponent part of the IEEE Floating-Point Representation is encoded in a biased form. During my design of the ALU for the floating point, I need to find a way to extend the biased form for one bit without change the actual value which it’s representing and make it easier to detect the overflow and underflow during the calculation.
By the way, a k k k-bit biased number’s bias in this article is B i a s = 2 k − 1 − 1 Bias = 2^{k - 1} - 1 Bias=2k−1−1.
1. Conclusion & Provement
Suppose a k k k-bit biased numer and the actual value of its representation : X k X k − 1 . . . X 1 = ∑ n = 1 k X n ∗ 2 n − 1 − 2 k − 1 + 1 X_kX_{k-1}...X_1 = \sum_{n=1}^{k}{X_n*2^{n-1}} - 2^{k-1} + 1 XkXk−1...X1=∑n=1kXn∗2n−1−2k−1+1
To extend it to a $ k+1$ -bit number and its actual value: X k X k ‾ X k − 1 . . . X 1 = ∑ n = 1 k + 1 X n ∗ 2 n − 1 − 2 k + 1 X_k\overline{X_k}X_{k-1}...X_1 = \sum_{n=1}^{k+1}{X_n*2^{n-1}} - 2^{k} + 1 XkXkXk−1...X1=∑n=1k+1Xn∗2n−1</