Definition
Offset Binary
Symmetry
There are two types of offset binary: symmetric and asymmetric offset.
Symmetric Offset
The Symmetric offset adds a single constant excess to all numbers:
The goal is to represent negative numbers as positive numbers. They don’t need to be stored as signed numbers. Thus, all numbers are representable by an excess if .
The excess is derived from the smallest representable negative number:
Example:
Actual Value | Calculation | Offset Binary Code | Binary Representation |
---|---|---|---|
-4 | -4 + 4 = 0 | 0 | 000 |
-3 | -3 + 4 = 1 | 1 | 001 |
-2 | -2 + 4 = 2 | 2 | 010 |
-1 | -1 + 4 = 3 | 3 | 011 |
0 | 0 + 4 = 4 | 4 | 100 |
1 | 1 + 4 = 5 | 5 | 101 |
2 | 2 + 4 = 6 | 6 | 110 |
3 | 3 + 4 = 7 | 7 | 111 |
For an unsigned bit pattern of bit length , the excess is always:
Asymmetric Offset
Arithmetic
Addition
Let b the excess, and and , adding these two excess-numbers is equal to:
Wrong:
Correct: