Binary Number System: Representations | |
|
Offset Signed Binary Integer Begin with the number to be encoded.The examples, below, show how this technique would be used to represent -127, -85, 0, +42 and +127 in 8-bit offset:
Both sign-magnitude and offset representations have a significant limitation.
They cannot be used reliably for mathematical manipulation. Consider, for
example, the 8-bit sign-magnitude representations for +1 and -1. Clearly these
two values should add up to zero, but they do not:
According to this, +1 plus -1 equals -2. Wrong! Note that binary math works just like decimal math, but with fewer digits. In other words, all we need to remember is 0+0=0, 0+1=1, and 1+1=0, carry the 1.00000001 = +1 in sign-magnitude + 10000001 = -1 ---------- 10000010 = -2 Likewise, offset representations won't work: Again, we get silly answers: +1 plus -1 equals +127. A system of signed binary numbers must allow us to do binary math correctly. The following representation fits that requirement.10000000 = +1 in 127-offset + 01111110 = -1 ---------- 11111110 = +127 Next Page |
|